无法使用 azure 连接 sql 数据库 [英] Unable to connect the sql database using azure

查看:37
本文介绍了无法使用 azure 连接 sql 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Azure 中有一个 SQL Server,它是使用简单的 ARM 模板创建的.当我使用我的 sqladmin 凭据连接到 SQL Server 时,我能够正常连接到它.为此,我正在使用 SQL Server Management Studio.

但是,当我使用以下任何突出显示的选项时,我看到一条错误消息.

我看到的错误如下所示,它是一个弹出窗口,但我将文本粘贴在其中以供参考.

TITLE:连接到服务器------------------------------无法连接到 abcd-core-sql.database.windows.net.------------------------------附加信息:

<块引用>

**用户<令牌识别主体>"登录失败.(Microsoft SQL Server,错误:18456)**

如需帮助,请单击:http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

如果有人可以评论我在使用 ARM 模板创建 SQL Server 时是否遗漏了任何内容,我将不胜感激.换句话说,配置中是否还需要包含任何其他内容才能使 azure 广告身份验证适用于天蓝色的 sql db.

<代码> {"type": "Microsoft.Sql/servers","name": "[变量('sql_name')]","apiVersion": "2015-05-01-preview","location": "eastus2",特性": {"administratorLogin": "[参数('admin')]","administratorLoginPassword": "[parameters('passwd')]",版本":[变量('sqlversion')]"}},

解决方案

您必须先为实例配置 Azure Active Directory 管理员,然后才能使用 AAD 凭据连接或创建任何 AAD 数据库用户.请参阅配置和管理使用 Azure SQL 的 Azure AD 身份验证

设置 AAD 管理员后,以 AAD 管理员或 AAD 安全组的成员身份进行连接,设置为 AAD 管理员和 创建映射到 Azure AD 的包含用户身份,例如

从外部提供商创建用户 [bob@contoso.com];

CREATE USER [ICU Nurses] from EXTERNAL PROVIDER;

I have a SQL Server in Azure which is created using a simple ARM template. When I connect to the SQL Server using my sqladmin credentials I am able to connect to it fine. I am using SQL Server Management Studio for this.

However, When I use any of the following highlighted options, I am seeing an error message.

The Error I am seeing is as shown below, its a pop-up window but I am pasting the text in it for easy reference.

TITLE: Connect to Server
------------------------------
Cannot connect to abcd-core-sql.database.windows.net.
------------------------------
ADDITIONAL INFORMATION:

**Login failed for user '<token-identified principal>'. (Microsoft SQL Server, Error: 18456)**

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

I would appreciate if anyone can comment on if I am missing anything in creating a SQL Server using the ARM template.In other words is there anything else that needs to be included in the config to get the azure ad authentication working for a sql db in azure.

    {
        "type": "Microsoft.Sql/servers",
        "name": "[variables('sql_name')]",
        "apiVersion": "2015-05-01-preview",
        "location": "eastus2",
        "properties": {
            "administratorLogin": "[parameters('admin')]",
            "administratorLoginPassword": "[parameters('passwd')]",
            "version": "[variables('sqlversion')]"
        }
    },

解决方案

You must configure an Azure Active Directory Admin for the instance before you can connect with AAD credentials or create any AAD Database Users. See Configure and manage Azure AD authentication with Azure SQL

Once you've set the AAD Administrator, connect as the AAD Admin or a member of the AAD Security Group set as the AAD Admin and Create contained users mapped to Azure AD identities, eg

CREATE USER [bob@contoso.com] FROM EXTERNAL PROVIDER;

or

CREATE USER [ICU Nurses] FROM EXTERNAL PROVIDER;

这篇关于无法使用 azure 连接 sql 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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