【问题标题】:What are the ARM Template equivalents for these csdef and cscfg values这些 csdef 和 cscfg 值的 ARM 模板等效项是什么
【发布时间】:2018-08-30 20:54:32
【问题描述】:

我目前有一个代码库,其中包含许多经典的 Azure 云服务工作者角色。从长远来看,我想将整个基础架构迁移到 Azure Service Fabric,但作为第一步,我想更新部署模型以使用 ARM 模板。

I found another answer that seems to have a barebones ARM template to deploy a Cloud Service (classic) component,但我不确定如何将其转换为我自己的应用程序。

具体来说,我将如何/在哪里从我的工作角色的csdef file 定义以下标签和属性:

WorkerRole (name, vmsize)
startup tasks (command line, execution context, task type, task variables)
configuration settings
certificates
localresources

它是cscfg files:

Serviceconfiguration  (name, osFamily, osVersion)
Role (name)
Instances (count)
ConfigurationSettings (and all the setting name/values under it)
certificates

【问题讨论】:

标签: azure azure-resource-manager azure-cloud-services azure-worker-roles arm-template


【解决方案1】:

不幸的是,目前无法使用 ARM 模板部署 PaaS v1 云服务部署(Web/工作者角色)。您引用的另一篇 SO 帖子仅部署云服务(生产和暂存槽的逻辑父级),而不是将实际服务本身部署到生产或暂存槽之一。

【讨论】:

    【解决方案2】:

    可以使用 ARM 部署您的经典云服务:

    • 包链接是您的*.cspkg 文件的URI。
    • 配置链接是您的*.cscfg 文件的URI。

    我建议您在部署模板之前将文件上传到 blob 存储。

    {
      "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "resources": [{
          "apiVersion": "2015-06-01",
          "name": "[parameters('name')]",
          "location": "[parameters('location')]",
          "type": "Microsoft.ClassicCompute/domainNames"
        },
        {
          "apiVersion": "2015-06-01",
          "name": "[parameters('slotName')]",
          "type": "Microsoft.ClassicCompute/domainNames/slots",
          "dependsOn": [
            "[parameters('name')]"
          ],
          "properties": {
            "deploymentLabel": "[parameters('deploymentLabel')]",
            "packageLink": {
              "Uri": "[parameters('packageLink')]"
            },
            "configurationLink": {
              "Uri": "[parameters('configurationLink')]"
            },
            "deploymentOptions": "[parameters('deploymentOptions')]"
          }
        }
      ]
    }
    

    如果您需要更多信息(例如添加证书),请告诉我。

    【讨论】:

    • 你自己真的做过吗?我还没有在网上找到任何示例,而且我看到的大多数来自 Microsoft 的消息来源都表明这是不可能的。
    • 我现在正在测试这个。你有一个方便的链接来描述deploymentOptions 和dependOn 的有效值吗?另外,name 是指我要部署到的云服务的名称吗?
    • @BobbyA,如果您从门户手动创建云服务,而不是单击create,单击automation options,它将为您生成这种ARM。
    • 我可以使用帮助来引用证书 :)
    猜你喜欢
    • 2016-02-16
    • 2013-07-10
    • 1970-01-01
    • 2020-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多