首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用Terraform导入Azure Automation

使用Terraform导入Azure Automation
EN

Stack Overflow用户
提问于 2018-08-09 08:52:01
回答 1查看 1.5K关注 0票数 1

有谁能帮我的忙吗?我想用Terraform从runbook图库中导入一个在蔚蓝自动化帐户中的runbook。在下面的示例中,我引用了一个URI,但我想从runbook图库导入:

代码语言:javascript
运行
复制
  resource "azurerm_automation_runbook" "example" {
  name                = "Get-AzureVMTutorial"
  location            = "${azurerm_resource_group.example.location}"
  resource_group_name = "${azurerm_resource_group.example.name}"
  account_name        = "${azurerm_automation_account.example.name}"
  log_verbose         = "true"
  log_progress        = "true"
  description         = "This is an example runbook"
  runbook_type        = "PowerShellWorkflow"
  publish_content_link {
  uri = "${var.runbooklink}"
  }
  }`
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-09 11:19:49

在入口

自动化帐户->运行库->浏览库->选择要导入->查看源代码项目的运行库

复制url

View将重定向到特定运行簿的URI (gallery.technet.microsoft.com中的源代码)

对于上面的图像(例如,hello表示蔚蓝的runbook ),它将URI重定向给我,如

https://gallery.technet.microsoft.com/scriptcenter/The-Hello-World-of-Windows-81b69574/file/111354/1/Write-HelloWorld.ps1

只需将其粘贴到您的代码(uri = "${var.runbooklink}")中即可。

代码语言:javascript
运行
复制
resource "azurerm_automation_runbook" "demorunbook" {
  name                = "Write-HelloWorld"
  location            = "${azurerm_resource_group.development1.location}"
  resource_group_name = "${azurerm_resource_group.development1.name}"
  account_name        = "automationAccount1"
  log_verbose         = "true"
  log_progress        = "true"
  description         = "This is an example runbook"
  runbook_type        = "PowerShellWorkflow"
  publish_content_link {
  uri = "https://gallery.technet.microsoft.com/scriptcenter/The-Hello-World-of-Windows-81b69574/file/111354/1/Write-HelloWorld.ps1"
  }
  }

注释源代码中运行簿的名称应该是运行簿名称的名称

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51762668

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档