AzureFileCopy@6 - 指定的 Azure 无效自动登录类型

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

我正在使用 AzureFileCopy@6 将文件复制到 Azure Blob 存储,但遇到错误:“指定的自动登录类型无效。”

“允许存储帐户密钥访问”已禁用,“Azure 门户中默认为 Microsoft Entra 授权”已启用。我已向服务主体授予存储 Blob 数据贡献者角色。

- task: AzureFileCopy@6
    displayName: 'Configs Files Copy'
          inputs:
            SourcePath: '$(System.DefaultWorkingDirectory)/$(Build.DefinitionName)/ConfigurationFiles/ApplicationService/BlobStorageFiles/ConfigsFiles'
            azureSubscription: 'azureSubscription1'
            Destination: AzureBlob
            storage: 'storage1'
            ContainerName: configsfiles
          continueOnError: true

Screenshot

powershell azure-pipelines azure-file-copy
1个回答
0
投票

AzureFileCopy@6 - 指定的 Azure 无效自动登录类型

出现上述错误可能是您为 AzureFileCopy 任务指定的身份验证类型无效。 AzureFileCopy@6 任务支持

Workload Identity Federation
并使用
Azure RBAC
访问 Azure 存储。

在我的环境中,创建的服务连接添加了

Storage blob data contributor role
来访问 Blob 存储。

传送门: enter image description here

enter image description here

现在,使用下面的 yaml 脚本已成功从源路径复制到目标路径。

脚本:.

steps:
- task: AzureFileCopy@6
  inputs:
    SourcePath: 'sample.txt'
    azureSubscription: '<your service connection name>'
    Destination: 'AzureBlob'
    storage: 'venkat789'
    ContainerName: 'test'
displayName: AzureFileCopy

参考:

© www.soinside.com 2019 - 2024. All rights reserved.