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

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

问题描述

我有一个 Azure SQL Server,可以通过 SSMS 访问它.我还有一个名为 mytestuser@mytest.onmicrosoft.com 的用户的 Azure Active Directory.我想添加此用户以对我的 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.

我在主数据库上尝试了以下操作:

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 活动帐户添加到 Azure SQL?一旦我通过 Master 添加它并显示在 Security 中,我应该能够通过以下方式将它添加到任意数量的已创建数据库中:

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天全站免登陆