微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ARM

如何解决ARM

我可以通过门户很好地为存储队列创建专用端点,并且在使用KUDU的nameresolver.exe进行检查时,它可以按预期工作。但是,我一直在努力寻找能够一次性完成此任务的ARM模板。

我已经使此模板正常工作,但可以看到在生成的“私有DNS区域”中没有生成记录条目。我不知道如何创建该A记录条目,并且似乎无法在线找到描述此内容的ARM模板:

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#","contentVersion": "1.0.0.0","parameters": {
        "privateEndpointName": {
            "type": "string","defaultValue": "privendpoint-sapriv01-queue"
        },"vnetName": {
            "type": "string","defaultValue": "vn-myvnet01"
        },"subnetName": {
            "type": "string","defaultValue": "sn-private-endpoints"
        },"groupId": {
            "type": "string","defaultValue": "queue"
        }
    },"variables": {
        "privatednSZone_name": "[concat('privatelink','.queue.',environment().suffixes.storage)]"
    },"resources": [
        {
            "apiVersion": "2019-04-01","name": "[parameters('privateEndpointName')]","type": "Microsoft.Network/privateEndpoints","location": "[resourceGroup().Location]","properties": {
                "privateLinkServiceConnections": [
                    {
                        "name": "[parameters('privateEndpointName')]","properties": {
                            "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts','saprivendpointdemo')]","groupIds": [
                                "[parameters('groupId')]"
                            ]
                        }
                    }
                ],"manualPrivateLinkServiceConnections": [],"subnet": {
                    "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets',parameters('vnetName'),parameters('subnetName') )]"
                }
            }
        },{
            "type": "Microsoft.Network/privatednsZones","apiVersion": "2018-09-01","name": "[variables('privatednSZone_name')]","location": "global","tags": {},"properties": {}
        },{
            "type": "Microsoft.Network/privatednsZones/virtualNetworkLinks","name": "[concat(variables('privatednSZone_name'),'/','link' )]","dependsOn": [
                "[resourceId('Microsoft.Network/privatednsZones',variables('privatednSZone_name'))]"
            ],"properties": {
                "virtualNetwork": {
                    "id": "[resourceId('Microsoft.Network/virtualNetworks',parameters('vnetName'))]"
                },"registrationEnabled": false
            }
        }
    ],"outputs": {
    }
}

我认为微软使这一问题复杂化了。专用IP是自动生成的,我不知道如何在ARM模板中引用该IP。

解决方法

如果要在Azure私有DNS区域中添加记录,则可以在模板中定义Microsoft.Network/privateEndpoints/privateDnsZoneGroups

例如

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#","contentVersion": "1.0.0.0","parameters": {
        "privateEndpointName": {
            "type": "string","defaultValue": "testqueue"
        },"vnetName": {
            "type": "string","defaultValue": "teststorage"
        },"subnetName": {
            "type": "string","defaultValue": "default"
        },"groupId": {
            "type": "string","defaultValue": "queue"
        }
    },"variables": {
        "privateDNSZone_name": "[concat('privatelink','.queue.',environment().suffixes.storage)]"
    },"resources": [
        {
            "apiVersion": "2019-04-01","name": "[parameters('privateEndpointName')]","type": "Microsoft.Network/privateEndpoints","location": "[resourceGroup().Location]","properties": {
                "privateLinkServiceConnections": [
                    {
                        "name": "[parameters('privateEndpointName')]","properties": {
                            "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts','teststorage05')]","groupIds": [
                                "[parameters('groupId')]"
                            ]
                        }
                    }
                ],"manualPrivateLinkServiceConnections": [],"subnet": {
                    "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets',parameters('vnetName'),parameters('subnetName') )]"
                }
            }
        },{
            "type": "Microsoft.Network/privateDnsZones","apiVersion": "2018-09-01","name": "[variables('privateDNSZone_name')]","dependsOn": [
                "[parameters('privateEndpointName')]"
            ],"location": "global","tags": {},"properties": {}
        },{
            "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks","name": "[concat(variables('privateDNSZone_name'),'/','link' )]","dependsOn": [
                "[resourceId('Microsoft.Network/privateDnsZones',variables('privateDNSZone_name'))]"
            ],"properties": {
                "virtualNetwork": {
                    "id": "[resourceId('Microsoft.Network/virtualNetworks',parameters('vnetName'))]"
                },"registrationEnabled": false
            }
        },{
            "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups","apiVersion": "2020-03-01","name": "[concat(parameters('privateEndpointName'),'default')]","dependsOn": [
                "[parameters('privateEndpointName')]","[variables('privateDNSZone_name')]"
            ],"properties": {
                "privateDnsZoneConfigs": [
                    {
                        "name": "privatelink-queue-core-windows-net","properties": {
                            "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones',variables('privateDNSZone_name'))]"
                        }
                    }
                ]
            }
        }
    ],"outputs": {
    }
}

enter image description here enter image description here

有关更多详细信息,请参阅herehere

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?