Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_automation_runbook fails with 404 Error - Unless Published version of runbook already exists (v.2) #6588

Closed
arcotek-ltd opened this issue Apr 23, 2020 · 2 comments

Comments

@arcotek-ltd
Copy link

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 (and AzureRM Provider) Version

Terraform v0.12.24

  • provider.azuread v0.8.0
  • provider.azurerm v2.6.0

Affected Resource(s)

  • azurerm_automation_runbook

Terraform Configuration Files

https://gist.github.com/arcotek-ltd/389d3d74572ac1b1f74038c429a0c8c6

Debug Output

Expected Behavior

"Copy" the runbook from the given publish_content_link (storage account (URL)) and "install" the runbook in the automation account.

Actual Behavior

Receive error:

Error: Error retrieving Automation Runbook "myScript" (Account "myAA" / Resource Group "myRg"): automation.RunbookClient#Get: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Automation/automationAccounts/myAA/runbooks/myScript' under resource group 'myRg' was not found."

  on ..\azurerm_automation_runbook\main.tf line 36, in resource "azurerm_automation_runbook" "pool":
  36: resource "azurerm_automation_runbook" "pool" {

Why is it looking in the automation account? Of course it doesn't exist. Isn't that the whole point of this module?

According to the documentation:
publish_content_link - (Required) The published runbook content link.
If this means it needs to be the URI of the runbook in the automation account, why does your example points to a .ps1 file on Github?

content - (Optional) The desired content of the runbook.
If, in order to get this to create a runbook, why is this attribute optional?

I feel that the documentation could do with a little update to explain exactly what these attributes do in their current form, and the module needs improvement to allow a runbook to be created form a URI.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

This has been reported before, in #2868, but it seemed to go off on a tangent about module dependencies and didn't answer the actual issue before the bot closed it.

Thanks.

@ghost
Copy link

ghost commented May 8, 2020

This has been released in version 2.9.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.9.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jun 7, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant