如何将服务配置文件添加到我的asp.net MVC站点?

时间:2022-02-27 00:35:05

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.

我们是一个构建一个小型Web应用程序的ISV,可以在内部部署或在Azure中部署。到目前为止,我们一直在使用web.config文件来配置我们的应用程序。现在我们开始在Azure中推送其中一些,我们希望能够在Azure中调整一些appSettings。

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).

我们的理解是我们需要使用服务配置文件。环顾四周,很多地方都会解释如何使用azure deploy项目来做到这一点。我们目前正在使用一个简单的ASP.NET MVC项目,并使用Azure网站上下载的发布配置文件(暂时使用免费的Azure网站)。

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?

有没有办法将服务配置文件作为MVC项目的一部分发布?还是我们必须有一个Web部署项目?

Thanks,

谢谢,

1 个解决方案

#1


1  

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.

实际上,您可以在您的情况下坚持使用Azure网站。 Azure网站内“配置”选项卡上配置的设置优先于web.config中的设置。您可以覆盖 元素内的设置。

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

(要回答问题的第二部分,不能在不创建完整Web角色的情况下部署.cscfg文件)。

#1


1  

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.

实际上,您可以在您的情况下坚持使用Azure网站。 Azure网站内“配置”选项卡上配置的设置优先于web.config中的设置。您可以覆盖 元素内的设置。

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

(要回答问题的第二部分,不能在不创建完整Web角色的情况下部署.cscfg文件)。