【问题标题】:Azure Batch API rising 'AttributeError' in ML notebookML 笔记本中的 Azure Batch API 上升“AttributeError”
【发布时间】:2021-06-03 09:24:34
【问题描述】:

我正在尝试通过以下方式使用 python API 与 Azure Batch 交互:

from azure.batch import BatchServiceClient
batch = BatchServiceClient('<mycredential>','https://<mybatchaccount>.<region>.batch.azure.com')
next(batch.job.list())

这是在 ML Studio 笔记本中运行的。

但是出现以下错误:AttributeError: 'str' object has no attribute 'signed_session'.
我正在从我的批处理控制台 UI 中获取 url 和凭据:

作为凭证,我尝试了主要和次要访问密钥以及“URL”作为批处理 url。
我做错了什么吗?
谢谢

【问题讨论】:

    标签: python azure azure-batch azureml


    【解决方案1】:

    &lt;mycredential&gt; 不应该是您的裸身份验证密钥字符串。您需要创建一个共享的身份验证密钥对象。

    credentials = batchauth.SharedKeyCredentials(BATCH_ACCOUNT_NAME, BATCH_ACCOUNT_KEY)
    batch_client = batch.BatchServiceClient(credentials, base_url=BATCH_ACCOUNT_URL)
    

    请查看Azure Batch Python tutorial

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多