Azure / terraform-provider-azapi

Terraform provider for Azure Resource Manager Rest API
https://registry.terraform.io/providers/Azure/azapi/latest
Mozilla Public License 2.0
173 stars 47 forks source link

Move an azure container job from a cae to another doesn't destroy and recreate it #490

Open btpemercier opened 4 months ago

btpemercier commented 4 months ago

Context

Resource details

Reproduce

Current behavior

{
  "error": {
     "code": "ContainerAppsJobEnvironmentMismatch",
     "message": "Container Apps Job 'container-app-name' already exists in a different environment. To create it in the environment '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.App/managedEnvironments/container-app-name' delete it from the enviroment 'cae-a' first."
   }
}

Expected behavior

ms-henglu commented 4 months ago

Hello @btpemercier ,

Thank you for taking time to report this issue.

Currently the azapi provider doesn't support replacing resource when it is not able to update. For this case, please run terraform taint azapi_resource.{container app label}, then run terraform apply command and terraform destroy the container job before creating a new one.