azure - 我的 Azure ML api 其余部分返回一个空对象

标签 azure machine-learning oauth-2.0 azure-machine-learning-service

我的问题

我尝试使用 REST API 进行机器学习。无论我正在测试什么 API,以下 PowerShell 都不会失败,但会返回一个空对象。 我的 SPN 具有贡献者权限,我已授予同意并检查我是否获得了 token 。

我正在使用的文档:

https://learn.microsoft.com/fr-fr/rest/api/azureml/quotas/list

我还测试了其他几个 GET API。

我不知道还能做什么。有什么想法吗?

我的 Powershell 代码

$tenant_id = "XXXXXXXXXXXXXXXXXXX"
$ApplicationId = "XXXXXXXXXXXXXXX"
$spn_client_secret = "XXXXXXXXXXXXX"
$subscriptionid="XXXXXXXXXXXX"
$uri = "https://login.microsoftonline.com/$tenant_id/oauth2/token"

$BodyText = "grant_type=client_credentials&client_id=$ApplicationId&resource=https://management.azure.com&client_secret=$spn_client_secret"

# GET TOKEN
$Response = Invoke-RestMethod -Method POST -Body $BodyText -Uri $URI -ContentType application/x-www-form-urlencoded        
$aad_access_token = $Response.access_token

# tested, I effectively have a token

# READ ml

$urllist = "https://management.azure.com/subscriptions/$subscriptionid/providers/Microsoft.MachineLearningServices/locations/westeurope/quotas?api-version=2021-03-01-preview"

$headers = @{"Authorization" = "Bearer " + $aad_access_token}

Invoke-RestMethod -Method GET -HEADERS $headers -Uri $urllist -ContentType application/x-www-form-urlencoded  

最佳答案

我发现发生了什么事,我有点困惑。

资源是空的,因为我完全忘记创建计算!

关于azure - 我的 Azure ML api 其余部分返回一个空对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69906308/

相关文章:

c# - Azure Function App 如何与 Azure 资源交互?

Azure 数据工厂 SQL 触发器事件

python - 将多个输入传递到 Keras 模型时出错

python - 如何使用 Google API 在 OAuth 2.0 中传递 'Authorization' header 值

azure - Paypal IPN 返回 302

python - 超出语言工作线程重新启动运行时重试计数 :python. 关闭并主动回收 - Azure 函数应用程序

python - Keras 深度变分自动编码器

machine-learning - 增加 Triplet loss 的 alpha 有什么缺点吗?

oauth-2.0 - 是否可以在另一个 API 服务器上验证 Netlify Identity 用户?

java - 已构建异常 : This object has already been built