I am trying to create a slot for azure linux web app via terraform, the slot is been created successfully but the docker image / application deployed on the default production app is automatically coming on the slot without manual deployment ?

Ridma Kakani 0 Reputation points
2025-03-26T05:46:33.6+00:00

I am trying to create a slot for azure linux web app via terraform, the slot is been created successfully but the docker image / application deployed on the default production app is automatically coming on the slot without manual deployment ? this should not happen, i have removed the docker block from the slot kept it empty in the terraform configuration too still the image is coming in the slot.

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

1 answer

Sort by: Most helpful
  1. Deepanshu katara 16,790 Reputation points MVP Moderator
    2025-03-26T07:09:14.47+00:00

    Hello Ridma , Welcome to MS Q&A

    When using Azure Linux Web App slots with Terraform, it's possible that the docker image from the production app is automatically deployed to the slot due to the way deployment slots are configured. Deployment slots in Azure App Service are designed to mirror the configuration of the production slot unless explicitly overridden.

    Here are some steps and considerations to address this issue:

    Configuration Inheritance: Deployment slots inherit the configuration settings from the production slot by default. Ensure that any specific settings for the slot are explicitly defined in your Terraform configuration to prevent unwanted inheritance.

    Deployment Slots Best Practices: It's recommended to use deployment slots for staging and testing before swapping with production. This approach helps in validating changes without affecting the live environment. More details can be found in the Deployment best practices.

    Terraform Configuration: Double-check your Terraform configuration to ensure that the docker block is completely removed from the slot's configuration. Any residual configuration might cause the slot to pull the image from the production app.

    Manual Configuration Check: After deploying with Terraform, manually check the slot's configuration in the Azure Portal to ensure no unwanted settings are present.

    By following these steps, you should be able to prevent the automatic deployment of the docker image to the slot. If the issue persists, consider reviewing the Terraform documentation for any specific nuances related to Azure App Service slots.

    Please let me know if any more ques

    Kindly accept answer if it helps

    Thanks
    Deepanshu


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.