0
我試圖向ARM腳本添加一個批處理帳戶(在用戶訂閱模式下)配置,但我面臨着循環依賴問題。在單個ARM腳本中創建批處理帳戶和密鑰庫
- 批量帳戶需要KeyVaultReference。
- 密鑰保險庫訪問策略 需要BatchAccount對象ID。
在這種情況下,我無法創建完全配置的服務。你知道我該如何從同一個ARM腳本創建兩個服務?
請看下面的例子:
{
"name": "[variables('keyVaultName')]",
"type": "Microsoft.KeyVault/vaults",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-01",
"properties": {
"sku": {
"family": "A",
"name": "Standard"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "[resourceId('Microsoft.Batch/batchAccounts', variables('batchAccountName'))]",
"permissions": {
"keys": [
"Update"
]
}
}
]
},
"dependsOn": [
"[resourceId('Microsoft.Batch/batchAccounts', variables('batchAccountName'))]"
]
},
{
"name": "[variables('batchAccountName')]",
"type": "Microsoft.Batch/batchAccounts",
"location": "[resourceGroup().location]",
"apiVersion": "2017-05-01",
"properties": {
"poolAllocationMode": "UserSubscription",
"autoStorage": {
"storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', variables('batchAccountStorageAccountName'))]"
},
"keyVaultReference": {
"id": "[concat(subscription().id, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.KeyVault/vaults/', variables('keyVaultName'))]",
"url": "[concat('https://', variables('keyVaultName'), '.vault.azure.net/')]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('batchAccountStorageAccountName'))]",
"[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]"
]
}
如果我的理解是正確的,你想給用戶 '微軟Azure Batch'許可,您可以得到在Azure門戶網站的對象ID。 ''訂閱'' - >'訪問控制(IAM)' - >'Microsoft Azure Batch' - >'屬性'。 –
它看起來不錯。我正在尋找一種方法,通過arm/ps(Azure訂閱步驟)將所有這些操作包含在自動化腳本中,但這是另一回事。謝謝! –