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

Azure Data Factory用Web活动缩放弹性池:操作生效但活动失败

问题

在Azure Data Factory(ADF)中通过Web活动调用API缩放Azure弹性池,API配置如下:

{
    "url": "https://management.azure.com/subscriptions/subID/resourceGroups/RGNAME/providers/Microsoft.Sql/servers/sqlservername/elasticPools/elasticpoolname?api-version=2020-08-01-preview",
    "method": "PUT",
    "headers": {
        "Content-Type": "application/json"
    },
    "body": {
        "sku": {
            "name": "StandardPool",
            "tier": "Standard",
            "capacity": "50"
        },
        "location": "West Europe"
    },
    "authentication": {
        "type": "MSI",
        "resource": "https://management.azure.com/"
    }
}

活动执行失败,但弹性池的缩放操作实际已生效。当前ADF已拥有SQL Server的Contributor角色,错误信息如下:

"error": {
    "code": "AuthorizationFailed",
    "message": "The client 'ADF ID' with object id 'ADF ID' does not have authorization to perform action 'Microsoft.Sql/locations/elasticPoolOperationResults/read' over scope '/subscriptions/SUBID/resourceGroups/RGNAME/providers/Microsoft.Sql/locations/westeurope/elasticPoolOperationResults/id' or the scope is invalid. If access was recently granted, please refresh your credentials."
}

请问该如何解决此问题?

解决方法

  • 补充所需权限:错误核心是ADF的MSI缺少Microsoft.Sql/locations/elasticPoolOperationResults/read权限。虽然缩放PUT请求已成功执行,但Web活动需要读取操作结果来确认最终状态,因此触发权限报错。可按以下方式处理:
    • 给ADF的MSI在资源组或SQL Server层级分配SQL Server Contributor角色(该角色默认包含此读取权限);
    • 若使用自定义RBAC角色,需在角色定义中明确添加Microsoft.Sql/locations/elasticPoolOperationResults/read操作权限。
  • 等待权限同步:如果刚完成权限分配,Azure RBAC可能需要5-15分钟完成同步,等待后重新运行Web活动即可。
  • 可选:忽略结果检查(不推荐):若无需确认操作最终状态,可修改Web活动设置,跳过操作结果的读取步骤。但此方法无法确保操作完全成功,仅适用于已验证缩放逻辑绝对可靠的场景。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.26 10:02:19