[英]how to create Firewall Rules with API in Azure?
I need to create Firewall Rules in a database in Azure, to allow certain ips to access, I found that documentation but I do not know exactly what steps to do. 我需要在Azure的数据库中创建防火墙规则,以允许某些ip访问,但我发现了该文档,但我不知道该怎么做。
https://docs.microsoft.com/es-es/rest/api/sql/firewallrules/createorupdate https://docs.microsoft.com/es-es/rest/api/sql/firewallrules/createorupdate
I already know how to consume a service using GET, PUT, POST, or DELETE. 我已经知道如何使用GET,PUT,POST或DELETE使用服务。 but for more that I send the POST it returns this to me.
但是对于我发送的更多信息,POST将其返回给我。
I think I need to send the credentials, before sending the POST 我认为我需要先发送凭据,然后再发送POST
How to do this? 这个怎么做? the other question is that I do not want to do it directly from the portal, because I need a program that I am developing to do it through the consumption of the API
另一个问题是我不想直接从门户网站进行操作,因为我需要一个正在开发的程序来通过使用API来执行此操作
you need to use your subscription id, not your subscription name: 您需要使用您的订阅ID,而不是您的订阅名称:
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}?api-version=2014-04-01
^ put resourceId here
easiest way to retrieve that - go to that portal to the sql server in question and look up the url. 最简单的检索方法-转到有问题的sql server的门户并查找url。 it will be the exact same url (except for the first part).
它将是完全相同的网址(第一部分除外)。 here's url from the portal for kv resource:
以下是kv资源门户网站的网址:
https://portal.azure.com/resource/subscriptions/xxx/resourceGroups/infrastructure/providers/Microsoft.KeyVault/vaults/yyy/overview
^ this is where the resourceId starts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.