01 Run keyvault update command (Windows/macOS/Linux) using the name of the Azure Key Vault that you want to reconfigure as identifier parameter to enable the "Allow trusted Microsoft services to bypass this firewall" exception for the selected Key Vault:
az keyvault update
--name "cc-internal-app-vault"
--bypass AzureServices
02 The command output should return the metadata available for the reconfigured vault:
{
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcd1234abcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.KeyVault/vaults/cc-internal-app-vault",
"location": "westeurope",
"name": "cc-internal-app-vault",
"properties": {
"accessPolicies": [
{
"applicationId": null,
"objectId": "abcdabcd-1234-abcd-1234-abcd1234abcd",
"permissions": {
"certificates": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore",
"ManageContacts",
"ManageIssuers",
"GetIssuers",
"ListIssuers",
"SetIssuers",
"DeleteIssuers"
],
"keys": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore"
],
"secrets": [
"Get",
"List",
"Set",
"Delete",
"Recover",
"Backup",
"Restore"
],
"storage": null
},
"tenantId": "abcdabcd-1234-abcd-1234-abcd1234abcd"
}
],
"createMode": null,
"enablePurgeProtection": null,
"enableRbacAuthorization": false,
"enableSoftDelete": null,
"enabledForDeployment": false,
"enabledForDiskEncryption": false,
"enabledForTemplateDeployment": false,
"networkAcls": {
"bypass": "AzureServices",
"defaultAction": "Deny",
"ipRules": [],
"virtualNetworkRules": []
},
"provisioningState": "Succeeded",
"sku": {
"name": "standard"
},
"tenantId": "abcdabcd-1234-abcd-1234-abcd1234abcd",
"vaultUri": "https://cc-internal-app-vault.vault.azure.net/"
},
"resourceGroup": "cloud-shell-storage-westeurope",
"tags": {},
"type": "Microsoft.KeyVault/vaults"
}
03 Now that the exception is enabled in the firewall configuration, you have to explicitly grant access to the trusted Microsoft Azure cloud services by using the access policy associated with the selected vault. As example, the following configuration enables the Azure Resource Manager service (represented by --enabled-for-template-deployment parameter) to retrieve secrets from the selected vault when the vault is referenced in a template deployment, enables the Azure Virtual Machines service (--enabled-for-deployment parameter) to retrieve keys, secrets and certificates when the selected vault is referenced during the virtual machine creation, and enables the Azure Disk Encryption service (--enabled-for-disk-encryption parameter) to retrieve secrets and unwrap encryption keys. To explicitly allow access from these trusted Microsoft Azure services, run keyvault update command (Windows/macOS/Linux) to update the access policy configured for the selected vault:
az keyvault update
--name "cc-internal-app-vault"
--enabled-for-template-deployment "true"
--enabled-for-deployment "true"
--enabled-for-disk-encryption "true"
04 The command output should return the configuration metadata available for the reconfigured Key Vault:
{
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcd1234abcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.KeyVault/vaults/cc-internal-app-vault",
"location": "westeurope",
"name": "cc-internal-app-vault",
"properties": {
"accessPolicies": [
{
"applicationId": null,
"objectId": "abcdabcd-1234-abcd-1234-abcd1234abcd",
"permissions": {
"certificates": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore",
"ManageContacts",
"ManageIssuers",
"GetIssuers",
"ListIssuers",
"SetIssuers",
"DeleteIssuers"
],
"keys": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore"
],
"secrets": [
"Get",
"List",
"Set",
"Delete",
"Recover",
"Backup",
"Restore"
],
"storage": null
},
"tenantId": "abcdabcd-1234-abcd-1234-abcd1234abcd"
}
],
"createMode": null,
"enablePurgeProtection": null,
"enableRbacAuthorization": false,
"enableSoftDelete": null,
"enabledForDeployment": true,
"enabledForDiskEncryption": true,
"enabledForTemplateDeployment": true,
"networkAcls": {
"bypass": "AzureServices",
"defaultAction": "Deny",
"ipRules": [],
"virtualNetworkRules": []
},
"provisioningState": "Succeeded",
"sku": {
"name": "standard"
},
"tenantId": "abcdabcd-1234-abcd-1234-abcd1234abcd",
"vaultUri": "https://cc-internal-app-vault.vault.azure.net/"
},
"resourceGroup": "cloud-shell-storage-westeurope",
"tags": {},
"type": "Microsoft.KeyVault/vaults"
}
05 Repeat steps no. 1 – 4 for each Azure Key Vault available within the current subscription.
06 Repeat steps no. 1 – 5 for each subscription created in your Microsoft Azure cloud account.