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

Azure API returned the following error: Status: "Failed" Code: "ContainerAppOperationError" Message: "Failed to provision revision for container app 'test-app'. Error details: Operation expired." Activity Id: "" #53

Open
1 task done
sahilvarmacsi opened this issue Mar 12, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@sahilvarmacsi
Copy link

sahilvarmacsi commented Mar 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Greenfield/Brownfield provisioning

greenfield

Terraform Version

1.2.9

Module Version

~ 3.0

AzureRM Provider Version

~ 3.0

Affected Resource(s)/Data Source(s)

azurerm_container_app

Terraform Configuration Files

resource "azurerm_container_app" "container_app" {
  name                         = "test-app"
  container_app_environment_id = azurerm_container_app_environment.container_app_env.id
  resource_group_name          = var.container_app_rg
  revision_mode                = var.container_app_rev_mode
  workload_profile_name        = "Consumption"
  tags = var.tags_containerapp

  template {
    min_replicas = 1
    max_replicas = 10
    container {
      name   = "simplehelloworld"
      image  = "mcr.microsoft.com/k8se/quickstart:latest"
      cpu    = 1
      memory = "2Gi"
    }
  }

  identity {
    type         = "User Assigned"
    identity_ids = var.identity_ids
  }

  registry {
    server               = var.acr_server
    identity             = var.uami_resource_id
  }

  secret {
    name = var.secret_name
    value = var.secret_value
  }

  ingress {
    allow_insecure_connections = var.allow_insecure_connections
    external_enabled           = var.external_enabled
    target_port                = var.target_port
    transport                  = var.transport
    traffic_weight {
      latest_revision = var.latest_revision
      percentage      = var.percentage
    }
  }
  lifecycle {
    ignore_changes = [template, secret, ingress, registry]
  }
}

tfvars variables values

N/A

Debug Output/Panic Output

N/A

Expected Behaviour

Container App should get created.

Actual Behaviour

This error is happening only with a specific workspace. We got this created in a different workspace succesfully. Our container app is private and the container app environment is private has a workload profile. Same private container app and container app environment have been created using a different workspace. But it is weirdly throwing this issue only for a workspace that I am working to deploy for the Production Environment.

Error with details :

creating Container App (Subscription: "xxxxxxxxx"
Resource Group Name: "rg-test"
Container App Name: "test-app"): polling after CreateOrUpdate: polling failed: the Azure API returned the following error:

Status: "Failed"
Code: "ContainerAppOperationError"
Message: "Failed to provision revision for container app test-app'. Error details: Operation expired."
Activity Id: ""


API Response:

----[start]----
{"id":"/subscriptions/xxxxxxxx/providers/Microsoft.App/locations/centralus/containerappOperationStatuses/xxxxxxxxxx","name":"xxxxxxxxxxx","status":"Failed","error":{"code":"ContainerAppOperationError","message":"Failed to provision revision for container app 'test-app'. Error details: Operation expired."},"startTime":"2024-03-12T15:51:13.3407187"}
-----[end]-----

Steps to Reproduce

terraform apply on terraform cloud

Important Factoids

No response

References

No response

@lonegunmanb
Copy link
Member

Thanks @sahilvarmacsi for opening this issue, it seems like you've declare an azurerm_container_app resource directly instead of using this module right? If the error was caused when you were using this module, could you please give us a minimum example code that could reproduce your issue? If the error was caused when you were using container app resource directly, then the AzureRM Provider repo is a better place for you to open the issue, you can open issue and ping me there. Thanks for your understanding.

@sahilvarmacsi
Copy link
Author

I don't understand why it is failing. I just tried creating the Container App Manually through azure portal and it was stuck in provisioning state, this was a similar behavior when we were trying to create through terraform. So the reason why it was getting stuck in "Provisioning" state is because the secret was not getting created. I added the secret manually and the container app revision went to successful state.

image

Anyways I just imported the state of container app to my terraform. I don't understand the cause of failure only for this particular subscription. It get created fine in other subscription through terraform.

@lonegunmanb
Copy link
Member

Sorry for this late reply, if the error only occurred with secret then I would like to check whether the permission is correct. Anyway, if we could have an example config to reproduce this issue it would be a great help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants