通过 API 禁用 PowerBi 计划刷新的正确 JSON 正文是什么

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

这是 Microsoft 提供的请求正文,用于通过 Rest API 禁用 PowerBi 计划刷新 { "value": { "enabled": false } }

当我在 ADF 中使用服务主体调用 API 并使用相同的请求正文时,出现以下错误。

{"error":{"code":"InvalidRequest","message":"无效的NotifyOption 仅适用于应用程序所有者请求的值“MailOnFailure””}}

如果我像这样修改身体,

{ "value": { "enabled": false, "ScheduleNotifyOption":"NoNotification" } }

我收到以下错误

{“错误”:{“代码”:“BadRequest”,“消息”:“错误 请求","详细信息":[{"消息":"值不能为空。 范围 名称:nullableType","target":"datasetModelRefreshSchedule"}]}}

API 上的注释指出“禁用刷新计划的请求不应包含其他更改。”

enter image description here 这是网络活动代码

{ "name": "Disable dataset refresh", "type": "WebActivity", "dependsOn": [ { "activity": "Takeover dataset", "dependencyConditions": [ "Succeeded" ] } ], "policy": { "timeout": "0.00:10:00", "retry": 5, "retryIntervalInSeconds": 30, "secureOutput": false, "secureInput": false }, "userProperties": [], "typeProperties": { "method": "PATCH", "headers": { "Authorization": { "value": "@concat(\n string(activity('Get AAD Token').output.token_type)\n , ' '\n , string(activity('Get AAD Token').output.access_token)\n )", "type": "Expression" } }, "url": { "value": "https://api.powerbi.com/v1.0/myorg/groups/@{pipeline().parameters.PBIWorkspaceId}/datasets/@{pipeline().parameters.PBIDatasetId}/refreshSchedule", "type": "Expression" }, "body": { "value": { "enabled": false } }, "authentication": { "type": "ServicePrincipal", "userTenant": { "value": "@pipeline().globalParameters.TenantId", "type": "Expression" }, "username": { "value": "@pipeline().parameters.SP_ClientId", "type": "Expression" }, "resource": "https://analysis.windows.net/powerbi/api", "password": { "type": "AzureKeyVaultSecret", "store": { "referenceName": "LS_KV", "type": "LinkedServiceReference", "parameters": { "baseUrl": { "value": "@pipeline().globalParameters.KeyVaultUrl", "type": "Expression" } } }, "secretName": "xxx" } } } }

我该如何纠正这个问题?

json powerbi azure-data-factory powerbi-rest-api
1个回答
0
投票
{“error”:{“code”:“InvalidRequest”,“message”:“仅应用程序所有者请求的 NotifyOption 值“MailOnFailure”无效”}}

在 Azure 数据工厂 (ADF) 中使用服务主体时,您遇到 Power BI REST API 问题。该错误消息表明“
NotifyOption

”值设置为“MailOnFailure”存在问题,该值对于仅限应用程序的所有者请求无效。 服务主体仅在终止计划刷新时支持“ScheduleNotifyOption”的

NoNotification

值。这意味着在使用服务主体进行身份验证时不能使用“MailOnFailure”选项;它应该被省略或设置为“NoNotification”。

您调整并尝试请求正文中的“NotifyOption”,以符合服务主体支持的值。

参考

https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/update-refresh-schedule-in-group

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