Skip to content

Commit

Permalink
Update local debugging for RBAC key vaults (#4133)
Browse files Browse the repository at this point in the history
* update

* update core version

---------

Co-authored-by: Tim Allen <[email protected]>
  • Loading branch information
tim-allen-ck and tp-allen authored Nov 12, 2024
1 parent 35cd559 commit 897f1b1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions core/terraform/json-to-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jq -r '
"path": "keyvault_uri",
"env_var": "KEYVAULT_URI"
},
{
"path": "keyvault_resource_id",
"env_var": "KEYVAULT_RESOURCE_ID"
},
{
"path": "azure_tre_fqdn",
"env_var": "FQDN"
Expand Down
4 changes: 4 additions & 0 deletions core/terraform/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ output "keyvault_uri" {
value = azurerm_key_vault.kv.vault_uri
}

output "keyvault_resource_id" {
value = azurerm_key_vault.kv.id
}

output "service_bus_resource_id" {
value = azurerm_servicebus_namespace.sb.id
}
Expand Down
2 changes: 1 addition & 1 deletion core/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.11.0"
__version__ = "0.11.1"
11 changes: 5 additions & 6 deletions devops/scripts/setup_local_debugging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ private_env_path="./core/private.env"
: "${EVENT_GRID_AIRLOCK_NOTIFICATION_TOPIC_RESOURCE_ID?"Check EVENT_GRID_AIRLOCK_NOTIFICATION_TOPIC_RESOURCE_ID is defined in ${private_env_path}"}"
: "${KEYVAULT_URI?"Check KEYVAULT_URI is defined in ${private_env_path}"}"
: "${KEYVAULT?"Check KEYVAULT is defined in ${private_env_path}"}"
: "${KEYVAULT_RESOURCE_ID?"Check KEYVAULT_RESOURCE_ID is defined in ${private_env_path}"}"

set -o pipefail
set -o nounset
Expand Down Expand Up @@ -135,13 +136,11 @@ az role assignment create \
--assignee "${RP_TESTING_SP_APP_ID}" \
--scope "${SERVICE_BUS_RESOURCE_ID}"


# Assign get permissions on the keyvault
az keyvault set-policy \
--name "${KEYVAULT}" \
--spn "${RP_TESTING_SP_APP_ID}" \
--secret-permissions get

az role assignment create \
--role "Key Vault Secrets User" \
--assignee "${RP_TESTING_SP_APP_ID}" \
--scope "${KEYVAULT_RESOURCE_ID}"

# Write the appId and secret to the private.env file which is used for RP debugging
# First check if the env vars are there already and delete them
Expand Down

0 comments on commit 897f1b1

Please sign in to comment.