【问题标题】:getting error -> does not support the API version '2022-05-01' while making query for AZURE-ARM using CURL在使用 CURL 查询 AZURE-ARM 时出现错误 -> 不支持 API 版本 \'2022-05-01\'
【发布时间】:2022-10-17 17:26:10
【问题描述】:

我正在尝试使用 CLI 获取 AML 令牌。 我可以使用命令获取令牌 ->token=$(az account get-access-token --subscription {subscri ID} --resource-type arm --query accessToken --output tsv)

但是当我使用此令牌获取 AMLToken 时,我得到以下错误,但是如果我使用 postman 进行此查询,它工作正常:curl -d POST --header "授权:承载 $token" "https://management.azure.com/subscriptions/{subcri id}/resourceGroups/{res_grup}/providers/Microsoft.MachineLearningServices/workspaces/{workspace}/ onlineEndpoints/{endpoint}/token?api-version=2022-05-01"

我得到的错误如下:

{ “错误”: { "code": "UnsupportedApiVersion", "message": "与请求 URI 匹配的 HTTP 资源 'https://cert-eastus2.experiments.azureml.net/mferp/managementfrontend/subscriptions/{sub_id}/resourceGroups/{r_group}/providers/Microsoft.MachineLearningServices/ workspaces/{workspace}/onlineEndpoints/{endpoint}/token' 不支持 API 版本 '2022-05-01'。", “内部错误”:空 } }

请提供任何帮助或指示,为什么我会收到此错误?无法找到它的任何文档。

【问题讨论】:

    标签: azure curl azure-resource-manager azure-cli api-versioning


    【解决方案1】:

    我试图在我的环境中重现相同的结果并得到以下结果

    我跑了相同的命令就像你一样,得到了同样的错误如下:

    token=$(az account get-access-token --subscription subscriptionID --resource-type arm --query accessToken --output tsv)
    url="https://management.azure.com/subscriptions/subscriptionID/resourceGroups/rgname/providers/Microsoft.MachineLearningServices/workspaces/workspace_name/onlineEndpoints/endpoint_name/token?api-version=2022-05-01"
    curl -d POST --header "Authorization: Bearer $token" $url 
    

    回复:

    当我通过邮差, 我拿到AML token成功如下:

    或者,利用下面Azure CLI命令获取AML token如下所示:

    az ml online-endpoint get-credentials --name <endpoint_name> --resource-group <rg_name> --workspace-name <workspace_name>
    

    我运行了相同的命令并得到了AML token成功如下:

    当我在jwt.ms 中解码令牌时,我得到了索赔与来自的令牌相同邮差如下所示:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-04
      • 2013-12-05
      • 1970-01-01
      • 2014-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多