使用 Azure 资源管理器模板配置 Azure Batch
Configuring Azure Batch using an Azure Resource Manager template
我正在寻找使用 Azure 资源管理器模板配置 Azure Batch 的任何示例。谷歌搜索一无所获,Azure QuickStart Templates do not yet have any Batch examples, however 暗示它已经完成。
我想实现的是,通过ARM模板,创建一个Batch账户,配置一个pool(最小计算节点数,自动扩展到最大节点数),然后设置生成的池 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 资源浏览器中。如果我找到解决方案,我会更新这个。
遗憾的是,我们目前无法使用 ARM 模板创建池。 Azure 门户应显示在您的帐户下创建的池(即使您不是使用 ARM 创建的)。
这是支持的,请在此处查看参考文档:https://docs.microsoft.com/azure/templates/microsoft.batch/2019-04-01/batchaccounts/pools
我正在寻找使用 Azure 资源管理器模板配置 Azure Batch 的任何示例。谷歌搜索一无所获,Azure QuickStart Templates do not yet have any Batch examples, however
我想实现的是,通过ARM模板,创建一个Batch账户,配置一个pool(最小计算节点数,自动扩展到最大节点数),然后设置生成的池 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 资源浏览器中。如果我找到解决方案,我会更新这个。
遗憾的是,我们目前无法使用 ARM 模板创建池。 Azure 门户应显示在您的帐户下创建的池(即使您不是使用 ARM 创建的)。
这是支持的,请在此处查看参考文档:https://docs.microsoft.com/azure/templates/microsoft.batch/2019-04-01/batchaccounts/pools