【发布时间】:2016-02-10 19:51:25
【问题描述】:
我正在寻找使用 Azure 资源管理器模板配置 Azure Batch 的任何示例。谷歌搜索一无所获,Azure QuickStart Templates 还没有任何批处理示例,但this SO question 暗示它已经完成。
我想要实现的是,通过 ARM 模板,创建一个 Batch 帐户并配置一个池(具有最小计算节点数,自动扩展到最大节点数),然后设置生成的池ID 到我的 API 服务器的 appsettings 资源中。
我即将开始使用 Azure 资源资源管理器对其进行逆向工程,但非常感谢任何预先存在的示例。
更新
到目前为止,我已经设法创建了资源:
{
"name": "[variables('batchAccountName')]",
"type": "Microsoft.Batch/batchAccounts",
"location": "[resourceGroup().location]",
"apiVersion": "2015-07-01",
"dependsOn": [ ],
"tags": {
"displayName": "BatchInstance"
}
}
并在我的 API 服务器的appsettings 中配置帐户设置:
"BATCH_ACCOUNT_URL": "[concat('https://', reference(concat('Microsoft.Batch/batchAccounts/', variables('batchAccountName'))).accountEndpoint)]",
"BATCH_ACCOUNT_KEY": "[listKeys(resourceId('Microsoft.Batch/batchAccounts', variables('batchAccountName')), providers('Microsoft.Batch', 'batchAccounts').apiVersions[0]).primary]",
"BATCH_ACCOUNT_NAME": "[variables('batchAccountName')]"
我仍然没有设法通过 ARM 创建池并获取池 ID,主要是因为我使用 Batch Explorer 创建的池从未出现在 Azure 门户或 Azure 资源浏览器中。如果我找到解决方案,我会更新这个。
【问题讨论】:
标签: azure hpc azure-resource-manager azure-batch