-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
post-infra creation task for local CS development permissions (#918)
the `local-cs-permissions` task in `dev-infrastructure/Makefile` will set up permissions into OIDC storage accounts, SVC KVs and MC KVs Signed-off-by: Gerd Oberlechner <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
PRINCIPAL_ID=$1 | ||
RG_NAME=$2 | ||
KV_NAME=$3 | ||
|
||
KV_RESOURCE_ID=$(az keyvault show --name ${KV_NAME} --resource-group ${RG_NAME} --query id -o tsv 2>/dev/null) | ||
|
||
if [ -z "${KV_RESOURCE_ID}" ]; then | ||
echo "Error: Key Vault resource ID for ${KV_NAME} in ${RG_NAME} could not be retrieved." | ||
exit 0 | ||
fi | ||
|
||
az role assignment create \ | ||
--role "Key Vault Secrets Officer" \ | ||
--assignee ${PRINCIPAL_ID} \ | ||
--scope ${KV_RESOURCE_ID} \ | ||
--only-show-errors | ||
|
||
az role assignment create \ | ||
--role "Key Vault Certificates Officer" \ | ||
--assignee ${PRINCIPAL_ID} \ | ||
--scope ${KV_RESOURCE_ID} \ | ||
--only-show-errors | ||
|
||
az role assignment create \ | ||
--role "Key Vault Certificate User" \ | ||
--assignee ${PRINCIPAL_ID} \ | ||
--scope ${KV_RESOURCE_ID} \ | ||
--only-show-errors |