I am running Azure App Service using Docker containers. I don't really find a documentation, under which circumstances a container is updated.
In addition I would like to use app service slots and I am not sure, if this changes anything.
I assume, if one can control updates (especially with swapping slots) the tag in siteconfig/linux_fx_version can be set to latest. If it can not be controlled (for example container updates can occur at random times) the best option is to use explicit version tags and update them on each deployment.
I am not sure if my assumption is correct.
A reduced example of my according terraform code:
resource "azurerm_app_service" "example" {
name = "example"
resource_group_name = "example"
location = ..
app_service_plan_id = "example"
app_settings = local.env_vars
site_config {
linux_fx_version = "DOCKER|someimage:latest"
}
}
resource "azurerm_app_service_slot" "staging" {
name = "staging"
location = ..
resource_group_name = "example"
app_service_plan_id = "example"
app_settings = local.env_vars
site_config {
linux_fx_version = "DOCKER|someimage:latest"
}
}
Actually, you don't need to update the docker image for the Web App manually. The continuous deployment of the web app can help you solve it. Take a look at Continuous deployment with Web App for Containers. It will show you how to solve the image update for Web App.
Update:
The continuous deployment is a setting for one web app. If you just create a slot for the production on the existing web app which will pull a new image when the image changes, then the new image will also influence the production. I recommend you create a new web app for the production with the right image distinguished with the test.