使用 Azure Synapse 管道中的 Web 活动调用 Azure Data Lake Storage Gen2 REST API

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

如何使用 Azure Data Lake Storage Gen2 REST API 通过 Synapse 管道中的 Web 活动重命名 Azure 存储帐户中的文件夹? 这些文件夹位于同一个容器中,我需要通过执行管道来重命名它们。

azure azure-pipelines azure-storage pipeline azure-synapse-analytics
1个回答
0
投票

要使用 REST API 和 ADF 中的 Web 活动重命名 ADLS Gen 2 中的文件夹,请按照以下步骤操作:

首先,将

storage blob data contributor
角色添加到您的 ADF 托管身份,如下所示:

第1步:进入ADLS账户的IAM,点击“添加角色分配”,如下图:

enter image description here

第二步:搜索

storage Blob data contributor
角色并选择,如下图:

enter image description here

第三步:选择托管身份,如下图:

enter image description here

成功分配角色后,转到 ADF 工作区,创建包含 Web 活动的管道,并按如下方式配置 Web 活动:

按以下格式提及 URL:

 https://<storageAccountName>.dfs.core.windows.net/<containerName>/<newNameOfFolder>

选择

PUT
方法并将
@toLower('')
动态内容添加到正文中。选择 系统分配的托管身份 作为使用
https://storage.azure.com
资源的身份验证方法。添加
x-ms-rename-source
作为标题,其值为
/<containerName>/<oldNameOfFolder>
,如下所示:

enter image description here

调试管道;它将成功运行并重命名该文件夹。您可以查看下面的图片:

重命名前:

enter image description here

重命名后:

enter image description here

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