Arky
Arky

Reputation: 380

Does Terraform support Azure deployment slots?

It is possible to use Terraform to create an azure app service with a deployment slot for staging and production. Am trying to deploy a open source project master branch to staging slot and Release branch to production slot. But Terraform App Service (https://www.terraform.io/docs/providers/azurerm/r/app_service.html) doesn't yet support deployment slots?

https://learn.microsoft.com/en-us/azure/developer/terraform/provision-infrastructure-using-azure-deployment-slots

Upvotes: 0

Views: 2267

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28204

As the comment mentioned, the Terraform indeed supports deployment slots via azurerm_app_service_slot. Please note that

Note: When using Slots - the app_settings, connection_string and site_config blocks on the azurerm_app_service resource will be overwritten when promoting a Slot using the azurerm_app_service_active_slot resource.

For more information, you could read the Tutorial: Provision infrastructure with Azure deployment slots using Terraform. The article illustrates an example use of deployment slots by walking you through the deployment of two apps via GitHub and Azure. One app is hosted in a production slot. The second app is hosted in a staging slot.

Upvotes: 2

Related Questions