We have a Linux App Service we’re deploying with terraform and we want it to pull a new docker container every time one is pushed to our registry.
We’re building this using this terraform resource:
resource "azurerm_linux_web_app" "name"
To enable continuous deployment we need to enable it in the Deployment Centre or with this command:
az webapp deployment container config --enable-cd true --name name --resource-group rg
We’re using terraform, so we don’t want to need to supplement with CLI commands.
Is there any way to do this in terraform? I can’t see anything relevant in the docs.
2
Answers
Hi we were encountering the same problem and fixed by adding the following app setting in azurerm_linux_web_app:
Apart from the options suggested by Helder Sepulveda and GBI
To enable continous deployment with your Container registry, Use azurerm_app_service_source_control
and
container_configuration
block:-Terraform code:-