简体   繁体   中英

Connection string of SQL database with Active Directory using user authentication

I am connecting to a database on my Azure server where database is on different server and connection I made by choosing option Active Directory with user Credentials option. It is working in SQL server but I need a connection string to connect with DB. Any suggestions how to do it?

If integrated, then use the below connection string:

Data Source=xxxxxxx.database.windows.net; Initial Catalog=xxxxxxx; Authentication=Active Directory Integrated;

If you're connecting using username and passsword:

Data Source=tcp:xxxxxxx.database.windows.net;Initial Catalog=xxxxxxx; Authentication=Active Directory Password; User ID=xxxxxxx; Password=xxxxxxx;

Reference: https://github.com/Huachao/azure-content/blob/master/articles/sql-database/sql-database-aad-authentication.md#7-connect-to-your-database-by-using-azure-active-directory-identities

Also you can find the connection string via Azure portal:

在此处输入图片说明

Hope this helps.

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