简体   繁体   English

从Azure中的webjobs读取webapp的web.config

[英]Read web.config of webapp from webjobs in azure

I have webapp in azure and with that webapp i have 3 other webjobs inside that. 我有天蓝色的webapp,有了那个webapp,我里面还有3个其他webjob。 now Webapp is having some settings in appConfig section in web.config. 现在,Webapp在web.config的appConfig部分中进行了一些设置。 I don't want to copy and past that settings in my other 3 webjob. 我不想在其他3个webjob中复制并删除该设置。 so is it possible to read Web.config of webApp from Webjob ? 所以可以从Webjob读取webApp的Web.config吗?

You can share the settings between your Web App and your WebJobs by storing them in the Web App's app settings (on the Azure portal). 通过将设置存储在Web App的应用程序设置(在Azure门户中)中,可以在Web App和WebJob之间共享设置。

To access these settings you simply use ConfigurationManager.AppSettings or if it's not .NET you can access them through the environment (as environment settings). 要访问这些设置,只需使用ConfigurationManager.AppSettings即可;如果不是.NET,则可以通过环境(作为环境设置)来访问它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM