[英]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. 此外,我发现了适用于MySQL的ARM模板的想法,现在支持它。 If you post it, I think it will be supported in the future.
如果您将其发布,我认为将来会支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.