Reputation: 111
couple of questions regarding the connection strings section for websites in the windows azure portal:
do the settings in the portal take precedence over what's in web.config? If so, should I not include connection strings in the web.config file? Are the settings in the portal sometimes referred to as app.config?
can i set connection strings for ado.net entities in the windows azure portal? This does not seem to work for this specific type of connection string.
in the portal i included the following connection string and gave it the same name as what is in my web.config:
metadata=res:///Models.TABLENAME.csdl|res:///Models.TABLENAME.ssdl|res://*/Models.TABLENAME.msl;provider=System.Data.SqlClient;provider connection string="Server=tcp:SERVERNAME.database.windows.net;Database=DATABASENAME;User ID=USER;Password=PASSWORD;Trusted_Connection=False;Encrypt=True;
The connection string in my web.config file works in my dev environment, but i think i have something typed wrong on the azure portal.
Upvotes: 2
Views: 4379
Reputation: 3579
"do the settings in the portal take precedence over what's in web.config?" Yes.
"If so, should I not include connection strings in the web.config file? " Use the connectionstring found in Azure portal and insert it in your web.config. This, of course, does not apply to if you are using a local database. Then you should use the local connectionsstring.
"Are the settings in the portal sometimes referred to as app.config?" No. Not if you are stil on the subject of connectionstrings.
"can i set connection strings for ado.net entities in the windows azure portal? This does not seem to work for this specific type of connection string" Check my blog post on basic set up for this here under step 2(2. Now, go to the Management portal and Create a new db.) http://geekswithblogs.net/MagnusKarlsson/archive/2012/10/31/add-sql-azure-database-to-azure-web-role-and-persist.aspx
Upvotes: 3