I have created azure automation account with the help of terraform and I have existing runbook PowerShell scripts which I need to import to azure automation account. I am trying for-each loop in the terraform to upload multiple scripts at time but it is not working:
Code:
resource "azurerm_automation_runbook" "example" {
for_each = fileset(",", "./Azure_Runbooks/*.ps1")
name = split("/", each.value)[1]
location = var.location
resource_group_name = var.resource_group
automation_account_name = azurerm_automation_account.example.name
log_verbose = var.log_verbose
log_progress = var.log_progress
runbook_type = var.runbooktype
content = filemd5("${each.value}")
}
while executing the terraform it is not showing any errors but it is not importing all the scripts which is there in my local. Please suggest me how I can import multiple PowerShell script files to upload to Azure automation account.