Webconfig overrides for Azure Cloud Services

醉酒当歌 提交于 2021-01-29 02:12:53

问题


I have a database connectionstring in my Azure cloud service's web role web.config. While developing this is pointing to localhost, but when deployed I want to point my production database. With azure websites you can override web.config settings and connectionstrings using the azure portal but how do I do this with cloud services?

Also, in the new azure portal, it says Cloud Services (classic) , does this mean deprecated? Should I be using a newer azure feature for hosting my soap/rest webservice?


回答1:


With Web Role, you would configure the connection string in the .cscfg files rather than the Web.config file. Then you could change that configuration depending on your environment (ex: ServiceConfiguration.Cloud.cscfg, ServiceConfiguration.Local.cscfg). From the portal, All settings, Configuration will let you change the configuration as described here: https://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-configure-portal/.

In terms of deprecation, the new PaaS model for Azure is a continuum from IaaS to PaaS. For instance, Worker Roles v2 would be the VM Scale sets as described by Mark Russinovich in his talk at //build2015. cf slide 19 in the slide view of this talk. Service Fabric will also play an important role. For simpler usages, Web Apps is the way to go.



来源:https://stackoverflow.com/questions/34449761/webconfig-overrides-for-azure-cloud-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!