简体   繁体   English

Azure 堡垒到现有 Vnet

[英]Azure Bastion into Existing Vnet

Hi I'm trying to deploy an AzureBastion into a seperate vnet which is in a separate resourcegroup from the bastion.您好,我正在尝试将 AzureBastion 部署到独立的 vnet 中,该 vnet 位于与堡垒不同的资源组中。 I keep getting the error below,我不断收到以下错误,

New-AzSubscriptionDeployment : 10:49:03 - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The resource 
'Microsoft.Network/virtualNetworks/vnet1/subnets/AzureBastionSubnet' is not defined in the template. Please see https://aka.ms/arm-template for usage details.'.
At C:\Temp\New-Deployment\deploy-core.ps1:53 char:1

The template is at模板在

"https://pastebin.com/embed_js/ET9HwFJ9" “https://pastebin.com/embed_js/ET9HwFJ9”

Can anyone see where I'm going wrong, driving me insane谁能看到我哪里出错了,让我发疯

I should add this is a nested template, called by a master template.我应该添加这是一个嵌套模板,由主模板调用。 which is below:如下:

"https://pastebin.com/embed_js/Uf3asC9c" “https://pastebin.com/embed_js/Uf3asC9c”

Thanks in advance :)提前致谢 :)

Please follow the following ARM template, it allows you to:请遵循以下 ARM 模板,它允许您:

**- Add the subnet “AzureBastionSubnet” which is required to create a Bastion. **- 添加创建堡垒所需的子网“AzureBastionSubnet”。

  • Create the Public Address Ip for the Bastion.为堡垒创建公共地址 IP。
  • Create the Bastion.**创建堡垒。**

Deploy template.json:部署 template.json:

{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
    "location": {
        "type": "string"
    },
    "resourceGroup": {
        "type": "string"
    },
    "bastionHostName": {
        "type": "string"
    },
    "subnetName": {
        "type": "string"
    },
    "publicIpAddressName": {
        "type": "string"
    },
    "existingVNETName": {
        "type": "string"
    },
    "subnetAddressPrefix": {
        "type": "string"
    }
},
"resources": [
    {
        "apiVersion": "2019-02-01",
        "type": "Microsoft.Network/publicIpAddresses",
        "name": "[parameters('publicIpAddressName')]",
        "location": "[parameters('location')]",
        "sku": {
            "name": "Standard"
        },
        "properties": {
            "publicIPAllocationMethod": "Static"
        },
        "tags": {}
    },
    {
        "apiVersion": "2018-04-01",
        "type": "Microsoft.Network/virtualNetworks/subnets",
        "name": "[concat(parameters('existingVNETName'), '/', parameters('subnetName'))]",
        "location": "[parameters('location')]",
        "properties": {
          "addressPrefix": "[parameters('subnetAddressPrefix')]"
        }
      },
    {
        "apiVersion": "2018-10-01",
        "type": "Microsoft.Network/bastionHosts",
        "name": "[parameters('bastionHostName')]",
        "location": "[parameters('location')]",
        "dependsOn": [
            "[resourceId(parameters('resourceGroup'), 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]"
        ],
        "properties": {
            "ipConfigurations": [
                {
                    "name": "IpConf",
                    "properties": {
                        "subnet": {
                            "id": "[resourceId(parameters('resourceGroup'), 'Microsoft.Network/virtualNetworks/subnets', parameters('existingVNETName'),parameters('subnetName'))]"
                        },
                        "publicIPAddress": {
                            "id": "[resourceId(parameters('resourceGroup'), 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]"
                        }
                    }
                }
            ]
        },
        "tags": {}
    }
]

} }

Paramtere template:参数模板:

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
    "resourceGroup": {
        "value": "testAmine"
    },
    "bastionHostName": {
        "value": "TestBast"
    },
    "publicIpAddressName": {
        "value": "testamine-vnet-ip"
    },
    "subnetName": {
        "value": "AzureBastionSubnet"
    },
    "existingVNETName":
    {
        "value": "testamine-vnet"
    },
    "subnetAddressPrefix":
    {
        "value": "10.0.1.0/27"
    },
    "location": {
        "value": "westeurope"
    }
}

} }

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

相关问题 连接用于 Azure 堡垒部署的子网 ID 参考 - Concat a Subnet ID reference for azure bastion deployment 通过ARM模板将子网添加到现有Vnet - Addition of subnets to existing Vnet through ARM templates ARM 模板使用现有 VNet 和子网创建 VM - ARM template to create a VM using an existing VNet and subnet 无法使用JSON创建VNet - Unable to create VNet using JSON Azure json 部署在现有集线器路由表中添加分支路由 - Azure json deployment add spoke route in existing hub route table Azure 逻辑应用:动态设置工作流名称以调用现有逻辑应用(嵌套逻辑应用) - Azure logic apps : Setting Workflow name dynamically to call a existing logic app(Nested Logic app) Azure管道-通过json导入任务组始终创建一个新任务,而不是更改现有任务组 - Azure Pipeline - Importing Taskgroup via json always creates a new one instead of changing the existing Azure Active Directory用户(类型=具有现有用户帐户的用户)Json到列表模型的值为空 - Azure Active Directory Users (type=User with an existing user account) Json to List Model is giving null 使用AzureRM在同一vnet中部署不同子网的嵌套模板 - Nesting templates that deploy different subnets in the same vnet with AzureRM How can I append JSON data to an existing JSON file stored in Azure blob storage through python? - How can I append JSON data to an existing JSON file stored in Azure blob storage through python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM