简体   繁体   English

通过Azure ARM模板将VNET规则添加到PostgreSQL服务器

[英]Adding VNET Rules to PostgreSQL Server via Azure ARM Template

I'm writing an Azure Resource Manager template automating the creation of a PostgreSQL database. 我正在编写一个Azure资源管理器模板,该模板可以自动创建PostgreSQL数据库。 I have successfully added a firewall rule with the following: 我已经成功添加了以下防火墙规则:

{
  "type": "firewallRules"
  "apiVersion": "2017-12-01",
  "dependsOn": [
    "[concat('Microsoft.DBforPostgreSQL/servers/', variables('serverName'))]"
    ],
    "location": "[parameters('location')]",
    "name": "[concat(variables('serverName'),'firewall')]",
    "properties": {
      "startIpAddress": "[parameters('firewallStartIpAddress')]",
      "endIpAddress": "[parameters('firewallEndIpAddress')]"
    }
}

However, what if I wanted to add a VNET rule instead? 但是,如果我想添加VNET规则怎么办? There doesn't appear to be any mention of this within the documentation here . 这里的文档中似乎没有任何提及。

I have researched this and discovered this documentation but it is in regards to the 'Microsoft.Sql' resource, not the 'Microsoft.DBforPostgreSQL' resource. 我对此进行了研究并发现了此文档,但这是关于'Microsoft.Sql'资源而不是'Microsoft.DBforPostgreSQL'资源的。

Based on the API for PostgreSQL : Virtual Network Rules - Create Or Update , it seems MS missed it in the template. 基于PostgreSQL的API: 虚拟网络规则-创建或更新 ,看来MS在模板中没有找到它。

I have tried the template like the template for sql below, but it doesn't work. 我已经尝试过像下面的sql模板一样的模板,但是它不起作用。

{
  "name": "string",
  "type": "Microsoft.DBforPostgreSQL/servers/virtualNetworkRules",
  "apiVersion": "2017-12-01",
  "properties": {
    "virtualNetworkSubnetId": "string",
    "ignoreMissingVnetServiceEndpoint": boolean
  }
}

Update : 更新

Per my test, after setting vnet rule of a SQL DB in the portal, I can find it via Azure Resource Explorer (you could access it in resource.azure.com), please refer to the screenshot. 根据我的测试,在门户中设置SQL DB的vnet规则后,我可以通过Azure资源浏览器找到它(您可以在resource.azure.com中访问它),请参阅屏幕截图。

在此处输入图片说明

在此处输入图片说明

AFAIK, azure database for PostgreSQL supports API, azure CLI, azure portal to set vnet rule. AFAIK,PostgreSQL的azure数据库支持API,azure CLI,azure门户来设置vnet规则。

But After setting it in the portal, I could not find it in the resource explorer and Automation script . 但在门户网站设置之后,我不能资源管理器自动化脚本找到它。

在此处输入图片说明

So I think postgresql does not support ARM template. 所以我觉得PostgreSQL 支持ARM模板。 If you want to improve the azure db for postgresql, you could post your idea in the feedback . 如果您想改善Azgre db for postgresql,可以将您的想法发表在反馈中

Besides, I find an idea of ARM Template for MySQL , it is supported now. 此外,我发现了适用于MySQLARM模板的想法,现在支持它。 If you post it, I think it will be supported in the future. 如果您将其发布,我认为将来会支持。

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

相关问题 Azure ARM 模板,用于创建 PostgreSQL 服务器并启用自定义密钥加密 - Azure ARM template for creating PostgreSQL server and enable custom key encryption 添加 NSG 规则以在 Azure PostgreSQL 灵活服务器上启用高可用性 - Adding NSG rules to enable high availability on Azure PostgreSQL Flexible Server 无法通过应用服务中的 VNet 访问我的 Azure for PostgreSQL 灵活服务器 - Unable to access my Azure for PostgreSQL Flexible Server through VNet from App Service Azure 自动化中的 PostgreSQL 规则 - PostgreSQL rules in Azure automation PostgreSQL SKU大小与Azure ARM中的存储大小(MB)之间的差异 - Difference between PostgreSQL SKU Size and Storage Size(MB) in Azure ARM Email function 用于 azure postgresql 服务器 - Email function for azure postgresql server 通过 postgresql 中的循环添加多列 - adding multiple columns via a loop in postgresql 在PostgreSQL服务器上仔细检查夏令时规则是最新的吗? - Double checking daylight savings rules on PostgreSQL server are up to date? Azure Powershell - 重命名 PostgreSQL 服务器实例的数据库 - Azure Powershell - rename Database for PostgreSQL Server instance 本地 SQL 服务器到 Azure PostgreSQL 复制 - On-premise SQL Server to Azure PostgreSQL replication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM