通过Azure资源管理器应用多个DSC [英] Apply multiple DSCs through Azure Resource Manager

查看:123
本文介绍了通过Azure资源管理器应用多个DSC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过Azure资源管理器将多个DSC配置应用于一个虚拟机?

Is it possible to apply multiple DSC configurations to one vm through Azure Resource Manager?

当前我正在使用类似这样的东西:

Currently I am using something like this:

    {
      "apiVersion": "2015-06-15",
      "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/', variables('vm_name'))]"
      ],
      "location": "[resourceGroup().location]",
      "name": "DSCSetup",
      "properties": {
        "publisher": "Microsoft.Powershell",
        "type": "DSC",
        "typeHandlerVersion": "2.20",
        "autoUpgradeMinorVersion": true,
        "settings": {
          "modulesUrl": "[concat('https://', variables('sa_name'), '.blob.core.windows.net/.../dsc.ps1.zip')]",
          "configurationFunction": "dsc.ps1\\Main",
          "properties": {
            "MachineName": "[variables('vm_name')]",
            "UserName": "[parameters('vm_user')]"
          }
        },
        "protectedSettings": {}
      },
      "type": "extensions"
    }

如果没有,您可以自动合并多个DSC吗?

If not, can you merge multiple DSCs automatically?

场景是:

  • 具有多个DSC
  • 一个用于IIS + ASP.Net的DSC
  • 一个DSC创建Site1
  • 另一个创建Site2的DSC
  • 在开发人员中,将Site1和Site2部署到一台计算机上
  • 在生产环境中部署以分离机器,甚至在可用性集中...
  • (准备在将来使用单独的容器)

推荐答案

DSC目前仅允许单个配置,因此,如果您将2个DSC扩展部署到同一虚拟机(我不确定它是否会实际运行)第二个配置将覆盖第一个.

DSC only allows for a single configuration at the moment, so if you deployed 2 DSC extensions to the same VM (I'm not sure it will actually work) the second config would overwrite the first.

您可能会堆叠DSC和CustomScript,但是由于DSC可以运行脚本,所以我不确定为什么您需要这么做...

You could probably stack DSC and CustomScript but since DSC can run script, I'm not sure why you'd ever need to do that...

您的情况如何?

这篇关于通过Azure资源管理器应用多个DSC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆