Share via

I have a question, i am trying to deploy a docker image in azure web app container via an azure devops application pipeline it got deployed successfully , now i have another pipeline which is terrafrom infra pipeline for making any changes to the web app

Ridma Kakani 0 Reputation points
25 Mar 2025, 12:12

I have a question, i am trying to deploy a docker image in azure web app container via an azure devops application pipeline it got deployed successfully , now i have another pipeline which is terrafrom infra pipeline for making any changes to the web app in azure when i run the pipeline without any change too in the app it run successfully without throwing any error in the pipeline but on the portal the image previously deployed gone and not getting fetched now again i run th eapplication pipeline to deploy the image again on the app it again get successfully deployed, not able to understand what can be the reason for it?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,553 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargavi Naragani 2,400 Reputation points Microsoft External Staff
    25 Mar 2025, 17:46

    Hi @Ridma Kakani,

    It seems like the issue that you are facing could be related to how your Terraform pipeline is configured. When you run the Terraform pipeline, it could be making changes that are inadvertently impacting the Azure Web App configuration, such as resetting the container image to a default or blank state.

    In order to troubleshoot this, try the following:

    1. Check your Terraform scripts to determine whether there are configuration settings that may be resetting the web app configuration or the container image. Verify that the image property is correctly set to the desired Docker image.
    2. Ensure that the Terraform state file is properly handling the current state of your Azure resources. If the state file gets out of sync with the actual resources, this could result in unexpected behavior.
    3. Before applying changes, review the output of the terraform plan to determine what changes Terraform intends to make. This can help identify if it is trying to modify the container image or other properties of the web app.
    4. Make sure that the application pipeline should deploy after the infrastructure pipeline if the infrastructure changes are necessary for the application to function correctly.
    5. Check the logs of both the Terraform pipeline and the Azure Web App for any message that could be making the image be removed.

    By reviewing these details, you could be able to know why the previously deployed image is being removed upon running the Terraform pipeline.

    Kindly refer to the below documentations for better understanding:
    https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-azure-devops?tabs=csharp%2Cwindows&pivots=v1#deploy-a-container
    https://learn.microsoft.com/en-us/azure/container-apps/azure-pipelines#deploy-to-azure-container-apps-from-azure-pipelines
    https://learn.microsoft.com/en-us/azure/migrate/tutorial-app-containerization-azure-pipeline

    If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.

    Let me know if you have any further Queries.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.