可以使用 Terraform 创建带有用于暂存和生产的部署槽的 Azure 应用服务。我正在尝试将开源项目主分支部署到暂存槽,并将发布分支部署到生产槽。但 Terraform App Service ( https://www.terraform.io/docs/providers/azurerm/r/app_service.html ) 尚不支持部署槽?
最佳答案
正如评论中提到的,Terraform 确实支持通过 azurerm_app_service_slot 部署槽。请注意
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.
欲了解更多信息,您可以阅读Tutorial: Provision infrastructure with Azure deployment slots using Terraform 。本文通过引导您完成通过 GitHub 和 Azure 部署两个应用程序,展示了部署槽的使用示例。一个应用程序托管在生产槽中。第二个应用程序托管在暂存槽中。
关于azure - Terraform 是否支持 Azure 部署槽?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62936007/