CloudConfigurationManager vs WebConfigurationManager?

后端 未结 4 1418
-上瘾入骨i
-上瘾入骨i 2021-01-04 03:25

In an Azure Websites I was always using the following code to fetch some values from the config\'s app settings:

string property = WebConfigurationManager.         


        
4条回答
  •  遥遥无期
    2021-01-04 03:32

    I think you're better off using WebConfigurationManager. With it, you have access to ConnectionStrings as well as AppSettings. Both sets of settings you can update via the Azure Portal. They can then further be used in other Azure facilities/services, such as when configuring website backup. Check this out for more information: https://azure.microsoft.com/en-us/blog/windows-azure-web-sites-how-application-strings-and-connection-strings-work/

提交回复
热议问题