简体   繁体   English

地址为IP的客户端不允许访问服务器Azure SQL数据库

[英]Client with IP address is not allowed to access the server Azure SQL database

I am facing the below error when I try to connect to the Azure SQL database of my free trial account.当我尝试连接到我的免费试用帐户的 Azure SQL 数据库时,我遇到了以下错误。 Can anyone help me how to set rules in my free trial account?谁能帮我如何在我的免费试用帐户中设置规则? I don't see any option to set them.我没有看到任何设置它们的选项。

Cannot open server 'ccaausprddb001' requested by the login. Client with
IP address '125.16.236.150' is not allowed to access the server.  To enable 
access, use the Windows Azure Management Portal or run sp_set_firewall_rule on 
the master database to create a firewall rule for this IP address or address 
range.  It may take up to five minutes for this change to take effect. 
ClientConnectionId:f1ce6d56-c321-4458-a8dc-507f40e24108
com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open server 'ccaausprddb001' requested by the login. Client with IP address '125.16.236.150' is not allowed to access the server.  To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect.

This can be solved by configuring the Firewall of the Azure SQL Server where the SQL database resides.这可以通过配置 SQL 数据库所在的 Azure SQL Server 的防火墙来解决。 I am using the new Microsoft Azure Portal.我正在使用新的 Microsoft Azure 门户。 Please see the screenshot below,请看下面的截图, 从列出的资源中选择 SQL 服务器 Remember, you need to configure the Firewall and manage the IP addresses in SQL Server, not the SQL database.请记住,您需要在 SQL Server 中配置防火墙和管理 IP 地址,而不是在 SQL 数据库中。

Once you have selected the SQL Server,选择 SQL Server 后,

  • Click the Settings -> Firewall点击设置 -> 防火墙
  • You will be requested Add a new Rule.您将被要求添加新规则。
  • Add a name and enter the IP address(or the range) that will access the database.添加名称并输入将访问数据库的 IP 地址(或范围)。 note: Azure automatically detects your current IP.注意:Azure 会自动检测您当前的 IP。

按着这些次序

Wait for 5 minutes and you are ready to go.等待 5 分钟,您就可以开始了。 I hope this helps.我希望这有帮助。

You need to set up server-level firewall rules for your server in the Azure portal.您需要在 Azure 门户中为您的服务器设置服务器级防火墙规则。 Go to the database that you have created by clicking SQL databases in left hand menu and select set server firewall as following figure.通过单击左侧菜单中的 SQL 数据库转到您创建的数据库,然后选择设置服务器防火墙,如下图所示。

在此处输入图像描述

Under the firewall settings click add client IP and save it.在防火墙设置下单击添加客户端 IP 并保存。 It will automatically add your ID address and a server-level firewall rule is created for your current IP address.它将自动添加您的 ID 地址,并为您当前的 IP 地址创建服务器级防火墙规则。

在此处输入图像描述

Now you can login to your azure SQL server database using SQL server management studio.现在,您可以使用 SQL Server Management Studio 登录到您的 Azure SQL Server 数据库。

Using portal.azure.com (recommended), select your sql server (hosting your database) and click Show firewall settings.使用 portal.azure.com(推荐),选择您的 sql 服务器(托管您的数据库),然后单击显示防火墙设置。 Select Add client IP and press save.选择添加客户端 IP,然后按保存。

Using manage.windowsazure.com, select SQL Databases from the list on the left side.使用 manage.windowsazure.com,从左侧的列表中选择 SQL 数据库。 Then Servers tab, from there go to the server hosting your database.然后服务器选项卡,从那里转到托管数据库的服务器。 Go to Configure Tab.转到配置选项卡。 Select Add to the allowed ip addresses arrow against your current client ip address.针对您当前的客户端 IP 地址,选择添加到允许的 IP 地址箭头。

ADD and EDIT Client IP Address in Azure SQL DB在 Azure SQL DB 中添加和编辑客户端 IP 地址

在此处输入图像描述

we will see how to Add, Edit (and Delete) Client IP Addresses in Microsoft Azure Portal step by step for Azure SQL DB.我们将逐步了解如何在 Microsoft Azure 门户中为 Azure SQL DB 添加、编辑(和删除)客户端 IP 地址。

What is Azure Firewall?什么是 Azure 防火墙?

Azure Firewall Services are managed cloud-based network security services that protects our Azure Virtual Network resources. Azure 防火墙服务是托管的基于云的网络安全服务,可保护我们的 Azure 虚拟网络资源。 It's a supports high built-in availability and gives unrestricted cloud scalability.它支持高内置可用性并提供不受限制的云可扩展性。

在此处输入图像描述

To Add and Edit Client IP Address in Azure Portal在 Azure 门户中添加和编辑客户端 IP 地址

STEP 1-步骤1-

If we connect SSMS (SQL Server Management Studio) in Azure SQL Db at work from home or outside the access-able range, the below popup would come after entering all credentials correctly.如果我们在家中或在可访问范围之外连接 Azure SQL Db 中的 SSMS(SQL Server Management Studio),则在正确输入所有凭据后会出现以下弹出窗口。 This is for security strengthen purposes and protects our server from unauthorized accesses.这是出于增强安全性的目的,并保护我们的服务器免受未经授权的访问。

在此处输入图像描述

STEP 2-第2步-

we have to connect with our Microsoft authorized account and password needs to be entered.我们必须与我们的 Microsoft 授权帐户连接,并且需要输入密码。 This step is also for protecting our servers from unauthorized accesses.此步骤也是为了保护我们的服务器免受未经授权的访问。

在此处输入图像描述

STEP 3-步骤 3-

If we are already given with Azure Firewall access, then we can Add our Client IP (Internet protocol) Address here itself.如果我们已经获得了 Azure 防火墙访问权限,那么我们可以在此处添加我们的客户端 IP(Internet 协议)地址。 Or else, we have to follow the below other steps in Azure Portal.否则,我们必须在 Azure 门户中执行以下其他步骤。

在此处输入图像描述

STEP 4-第4步-

Go to Google and Type 'portal.azure.com' like below.转到 Google 并键入“portal.azure.com”,如下所示。

在此处输入图像描述

STEP 5-步骤 5-

In the Azure Portal, type and choose SQL databases.在 Azure 门户中,键入并选择 SQL 数据库。

在此处输入图像描述

STEP 6-步骤 6-

In the below step, Click the DB Name(DB name is hyperlinked here in this page).在下面的步骤中,单击数据库名称(数据库名称在此页面中已超链接)。

在此处输入图像描述

STEP 7第 7 步

In this Page, Server,DB,Subscription,Resource related details would show up.在此页面中,将显示与服务器、数据库、订阅、资源相关的详细信息。 Click the Server Name (hyperlinked) like below.单击下面的服务器名称(超链接)。

在此处输入图像描述

STEP 8-步骤 8-

In this Portal page, Click the Firewalls and Virtual Networks (hyperlinked)在此门户页面中,单击防火墙和虚拟网络(超链接)

在此处输入图像描述

STEP 9-步骤 9-

In this Firewalls and Virtual Networks page, We can Add,Edit and Delete Client IP Address.在此防火墙和虚拟网络页面中,我们可以添加、编辑和删除客户端 IP 地址。

在此处输入图像描述

Like below,如下图,

1–> We can give new name in Rule name and have to fill Start IP and End IP. 1–> 我们可以在规则名称中指定新名称,并且必须填写 Start IP 和 End IP。 If we have Single IP, then paste them in both Start and End IP Places.如果我们有单个 IP,则将它们粘贴到开始和结束 IP 位置。

2–> We can Also Edit the Existing Rule Name and Start/End IP's. 2–> 我们还可以编辑现有规则名称和开始/结束 IP。

在此处输入图像描述

STEP 10-步骤 10-

We can also Delete any Existing Client IP Address (3 dots at the end – Click it, Delete Option Would Come like below).我们还可以删除任何现有的客户端 IP 地址(末尾的 3 个点 - 单击它,删除选项将如下所示)。

在此处输入图像描述

I followed similar steps commented by everyone which helped me a lot, still i was unable to connect.我按照每个人评论的类似步骤对我帮助很大,但我仍然无法连接。 I found issue was with my IP address as it was not detecting properly after setting many times in Add IP rule, provided my machine IP by typing ipconfig in cmd prompt but no luck.我发现问题出在我的 IP 地址上,因为在添加 IP 规则中多次设置后它没有正确检测到,通过在 cmd 提示符下键入 ipconfig 提供了我的机器 IP,但没有运气。

Tried using public IP via link - https://www.whatismyip.com/ it resolved the above issue.尝试通过链接使用公共 IP - https://www.whatismyip.com/它解决了上述问题。

Working Solution: If IP is something like : 40.333.225.43工作解决方案:如果 IP 类似于:40.333.225.43

In my case I am using mysql.就我而言,我使用的是 mysql。

So go to your mysqldatabase > Connection security所以去你的mysql数据库>连接安全

and set same ip in Firewall rules (StartIP and EndIP) and Save.并在防火墙规则(StartIP 和 EndIP)中设置相同的 ip 并保存。

Go to your azure sql server -> Security tab -> Firewalls and virtual networks -> Add Client Ip.转到您的 azure sql server -> 安全选项卡 -> 防火墙和虚拟网络 -> 添加客户端 Ip。

This will automatically add your current IP and resolve the issue这将自动添加您当前的 IP 并解决问题

This works not for all the issues as stated:这不适用于所述的所有问题:
Alternatively you need to perform as suggested below:或者,您需要按照以下建议执行:

Run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.在 master 数据库上运行sp_set_firewall_rule以为此 IP 地址或地址范围创建防火墙规则。

You should enable the "Allow Azure services and resources to access this server" when you access sqlserver from azure resources like azure app service, azure funtion etc..当您从 azure 资源(如 azure 应用服务、azure 功能等)访问 sqlserver 时,您应该启用“允许 Azure 服务和资源访问此服务器”。 在此处输入图像描述 在此处输入图像描述

Error: Client with IP address is not allowed to access the server Azure SQL database错误:不允许具有 IP 地址的客户端访问服务器 Azure SQL 数据库

I had this issue while connecting AZURE SQL Database,我在连接 AZURE SQL 数据库时遇到了这个问题,

Go to Firewall settings -> Click Add Client IP.转到防火墙设置 -> 单击添加客户端 IP。

Above will add the current IP to in the list, now you should be able to login and query.以上将当前IP添加到列表中,现在您应该可以登录和查询了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 地址为 IP 'yyy.yy.yy.yy' 的客户端不允许访问服务器。 我的客户ip是xxx.xx.xx.xx - Client with IP address 'yyy.yy.yy.yy' is not allowed to access the server. My client ip is xxx.xx.xx.xx 如何在 Azure SQL 服务器使用 Azure ARM 模板中一次添加多个客户端 IP 地址? - How to add multiple client IP addresses at time in Azure SQL Server using Azure ARM Templates? 如何访问Azure SQL数据而不设置防火墙设置中的IP地址? 仅通过简单的 ConnectionString? - How to access Azure SQL Data without setting IP Address in firewall setting? Just By Simply ConnectionString? Azure SQL 数据库角色和访问 - Azure SQL Database roles and access 访问多个数据库 Azure SQL - Access multiple database in Azure SQL 如何使用 Active Directory 身份验证从 Tableau Desktop 访问 Azure SQL 服务器/数据库 - How to Access Azure SQL Server/Database from Tableau Desktop using Active Directory Authentication 推荐Azure SQL服务器数据库配置 - Recommended Azure SQL Server Database Configuration 没有服务器证书信任 Azure SQL 数据库 - No server certificate trust in Azure SQL Database 访问SQL服务器中的Azure表存储 - Access Azure Table Storage in SQL Server Azure Function 无法访问 Azure VM 上托管的 SQL 数据库 - Azure Function cannot access SQL database hosted on Azure VM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM