Pergunta

I am trying to have my production configuration settings within my web.Release.config file used when I publish my application to Microsoft Azure.

My scenario, is that I am using VS2013 and trying to publish to a production Cloud Service, running Azure.

I have read and followed many (now outdated) blog posts and SO questions/answers where the Whatever.Azure.ccproj is manually edited for VS2012/VS2010 and hand-stitched back together again, but none have worked for me.

Many of the steps that are suggested by these existing elements suggest creating versions of files that already exist in my project, and talk about creating Base files to depend upon.

Do I still need to do this in VS2013? The IDE suggests to me that there's an easier way, but the direct information from Microsoft is hard to come by.

Many thanks, in advance.

Foi útil?

Solução

If you are able to move the settings from the web.config to the ServiceConfiguration.*.cscfg (e.g. Cloud, Local) then you are able to add additional versions of these files, such as ServiceConfiguration.Staging.cscfg.

During deployment (both via the IDE and via Powershell) you can specify which configuration to deploy.

In my case, I use ServiceConfiguration.Cloud.cscfg for the Production slot, and ServiceConfiguration.Staging.cscfg for the Staging slot.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top