I'm brand new to Azure and am trying to create a KV managed storage account. I've created a resource group, an ADLS account and a Key Vault. I've tried running these commands:
az role assignment create --role "Storage Account Key Operator Service Role" --assignee "https://vault.azure.net" --scope "/subscriptions/<subscriptionID>/resourceGroups/<StorageAccountResourceGroupName>/providers/Microsoft.Storage/storageAccounts/**myADLSaccName**"
az keyvault storage add --vault-name **myKVname** -n **myADLSaccName** --active-key-name key1 --auto-regenerate-key --regeneration-period P30D --resource-id "/subscriptions/**mySubscriptionID**/resourceGroups/Sab_RG/providers/Microsoft.Storage/storageAccounts/**myADLSaccName**"
The first one runs fine, the second one keeps giving me this error:
'storage' is misspelled or not recognized by the system. Did you mean 'restore' ?
Initially, I followed the same document and I got the same error in my environment like same as above.
As of now, the
az keyvault storagecommand is not available in theAzure CLIcommands.I checked with the below command:
In the above command, there is no
storagesubgroup as of now:Alternatively, If you need to create a KV-managed storage account. you can use the
PowerShellcommand:Command:
The above command equals the same command as
az keyavult storage addsets up an existing Azure Storage Account with Key Vault for Storage Account keys to be managed by Key Vault.Output:
Reference: Add-AzKeyVaultManagedStorageAccount (Az.KeyVault) | Microsoft Learn