KeyVault我在引用我在同一模板中与实例一起创建的用户分配的身份时遇到问题。我已经搜索了有关如何一般引用托管身份的文档,我相信它如下所示:
reference(resourceId('resource-type', 'resource-name'), 'api-version', 'Full)).identity.principalId\nRun Code Online (Sandbox Code Playgroud)\n但是,这对我不起作用,我不确定它是否与在订阅范围内部署我的模板有关。我目前正在使用linkedTemplates这样我可以更好地组织我的代码并拥有如下所示的主模板:
{\n "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",\n "contentVersion": "1.0.0.1",\n "parameters": {},\n "resources": [\n {\n "apiVersion": "2020-06-01",\n "location": "[variables('location')]", \n "name": "key-vault-test\xe2\x80\x9d,\n "properties": {\n "mode": "Incremental",\n "parameters": { },\n "templateLink": {\n "relativePath": \xe2\x80\x9cvault.json"\n }\n },\n "type": "Microsoft.Resources/deployments"\n }\n ],\n}\nRun Code Online (Sandbox Code Playgroud)\n接下来,vault.json如下:
{\n "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",\n "contentVersion": "1.0.0.1",\n "parameters": {\n \xe2\x80\xa6\n },\n "resources": [\n {\n "apiVersion": "2018-05-01",\n "location": \xe2\x80\x9c[\xe2\x80\xa6..]\xe2\x80\x9d,\n "name": "key-vault",\n "type": "Microsoft.Resources/resourceGroups"\n },\n {\n "apiVersion": "2020-06-01",\n "dependsOn": [\n "[resourceId('Microsoft.Resources/resourceGroups', …Run Code Online (Sandbox Code Playgroud) azure azure-keyvault azure-rm-template azure-managed-identity