Azure DevOps ARM 部署管道任务失败。错误:BadRequest:不支持创建或更新系统管理的身份凭证

问题描述 投票:0回答:1

以下 yaml 脚本因 ARM 部署任务而失败。

该错误非常奇怪,因为我没有使用托管身份更新系统,但这是错误。

脚本如下:

- task: AzureResourceManagerTemplateDeployment@3
  inputs:
    deploymentScope: 'Resource Group'
    azureResourceManagerConnection: 'NewAzureConnection'
    subscriptionId: '8bxxxx28c1-4xxxc-axx-9xxxxx03'
    action: 'Create Or Update Resource Group'
    resourceGroupName: '$(ResourceGroupUAT)'
    location: '$(Location)'
    templateLocation: 'Linked artifact'
    csmFile: '$(System.DefaultWorkingDirectory)/adf-xxx-fabric-dev/ARMTemplateForFactory.json'
    csmParametersFile: '$(System.DefaultWorkingDirectory)/adf-xxxx-fabric-dev/ARMTemplateParametersForFactory.json'
    overrideParameters: '-factoryName $(DataFactoryUAT)'
    deploymentMode: 'Incremental'

enter image description here

对错误有什么想法吗?

正如 Vinicius 提到的,我认为问题出在 JSON 文件上。我将提供完整 JSON 文件的链接,同时 JSON 中引用 ManagedIdentity 的代码如下所示:

{
            "name": "[concat(parameters('factoryName'), '/WorkspaceSystemIdentity')]",
            "type": "Microsoft.DataFactory/factories/credentials",
            "apiVersion": "2018-06-01",
            "properties": {
                "type": "ManagedIdentity",
                "typeProperties": {}
            },
            "dependsOn": []

我应该更改托管身份吗?

azure-devops azure-pipelines azure-pipelines-yaml azure-pipelines-tasks
1个回答
0
投票

我通过注释掉引用托管身份的 ARMTemplateForFactory.json 解决了该问题:

// {
        //  "name": "[concat(parameters('factoryName'), '/WorkspaceSystemIdentity')]",
        //  "type": "Microsoft.DataFactory/factories/credentials",
        //  "apiVersion": "2018-06-01",
        //  "properties": {
        //      "type": "ManagedIdentity",
        //      "typeProperties": {}
        //  },
        //  "dependsOn": []
        // },
© www.soinside.com 2019 - 2024. All rights reserved.