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

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

问题描述

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

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

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

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')]"
        }
    },

推荐答案

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

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

设置了AAD管理员后,以AAD管理员身份或AAD安全组的成员(设置为AAD管理员)身份进行连接,然后

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;

CREATE USER [ICU Nurses] FROM EXTERNAL PROVIDER;

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

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