简体   繁体   中英

How to connect asp.net Identity to SQL Azure

Under normal circumstances, when the registered members are connected to defaultconnection. But my database is within Azure. How to connect to SQL Azure? I tried to change the connection string, like this

 <add name="DefaultConnection" connectionString="data source=[azuresercername].database.windows.net;initial catalog=[azuredatabasename];user id=[userid];password=[userpassword];" providerName="System.Data.EntityClient"/> 

It failed. So I would like to ask how to solve. Please. Thank you.

You need to ensure that the SQL Azure firewall is open for the IP address of your development machine and/or Azure resources. See the following article:

https://azure.microsoft.com/en-us/documentation/articles/sql-database-configure-firewall-settings/

Also, you need to use SSL when connecting to the server. This article walks you through getting the full connection string:

https://azure.microsoft.com/en-us/documentation/articles/sql-database-develop-dotnet-simple/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM