使用 REST API 和 cron 任务自动登录 Power BI
Auto login in Power BI with REST API with cron task
我想在 Azure 门户中自动登录 access_token,以便我可以将数据发送到 Power BI 数据集。来自 Rails 我目前正在使用的应用程序中的 cron 任务
OAuth2::Client
和
OAuth2::AccessToken
用于生成令牌。
我将 username
、password
、grant_type => 'password'
和 scope => 'openid
' 添加到 OAuth2::Client
,但它不起作用,缺少某些东西
我明白了。现在我使用 rest_client
而不是 Oauth2
request = RestClient.post( url,
{
:grant_type => 'password',
:scope => 'openid',
:resource => 'https://analysis.windows.net/powerbi/api',
:client_id => 'CLIENT_ID',
:client_secret => 'CLIENT_SECRET',
:username => 'USERNAME',
:password => 'PASSWORD'
})
我想在 Azure 门户中自动登录 access_token,以便我可以将数据发送到 Power BI 数据集。来自 Rails 我目前正在使用的应用程序中的 cron 任务
OAuth2::Client
和
OAuth2::AccessToken
用于生成令牌。
我将 username
、password
、grant_type => 'password'
和 scope => 'openid
' 添加到 OAuth2::Client
,但它不起作用,缺少某些东西
我明白了。现在我使用 rest_client
而不是 Oauth2
request = RestClient.post( url,
{
:grant_type => 'password',
:scope => 'openid',
:resource => 'https://analysis.windows.net/powerbi/api',
:client_id => 'CLIENT_ID',
:client_secret => 'CLIENT_SECRET',
:username => 'USERNAME',
:password => 'PASSWORD'
})