I am trying to get the connection string from Azure Application settings using environment variables, But it seems that the format of the connection string that I am putting in Azure App setting is not proper.Here is my original connection string that works fine in localhost.
<add connectionString="Server=tcp:****.database.windows.net,1433;Initial Catalog=***;
Persist Security Info=False;User ID=******;Password=*********;MultipleActiveResultSets=False;
Encrypt=True;TrustServerCertificate=False;Connection Timeout=1200000;
Max Pool Size=500;Pooling=true;" name="Con_String"></add>
I am putting "Server=tcp:****.database.windows.net,1433;Initial Catalog=****;Persist Security Info=False;User ID=****;Password=****;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=1200000;Max Pool Size=500;Pooling=true;"
as the con_string value in Azure Application Setting
Now for fetching the Connection string at runtime I am using Environment variable as string ConnectionString = Environment.GetEnvironmentVariable("SQLAZURECONNSTR_Con_String");
But during running the web app I am getting the exception message Keyword not supported: '"Server'.
I tried the approaches in Retrieve and use Windows Azure's connection strings? and other similar posts ,but didn't work. Am I missing something silly here?