Gregg_1987
Gregg_1987

Reputation: 453

Azure App Service sticky slot settings in Terraform

I'm using Terraform to create a slot on an azure app service but I need some of the app settings to be sticky. This is normally done using the "slotConfigNames" in ARM but doesn't seem to be possible in Terraform.

Is this possible?

https://www.terraform.io/docs/providers/azurerm/r/app_service_slot.html

Thanks

Upvotes: 3

Views: 6217

Answers (3)

DevopsEnthusiast
DevopsEnthusiast

Reputation: 11

UPDATE: after some investigation into the AZ powershell module for sticky settings (Set-AzWebAppSlotConfigName), I realized that you don't need to set this on the terraform slot resource - you just set it on the primary resource (production slot).

The sticky_settings block has been added to the parent resources (app service, function app), but not the slot.

Upvotes: 1

Emil Tang Kristensen
Emil Tang Kristensen

Reputation: 41

This has ben implemented now in v3.4.0 of the AzureRM provider.

Upvotes: 4

Nancy Xiong
Nancy Xiong

Reputation: 28224

It is not possible to use azurerm_app_service_slot directly since the Sticky Slot settings are not supported in terraform. But you can make use of the Azure Template Deployment resource in Terraform.

The solution will create an App Service with one or more Slots attached to it and will also make use of Slot settings in order to have the configuration tied to the environment as opposed to transform a config file with a CI/CD server such as Octopus Deploy or perhaps use multiple appSettings.json for each environment as you would on a .net application.

You can get more details from this blog.

Upvotes: 3

Related Questions