【问题标题】:Can we deploy Azure automation account and runbook through Visual studio我们可以通过 Visual Studio 部署 Azure 自动化帐户和 Runbook
【发布时间】:2019-05-08 10:33:44
【问题描述】:

我正在开发一个与 Azure 通信的 MVC 应用程序。作为其中的一部分,我必须通过 Visual Studio 部署一些 Azure 组件。我已经使用从 Market place 下载的 Azure 逻辑应用工具通过 Visual Studio 部署了逻辑应用。我现在需要部署计划的运行手册。我们有办法通过 Visual Studio 部署自动化帐户和运行手册吗?

我检查了 Visual Studio 安装程序和 Visual Studio Market Place。我无法确定相关来源。

【问题讨论】:

  • 接缝对于视觉工作室来说是不可能的,看看这个user feedback。它现在仅适用于 vs code 和 powershell ISE。

标签: visual-studio azure


【解决方案1】:

您可以创建一个“Azure 资源组”项目并使用 ARM 模板来创建/部署自动化帐户和使用 Visual Studio 的 Runbook。

请参考下面的 json,它可以在 azuredeploy.json 中更新以创建/部署自动化帐户和运行手册。

    {
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "2.0.0.0",
  "parameters": {
    "accountName": {
      "type": "String"
    },
    "location": {
      "type": "String"
    },
    "samplePowerShellRunbookName": {
      "type": "String"
    },
    "samplePowerShellRunbookDescription": {
      "type": "String"
    },
    "samplePowerShellRunbookContentUri": {
      "type": "String"
    }

  },
  "resources": [
    {
      "type": "Microsoft.Automation/automationAccounts",
      "apiVersion": "2015-01-01-preview",
      "name": "[parameters('accountName')]",
      "location": "[parameters('location')]",
      "dependsOn": [],
      "tags": {},
      "properties": {
        "sku": {
          "name": "Basic"
        }
      },
      "resources": [
        {
          "type": "runbooks",
          "apiVersion": "2015-01-01-preview",
          "name": "[parameters('samplePowerShellRunbookName')]",
          "location": "[parameters('location')]",
          "dependsOn": [
            "[concat('Microsoft.Automation/automationAccounts/', parameters('accountName'))]"
          ],
          "tags": {},
          "properties": {
            "runbookType": "PowerShell",
            "logProgress": "false",
            "logVerbose": "false",
            "description": "[parameters('samplePowerShellRunbookDescription')]",
            "publishContentLink": {
              "uri": "[parameters('samplePowerShellRunbookContentUri')]",
              "version": "1.0.0.0"
            }
          }
        }
      ]
    }
  ]
}

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2020-07-24
    • 1970-01-01
    • 2021-07-17
    • 2020-12-09
    • 2020-04-25
    • 1970-01-01
    • 1970-01-01
    • 2019-05-17
    • 1970-01-01
    相关资源
    最近更新 更多