.net Azure HTTP POST从Power BI Power Query请求访问令牌
我们使用grant_type=“client_credentials”和生成的令牌尝试了上述代码,但API未获得身份验证 请您与grant_type=“authorization\u code”分享该示例,当我们在上述代码中替换grant_type=“authorization\u code”时,我们会收到以下错误消息- “”查询中出现错误。DataSource.Error:Web.Contents无法从中获取内容.net Azure HTTP POST从Power BI Power Query请求访问令牌,.net,api,powerbi,powerquery,.net,Api,Powerbi,Powerquery,我们使用grant_type=“client_credentials”和生成的令牌尝试了上述代码,但API未获得身份验证 请您与grant_type=“authorization\u code”分享该示例,当我们在上述代码中替换grant_type=“authorization\u code”时,我们会收到以下错误消息- “”查询中出现错误。DataSource.Error:Web.Contents无法从中获取内容 let apiUrl = "https://login.windo
let
apiUrl = "https://login.windows.net/61xxxxxxxxxxxx/oauth2/token",
body = [
client_id="3728xxxxxxxxxxxxxx5",
grant_type="client_credentials",
client_secret="bxxxxxxxxxxxxh",
resource="api://xxxxxxxxxxxxxxxx5"
],
Source = Json.Document(Web.Contents(apiUrl, [Headers = [Accept = "application/json"],
Content = Text.ToBinary(Uri.BuildQueryString(body))]))
in
Source
'https://xxxxxxxxx/oauth2/token/' (400): Bad Request
Details:
DataSourceKind=Web
DataSourcePath=https://xxxxxxxxxx/oauth2/token
Url=https://xxxxxxxxxxxxxxxxxxxxx/oauth2/token/