Azure Devops Terraform Deployment - Runbook draft is not in edit state

Hello there,

after my last issue with Azure and Terraform, i’ve continue to working on my Terraform file deploed by ma azure devops Pipeline.

Now i’ve came to another Error, i hope you can help me to solve this.

I#Ve some Scripts, i want to Rollout and Update by the Pipeline Run.
Following the parts of the .tf File, they might me important. If i left important informations out, please let me know.

data "local_file" "ScriptIAC" {
  filename = "${path.module}/Script.ps1"
}

locals{
  AZAutoMateAccountName="IACServerlessAutoMAccountDEV"
  RBSkriptName="AzureIACSkriptRunBookDEV"
  RBDashBoard="DashBoardRB"
  AZRessGroupName="IACServerlessAutoMDEV"
  Location="westus"
}
resource "azurerm_automation_runbook" "ScriptRunbook" {
  name                    = local.RBDashBoard
  location                = local.Location
  resource_group_name     = local.AZRessGroupName
  automation_account_name = local.AZAutoMateAccountName
  log_verbose             = "true"
  log_progress            = "true"
  description             = "This Run Book runs the Script"
  runbook_type            = "PowerShell72"
  content                 = data.local_file.ScriptIAC.content
  depends_on = [ azurerm_resource_group.IACServerlessAutoMDEV ]
  tags = {
    environment = "Serverless"
  }
}

Following the Error, I’ve getting:

azurerm_automation_job_schedule.ScriptJob: Creating...
##[debug]Agent environment resources - Disk: / Available 18683.28 MB out of 74244.74 MB, Memory: Used 812.00 MB out of 6921.00 MB, CPU: Usage 10.92%
azurerm_automation_job_schedule.DashboardJob: Creation complete after 3s [id=/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/IACServerlessAutoMDEV/providers/Microsoft.Automation/automationAccounts/IACServerlessAutoMAccountDEV/schedules/Script|/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX-a3cc4f01d588/resourceGroups/HVIACServerlessAutoMDEV/providers/Microsoft.Automation/automationAccounts/IACServerlessAutoMAccountDEV/runbooks/DashBoardRB]
╷
│ Error: publishing the updated Runbook (Subscription: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
│ Resource Group Name: "IACServerlessAutoMDEV"
│ Automation Account Name: "IACServerlessAutoMAccountDEV"
│ Runbook Name: "ScriptRB"): polling after Publish: unexpected status 400 (400 Bad Request) with response: {"code":"BadRequest","message":"Runbook draft is not in edit state."}
│ 
│   with azurerm_automation_runbook.VCERunbook,
│   on main.tf line 97, in resource "azurerm_automation_runbook" "Runbook":
│   97: resource "azurerm_automation_runbook" "ScriptRunbook" {
│ 
╵

Thanks for your help.