Terraform-provider-azurerm: azurerm_automation_runbook doesn't create python runbook.

Created on 18 Jul 2018  路  9Comments  路  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.7

  • provider.azurerm v1.8.0
  • provider.template v1.0.0

Affected Resource(s)

  • azurerm_automation_runbook

Terraform Configuration Files

resource "azurerm_automation_runbook" "runbook" {
  name                = "test-kitchen-cleanup"
  location            = "${azurerm_resource_group.autorg.location}"
  resource_group_name = "${azurerm_resource_group.autorg.name}"
  account_name        = "${azurerm_automation_account.account.name}"
  log_verbose         = "true"
  log_progress        = "true"
  description         = "Hello World script, just to get things created"
  runbook_type        = "Script"

  publish_content_link {
    uri = "${azurerm_storage_blob.script.url}"
  }
}

Expected Behavior

  • Creates a runbook in the specified automation account
  • The runbook created is of type Python 2 Runbook

Actual Behavior

  • Creates the runbook and reports success.
  • The resulting runbook is actually a PowerShell Workflow Runbook.
  • TF state file show the following:
azurerm_automation_runbook.runbook:
  id = /subscriptions/8efe2bb2-0b97-4186-8c1e-c75e6c772a98/resourceGroups/test-kitchen-cleanup-preprod/providers/Microsoft.Automation/automationAccounts/test-kitchen-cleanup-preprod/runbooks/test-kitchen-cleanup
  account_name = test-kitchen-cleanup-preprod
  description = Hello World script, just to get things created
  location = eastus2
  log_progress = true
  log_verbose = true
  name = test-kitchen-cleanup
  publish_content_link.# = 1
  publish_content_link.0.hash.# = 0
  publish_content_link.0.uri = https://crtoutilityusepreprod.blob.core.windows.net/scripts/test-kitchen-cleanup.ps1
  publish_content_link.0.version =
  resource_group_name = test-kitchen-cleanup-preprod
  runbook_type = Script
  tags.% = 0

Important Factoids

The documentation is vague on if TF supports creating python based runbooks. It says the following:
runbook_type - (Required) The type of the runbook - can be either Graph, GraphPowerShell, GraphPowerShellWorkflow, PowerShellWorkflow, PowerShell or Script.

I would assume that Script is a python runbook since the valid types of runbooks are:

  • Powershell
  • Python 2 (preview)
  • Graphical
  • PowerShell Workflow
  • Graphical PowerShell Workflow
enhancement servicautomation

Most helpful comment

Anything?

All 9 comments

I just noticed that it shows the content link being a ps1 file. I can confirm that it doesn't matter if its a py file, it still doesn't set the runbook type correctly.

For reference, sounds like the problem might start with Azure/azure-rest-api-specs#3457

If this is going to be an enhancement that relies on upstream work, I suggest that you clarify in the documentation what the script type is and that python runbooks are not yet supported.

Bump on this issue. I'd love to use this feature. If it isn't coming (last update was 7/20/2018), can you update the documentation please?

Any news ?

Anything?

Does anyone have an idea of where it breaks down? We want to use Python for our Runbooks, but it doesn't seem like it's possible atm.

I can't believe I hit a terraform limit that is 2 years old. lol
Is there any news about this?

Was this page helpful?
0 / 5 - 0 ratings