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