I have an Asp.net MVC5 application and have published it to Microsoft Azure
. I first migrated my .mdf
files toSql Azure Databases
. The database connection string provided in the Azure Portal
is not working.
[ArgumentException: Keyword not supported: 'server'.]
My connection string is as follows web.config
connectionString="
Server=tcp:dbprojectserver.database.windows.net,1433;
Initial Catalog=db_project;
Persist Security Info=False;
User ID=username@servername;
Password=kenth&&123;
Encrypt=True;
TrustServerCertificate=False;
Connection Timeout=30;
"
I believe so there is something wrong with this connection string. Any help regarding that is highly appreciated.
EDIT
Reading from here SQL Server Connection Strings and following EF Db first or Model first connection string example
<add name="ConnectionStringName"
providerName="System.Data.EntityClient"
connectionString="metadata=res://*/ ContextClass.csdl|res://*/ ContextClass.ssdl|res://*/ ContextClass.msl;provider=System.Data.SqlClient;provider connection string="Data Source=ServerName;Integrated Security=False;User Id=userid;Password=password;MultipleActiveResultSets=True"" />
This is what I am using according to above example
<add name="ProjectEntities" connectionString="metadata=res://*/ ProjectWeb.Models.User.csdl|res://*/ ProjectWeb.Models.User.ssdl|res://*/ ProjectWeb.Models.User.msl;provider=System.Data.SqlClient;provider connection string="Data Source=tcp:dbprojectserver.database.windows.net,1433;Integrated Security=False;User Id=username@servername;Password=kenth$$123;MultipleActiveResultSets=True"
" providerName="System.Data.EntityClient"/>
It says
Keyword not supported 'data source'