使用Azure Active Directory从Azure网站连接到Azure SQL? [英] Connect to Azure SQL using Azure Active Directory from an Azure Website?

查看:374
本文介绍了使用Azure Active Directory从Azure网站连接到Azure SQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

A有一个Azure网站运行,通过实体框架6连接到Azure SQL。一切运行,我使用标准用户名/密码(sql登录)来连接。

A have an Azure Website running which connects to an Azure SQL through Entity Framework 6. Everything runs and I'm using standard username/password (sql login) to connect.

现在,我想切换到使用AAD进行身份验证。我已经有一个AD应用程序设置为网站。

Now, I would like to switch over to using AAD for authenticating to sql. I already have an AD Application set up for the website.

我的问题是:


  1. 如何连接我的cert或clientid / clientSecret?

  2. 如何确保 SqlAzureExecutionStrategy 仍然在功能

  1. How do I connect with my cert or clientid/clientSecret?
  2. How do I ensure that the SqlAzureExecutionStrategy is still in function

任何指导非常感谢
谢谢!

Any guidance is much appreciated Thanks!

推荐答案

通过使用Azure Active Directory身份验证,有三种方式连接到SQL数据库。

There are three ways connecting to SQL database by using Azure Active Directory authentication.


  1. 使用集成(Windows)身份验证连接

  2. 使用Azure AD主体名称和密码连接

  3. 使用Azure AD令牌连接

有关Azure SQL数据库的Azure AD身份验证的更多详细信息,可以参考

More detail about the Azure AD authentication for the Azure SQL database, you can refer here.

如果您尝试使用访问令牌连接,则由此 >是有帮助的此外,熟悉Azure AD的身份验证和客户端凭据流使用此链接

And if you were trying the config the connecting with access token the code sample provided by this blog is helpful. Also it is helpful to familiar with to authenticate with Azure AD with the client credential flow using the certificate from this link.

根据我的理解,您使用的连接字符串不会影响实体框架提供的连接恢复功能。

And based on my understanding, the connection string you used doesn't effect the Connection Resiliency feature which provided by the Entity Framework.

这篇关于使用Azure Active Directory从Azure网站连接到Azure SQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆