Eric Liprandi
Eric Liprandi

Reputation: 5574

How can I add a service config file to my asp.net MVC site?

We are an ISV building a small web application that can be deployed either on-premise or in Azure. Up until now we had been using a web.config file to configure our app. Now that we started pushing some of it in Azure, we would like to be able to tweak some of those appSettings in Azure.

Our understanding is that we need to use a service configuration file instead. Looking around, a lot of places explain how to do that using an azure deploy project. We currently are using a simple ASP.NET MVC project and using a downloaded publish profile from our Azure website (using the free Azure websites thing for now).

Is there a way to publish a service configuration file as part of the MVC project? or do we have to have a web-deploy project?

Thanks,

Upvotes: 0

Views: 199

Answers (1)

Matt Davies
Matt Davies

Reputation: 1269

You can actually just stick with Azure Websites in your situation. Settings configured on the Configuration tab inside Azure Websites take priority over settings in the web.config. You can override settings inside both <appSettings> and <connectionStrings> elements.

(To answer the second part of your question, you can't deploy a .cscfg file without creating a full Web Role).

Upvotes: 1

Related Questions