You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用AzureFileCopy@6复制文件至Azure Blob时遇“Invalid Auto-login type specified”错误

解决AzureFileCopy@6 "Invalid Auto-login type specified" 错误

问题原因

你的存储账户已禁用密钥访问,默认依赖密钥的认证方式失效,但AzureFileCopy@6任务未显式配置使用Microsoft Entra ID(服务主体)认证,导致触发该错误。

解决方案

修改AzureFileCopy@6任务配置,添加认证类型参数指定使用服务主体认证,同时启用AzCopy的Entra ID认证模式,配置如下:

- 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
    # 新增认证相关配置
    AuthenticationType: ServicePrincipal
    UseAzCopy: true
    UseAzCopyAuth: true
  continueOnError: true

关键说明

  • AuthenticationType: ServicePrincipal:指定任务使用关联的Azure服务主体完成认证,匹配你已配置的Storage Blob Data Contributor角色权限。
  • UseAzCopy: true 和 UseAzCopyAuth: true:启用AzCopy v10的原生Entra ID认证能力,适配禁用密钥的存储账户场景。

额外确认:服务主体需分配到存储账户层级的Storage Blob Data Contributor角色,避免因权限范围不足导致后续访问失败。

内容的提问来源于stack exchange,提问作者PUpskill

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 20:14:49