I am trying to grant access to an AAD app under a different tenant, the command below works:
Set-AzureRmKeyVaultAccessPolicy -VaultName $vaultName -ResourceGroupName $rg -ApplicationId $appId -objectId $appObjectId `
-PermissionsToSecrets get -PermissionsToCertificates get -BypassObjectIdValidation
But the corresponding ARM template implementation doesn't:
"type": "Microsoft.KeyVault/vaults",
"apiVersion": "2015-06-01",
"name": "[parameters('KeyVaultName')]",
"properties": {
"accessPolicies": {
{
"tenantId": "current-tenant-id",
"objectId": "object-id",
"permissions": {
"secrets": [
"get"
]
}
},
{
"tenantId": "another-tenant-id", /* Raises: An invalid value was provided for 'accessPolicies' */
"objectId": "object-id",
"permissions": {
"secrets": [
"get"
]
}
}
}
Is there anything I am missing here?