【问题标题】:How to grant access to Azure File Copy of Azure Pipeline to Azure Storage?如何向 Azure 存储授予对 Azure Pipeline 的 Azure 文件副本的访问权限?
【发布时间】:2021-12-21 23:14:29
【问题描述】:

我想通过 Azure 管道复制 Azure 文件复制文件。

我听从https://praveenkumarsreeram.com/2021/04/14/azure-devops-copy-files-from-git-repository-to-azure-storage-account/的指示

我正在使用名为“My Sandbox (a1111e1-d30e-4e02-b047-ef6a5e901111)”的自动创建的服务连接

AzureBlob 文件复制出现错误:

 INFO: Authentication failed, it is either not correct, or 
 expired, or does not have the correct permission -> 
 github.com/Azure/azure-storage-blob-go/azblob.newStorageError, 
 /home/vsts/go/pkg/mod/github.com/!azure/azure-storage-blob- 
 go@v0.10.1-0.20201022074806- 
 8d8fc11be726/azblob/zc_storage_error.go:42

 RESPONSE Status: 403 This request is not authorized to perform 
 this operation using this permission.

我假设 Azure Pipeline 无权访问 Azure 存储。 我想知道如何找到应该访问 Azure 存储的服务主体。

【问题讨论】:

  • 博主在 Azure 文件复制任务版本4.* 中出现同样的错误,在版本3.* 中有效,您尝试过吗?

标签: azure-devops azure-storage


【解决方案1】:

我也可以在我这边重现您的问题,因为不同的 Azure 文件复制任务版本在后面使用不同版本的AzCopy,然后他们使用不同的身份验证方式调用 API 进行操作。

有两种方法可以解决此问题。

  1. 如果你使用自动创建的服务连接,它应该在你的存储帐户中有Contributor角色,你可以使用Azure文件复制任务版本3.*而不是4.*,那么它就可以工作了。

  2. 如果要使用 Azure 文件复制任务版本 4.*,请导航到您的存储帐户 -> Access Control (IAM) -> 将服务连接中使用的服务主体添加为 Storage Blob Data Contributor 角色,请参阅详细步骤 @987654321 @。它也会起作用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-23
    • 2018-10-24
    • 1970-01-01
    • 1970-01-01
    • 2020-08-31
    • 2021-11-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多