Machinarius
Machinarius

Reputation: 3731

Why is Azure WebSite giving null ConnectionStrings?

I am working on an ASP.Net WebForms solution that i have uploaded to Azure and is working fine except for the fact that whenever i try to acquire connectiong string either via ConfigurationManager.ConnectionStrings or Environment.GetEnvironmentVariable as outlined here

Azure config: enter image description here

Any ideas? I'm pretty desperate now.

Upvotes: 0

Views: 65

Answers (1)

ramiramilu
ramiramilu

Reputation: 17182

ConnectionStrings in Azure Management portal replace already defined connectionstrings in Web.Config at runtime. They do not physically override the web.config connectionstrings.

If no corresponding connectionstring is available in web.config, with the same name as mentioned in the azure management portal, then it will not be replaced at runtime.

So please make sure you have some dummy connectionstrings in web.config with same names as of the connectionstrings mentioned in azure portal. I think that will solve your access problems.

Upvotes: 1

Related Questions