【问题标题】:azure batch network_configuration -> "failed to authenticate"天蓝色批处理网络配置->“验证失败”
【发布时间】:2017-10-23 15:12:55
【问题描述】:

我正在使用 Azure 批处理服务在 ubuntu 节点上进行计算,它运行良好。最近我想将节点更改为在同一个子网上,这样我将来就有可能使用 mpi 以及使用 NFS 对 azure 上的公共文件服务器进行文件访问。

但添加后:

network_configuration = batchmodels.NetworkConfiguration(subnet_id=subnet.id)

到我的 batchmodels.PoolAddParameter 我突然收到:

{'value': '服务器验证请求失败。确保 授权头的值形成 正确。\nRequestId:a815194a-8a66-4cb4-847e-60db4ca3ff10\nTime:2017-10-23T15:04:00.3938448Z', 'lang': 'en-US'}

任何想法为什么?没有 network_configuration 我的池开始正常...

【问题讨论】:

标签: python azure azure-batch


【解决方案1】:

终于搞定了……

我需要为这里使用的两个客户端拥有相同的凭据(然后又不完全)。我还需要在我必须设置的应用程序中激活批处理才能获取凭据......我以这样的方式结束:

def get_credentials(res):
    if res=='mgmt':
        r='https://management.core.windows.net/'
    elif res=='batch':
        r="https://batch.core.windows.net/"

    credentials = ServicePrincipalCredentials(
        client_id = id,
        secret = secret,
        tenant = tenant,
        resource = r
    )
    return credentials
network_client = NetworkManagementClient(get_credentials('mgmt'), sub_id)
batch_client = batch.BatchServiceClient( get_credentials('batch'), base_url=batchserviceurl)

【讨论】:

    【解决方案2】:

    您需要使用Azure Active Directory 对批处理服务进行身份验证,以便在具有批处理服务池分配模式帐户(这是默认设置)的池上启用NetworkConfiguration

    【讨论】:

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