将Azure Active Directory用户添加到Azure SQL数据库 [英] Add Azure Active Directory User to Azure SQL Database

查看:129
本文介绍了将Azure Active Directory用户添加到Azure SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Azure SQL Server,可以将SSMS插入其中.我还有一个Azure Active Directory,其用户名为mytestuser@mytest.onmicrosoft.com.我想添加此用户以对其Azure SQL Server中的数据库具有权限.第一步是尝试将其添加到Azure SQL Server的主要安全性中.

I have an Azure SQL Server and can SSMS into it. I also have an Azure Active Directory with a user named mytestuser@mytest.onmicrosoft.com. I want to add this user to have permissions to a database in my Azure SQL Server. The first step is trying to add it to the primary security of the Azure SQL Server.

我已经在Master数据库上尝试了以下方法:

I have tried the following on the Master Database:

CREATE USER [mytestuser@mytest.onmicrosoft.com] FROM EXTERNAL PROVIDER;
CREATE USER mytestuser;

但这会产生以下错误:

无法创建主体'mytestuser@mytest.onmicrosoft.com'. 只有使用Active Directory帐户建立的连接才能创建 其他Active Directory用户.

Principal 'mytestuser@mytest.onmicrosoft.com' could not be created. Only connections established with Active Directory accounts can create other Active Directory users.

"mytestuser"不是有效的登录名,或者您没有权限.

'mytestuser' is not a valid login or you do not have permission.

如何将Azure Active Account添加到Azure SQL?一旦通过Master添加了它,使其显示在安全性"中,我应该可以通过以下方式将其添加到任意数量的已创建数据库中:

How do I add an Azure Active Account to Azure SQL? Once I have added it via the Master so it shows up in Security, I should be able to add it to any number of created databases via:

CREATE USER mytestuser FROM LOGIN mytestuser; 

推荐答案

我能够连接并添加Active Directory用户,但是需要以下条件:

I was able to connect and add an Active Directory User but it required the following:

1)SQL Server Management Studio 2016或更高版本具有Active Directory登录选项(我使用了Active Directory密码身份验证)

1) SQL Server Management Studio 2016 or greater to have the Active Directory Login options (I used Active Directory Password Authentication)

2)确保Azure SQL Server设置了Azure Active Directory Admin.您将在第1步中连接此帐户

2) Ensuring that the Azure SQL Server had the Azure Active Directory Admin set. You will this account to connect in Step 1

这篇关于将Azure Active Directory用户添加到Azure SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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