Azure 云服务的 Webconfig 覆盖

Webconfig overrides for Azure Cloud Services

我的 Azure 云服务的 Web 角色中有一个数据库连接字符串 web.config。在开发时指向本地主机,但在部署时我想指向我的生产数据库。对于 azure 网站,您可以使用 azure 门户覆盖 web.config 设置和连接字符串,但如何使用云服务执行此操作?

此外,在新的 Azure 门户中,它说 Cloud Services (classic) ,这是否意味着已弃用?我应该使用更新的 Azure 功能来托管我的 soap/rest 网络服务吗?

使用 Web 角色,您可以在 .cscfg 文件而不是 Web.config 文件中配置连接字符串。然后您可以根据您的环境更改该配置(例如:ServiceConfiguration.Cloud.cscfg、ServiceConfiguration.Local.cscfg)。从门户中的所有设置、配置,您可以按照此处所述更改配置:https://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-configure-portal/.

就弃用而言,Azure 的新 PaaS 模型是从 IaaS 到 PaaS 的连续统一体。例如,Worker Roles v2 将是 Mark Russinovich 在他的 talk at //build2015. cf slide 19 in the slide view of this talk 中描述的 VM 规模集。 Service Fabric 也将发挥重要作用。 对于更简单的用法,Web Apps 是最佳选择。