mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
fix
This commit is contained in:
@@ -81,6 +81,22 @@ function Load-ResourceGroup {
|
||||
}
|
||||
}
|
||||
|
||||
function Set-VirtualNetwork
|
||||
{
|
||||
param($virtualNetwork)
|
||||
|
||||
Write-Host "Applying changes to the virtual network."
|
||||
Try
|
||||
{
|
||||
Set-AzureRmVirtualNetwork -VirtualNetwork $virtualNetwork -ErrorAction Stop | Out-Null
|
||||
}
|
||||
Catch
|
||||
{
|
||||
Write-Host "Failed: $_" -ForegroundColor Red
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ConvertCidrToUint32Array
|
||||
{
|
||||
param($cidrRange)
|
||||
@@ -166,6 +182,9 @@ $gatewaySubnetPrefix = CalculateNextAddressPrefix $virtualNetwork 28
|
||||
|
||||
$vpnClientAddressPoolPrefix = CalculateVpnClientAddressPoolPrefix $gatewaySubnetPrefix
|
||||
|
||||
$virtualNetwork.AddressSpace.AddressPrefixes.Add($gatewaySubnetPrefix)
|
||||
Add-AzureRmVirtualNetworkSubnetConfig -Name GatewaySubnet -VirtualNetwork $virtualNetwork -AddressPrefix $gatewaySubnetPrefix | Out-Null
|
||||
|
||||
Write-Host
|
||||
|
||||
# Start the deployment
|
||||
|
||||
@@ -42,27 +42,6 @@
|
||||
"clientRootCertName": "RootCert"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"name": "[parameters('virtualNetworkName')]",
|
||||
"type": "Microsoft.Network/virtualNetworks",
|
||||
"apiVersion": "2018-02-01",
|
||||
"location": "[parameters('location')]",
|
||||
"properties": {
|
||||
"addressSpace": {
|
||||
"addressPrefixes": [
|
||||
"[parameters('gatewaySubnetPrefix')]"
|
||||
]
|
||||
},
|
||||
"subnets": [
|
||||
{
|
||||
"name": "[variables('gatewaySubnetName')]",
|
||||
"properties": {
|
||||
"addressPrefix": "[parameters('gatewaySubnetPrefix')]"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2017-10-01",
|
||||
"type": "Microsoft.Network/publicIPAddresses",
|
||||
@@ -78,8 +57,7 @@
|
||||
"name": "[variables('gatewayName')]",
|
||||
"location": "[resourceGroup().location]",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('gatewayPublicIpAddressName'))]",
|
||||
"[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]"
|
||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('gatewayPublicIpAddressName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"ipConfigurations": [
|
||||
|
||||
Reference in New Issue
Block a user