Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure中的部署脚本ARM模板_Azure_Azure Devops_Azure Resource Manager_Azure Deployment - Fatal编程技术网

Azure中的部署脚本ARM模板

Azure中的部署脚本ARM模板,azure,azure-devops,azure-resource-manager,azure-deployment,Azure,Azure Devops,Azure Resource Manager,Azure Deployment,我正在使用部署脚本使用ARM运行powershell。它需要具有参与者角色的用户管理身份。我已经按照下面链接中的步骤进行了操作,但它总是给出相同的错误 根据链接的文章,它应该是这样的: 根据链接的文章,它应该是这样的: 我已经更新了上面的答案。在提供空标识后,我收到另一个错误。您应该接受此答案并提出新问题,因为这是一个完全不同的问题。其他问题已通过感谢解决。我已更新了上述答案。在提供空标识后,我遇到另一个错误您应该接受此答案并提出一个新问题,因为这是一个完全不同的问题树,其他问题通过感谢得到解决

我正在使用部署脚本使用ARM运行powershell。它需要具有参与者角色的用户管理身份。我已经按照下面链接中的步骤进行了操作,但它总是给出相同的错误


根据链接的文章,它应该是这样的:


根据链接的文章,它应该是这样的:


我已经更新了上面的答案。在提供空标识后,我收到另一个错误。您应该接受此答案并提出新问题,因为这是一个完全不同的问题。其他问题已通过感谢解决。我已更新了上述答案。在提供空标识后,我遇到另一个错误您应该接受此答案并提出一个新问题,因为这是一个完全不同的问题树,其他问题通过感谢得到解决。
Invalid value for the identities '/subscriptions/<subID>/resourcegroups/<rgname>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test_manged_identity'. The 'UserAssignedIdentities' property keys should only be empty json objects, null or the resource exisiting property.
<pre>
     {
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "name": {
      "type": "string",
      "defaultValue": "'ds test'"
    },
    "utcValue": {
      "type": "string"
    },
    "subscriptionId": {
      "type": "string",
      "defaultValue": ""
    }
  },
  "resources": [
    {
      "type": "Microsoft.Resources/deploymentScripts",
      "apiVersion": "2019-10-01-preview",
      "identity": {
        "type": "userAssigned",
        "userAssignedIdentities": {
          "/subscriptions/subid/resourcegroups/rGname/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test_manged_identity": {
            "ClientId": "value",
            "PrincipalId": "value"
          }
        }
      },
      "kind": "AzurePowerShell", // or "AzureCLI"
      "location": "[resourceGroup().location]",
      "name": "runPowerShellInlineWithOutput",
      "properties": {
        "containerSettings": {
          "containerGroupName": "deployscriptrun"
        },
        "storageAccountSettings": {
          "storageAccountName": "allscriptstorage",
          "storageAccountKey": "key"
        },
        "azPowerShellVersion": "3.0", // or "azCliVersion": "2.0.80"
        "environmentVariables": [
          {
            "name": "someSecret",
            "secureValue": "if this is really a secret, don't put it here... in plain text..."
          }
        ],
        "scriptContent" : "write-host 'hello world'",
        "supportingScriptUris": [],
        //"timeout": "PT30M",
        "cleanupPreference": "OnSuccess",
        "retentionInterval": "P1D"
      }
    }
  ],
  "outputs": {
  }
}

</pre>
"userAssignedIdentities": { "/subscriptions/subid/resourcegroups/rGname/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test_manged_identity": {} }
{
                "code": "DeploymentScriptOperationFailed",
                "message": "The client 'id' with object id 'id' does not have authorization to perform action 'Microsoft.Resources/subscriptions/providers/read' over scope '/subscriptions/id' or the scope is invalid. If access was recently granted, please refresh your credentials."
            }
"userAssignedIdentities": {
    "/subscriptions/subid/resourcegroups/rGname/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test_manged_identity": {}
}