Open wviriya opened 3 years ago
I just ran across this issue. As a workaround, I created an isolated swap folder with basically the bare minimum for the swap active slot action. Then on the terraform plan (or apply depending on your setup), I used the -replace
option in order to get the swap to always happen. It forces the replacement of the swap resource, which is not an actual mapped entity to azure, only to terraform. So replacing it gets the desired effect.
Example:
terraform plan -replace="azurerm_app_service_active_slot.mySlot"
terraform apply
The swapping between slots seems to be a feature that still needs to be tackled. A full implementation of slot swapping I would imagine would have:
Support for swapping any slot with any other slot.
An attribute showing which slot was the last swapped slot?
A data source showing what the last slot swap was?
If the API supports it, rampup routing using percentage like can be achieved from the slot page in the portal.
Hi, any update on this?
I was able to successfully deploy followed the document https://docs.microsoft.com/en-us/azure/developer/terraform/provision-infrastructure-using-azure-deployment-slots. However, any subsequence slot swap of the same slot will not work since Terraform configuration won't change from application deployment to the slot. This seems to be a one way push from any slot to production. The deployment slot designed to have bi-directional swap. The user should be able to swap the slots back i.e. dev to production or production to dev. Terraform module is https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service_active_slot. It would be great to have this capability.
Community Note
Description
New or Affected Resource(s)
Potential Terraform Configuration
References
https://docs.microsoft.com/en-us/azure/developer/terraform/provision-infrastructure-using-azure-deployment-slots https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service_active_slot
0000