azure 插槽交换和 web.config 设置

标签 azure web-config azure-web-app-service azure-deployment-slots

我在 azure 中有几个插槽,一个用于质量保证,一个用于登台,一个用于“实时”。我同时发布到 QA 和 staging,一旦 QA 获得批准,我就想将 staging 与 live 交换(以便 staging 现在变为 live)。

我的问题是,由于 staging 本身就是一个单独的 Web 应用程序,因此它在 web.config 文件中有自己的设置(数据库连接、客户端 ID、客户端 key 等)。也交换配置?因此,如果设置不同,我的“实时”应用程序将不再具有正确的设置(它采用临时 web.config 设置)

这是正确的吗?当我交换部署槽时如何保留我的实时设置? 另外,这对网络工作有何影响?我在网络应用程序下有几个,具有相应的 app.config 设置

最佳答案

答案是您可以控制设置在交换期间是否更改或保持不变。查看以下文章:https://learn.microsoft.com/en-us/azure/app-service/web-sites-staged-publishing 。摘自该文章:

Configuration for deployment slots

When you clone configuration from another deployment slot, the cloned configuration is editable. Furthermore, some configuration elements will follow the content across a swap (not slot specific) while other configuration elements will stay in the same slot after a swap (slot specific). The following lists show the configuration that will change when you swap slots.

Settings that are swapped:

  • General settings - such as framework version, 32/64-bit, Web sockets
  • App settings (can be configured to stick to a slot)
  • Connection strings (can be configured to stick to a slot)
  • Handler mappings
  • Monitoring and diagnostic settings
  • WebJobs content

Settings that are not swapped:

  • Publishing endpoints
  • Custom Domain Names
  • SSL certificates and bindings
  • Scale settings
  • WebJobs schedulers

To configure an app setting or connection string to stick to a slot (not swapped), access the Application Settings blade for a specific slot, then select the Slot Setting box for the configuration elements that should stick the slot. Note that marking a configuration element as slot specific has the effect of establishing that element as not swappable across all the deployment slots associated with the app.

关于 azure 插槽交换和 web.config 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47906246/

相关文章:

sql - Azure 流分析查询返回 0 行

iis - 加载配置文件 : Failed to start monitoring changes to '\\share' 时出错

web-config - StackExchange MiniProfiler UrlRoutingModules 没有实现 IHttpHandlerFactory

azure - 如何在azurerm_app_service资源 block 中指定4个连接字符串

azure - 如何访问我的 Azure 网站的代码?

azure - 修改Azure App Linux服务的nginx.conf

c# - 升级到SDK 2.3.301后,Service Fabric Actor或服务将变得无法访问

azure - 为基于 powershell 的 Azure 部署启用 IntelliTrace

azure - 转售 Azure 网站服务

c# - 自定义错误在本地工作,而不是在 IIS 上部署后