Skip to content

Commit dd09297

Browse files
committed
CLI sample for existing account
1 parent 7402b40 commit dd09297

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

articles/storage/common/customer-managed-keys-configure-cross-tenant-existing-account.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,26 @@ Next, call [az storage account update](/cli/azure/storage/account#az-storage-acc
9797
Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
9898

9999
```azurecli
100-
100+
accountName="<storage-account>"
101+
kvUri="<key-vault-uri>"
102+
keyName="<key-name>"
103+
multiTenantAppId="<multi-tenant-app-id>" # appId value from multi-tenant app
104+
105+
# Get the resource ID for the user-assigned managed identity.
106+
identityResourceId=$(az identity show --name $userIdentityName \
107+
--resource-group $isvRgName \
108+
--query id \
109+
--output tsv)
110+
111+
az storage account update --name $accountName \
112+
--resource-group $isvRgName \
113+
--identity-type SystemAssigned,UserAssigned \
114+
--user-identity-id $identityResourceId \
115+
--encryption-key-vault $kvUri \
116+
--encryption-key-name $keyName \
117+
--encryption-key-source Microsoft.Keyvault \
118+
--key-vault-user-identity-id $identityResourceId \
119+
--key-vault-federated-client-id $multiTenantAppId
101120
```
102121

103122
---

0 commit comments

Comments
 (0)