I have uploaded a azure webjob in a azure web site. I was trying to read a connection string from the azure website where the azure webjob is using below code but it is not returning anything. The connection strings in the azure websites are located in the configure tab of the azure website. Am I doing something wrong here.
CloudConfigurationManager.GetSetting("ConnString")
Thanks
You can find the connection string under Access Keys of your App Configuration store in the Azure portal.
You can find your storage account's connection strings in the Azure portal. Navigate to SETTINGS > Access keys in your storage account's menu blade to see connection strings for both primary and secondary access keys.
You could click Tools>Connect to Database>Microsoft SQL Server>enter your server name, username and password about Azure Sql. Then click Test Connection button to check whether you could connect successfully.
Configure connection strings. In the Azure portal, search for and select App Services, and then select your app. In the app's left menu, select Configuration > Application settings. For ASP.NET and ASP.NET Core developers, setting connection strings in App Service are like setting them in <connectionStrings> in Web.
The CloudConfigurationManager.GetSetting("ConnString") is looking for a setting with the key "ConnString" in your App Settings within Azure rather than your Connection Strings.
You need to add a value in the App Settings for your Web Site which contains your connection strings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With