Merge pull request #6005 from boumenot/pr-azure-randomize-resource-names
azure: support concurrent deployments in the same resource group
This commit is contained in:
commit
8481663d4a
|
@ -105,8 +105,6 @@
|
||||||
"addressPrefix": "10.0.0.0/16",
|
"addressPrefix": "10.0.0.0/16",
|
||||||
"apiVersion": "2015-06-15",
|
"apiVersion": "2015-06-15",
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
|
|
|
@ -29,11 +29,9 @@ type Builder struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DefaultNicName = "packerNic"
|
DefaultSasBlobContainer = "system/Microsoft.Compute"
|
||||||
DefaultPublicIPAddressName = "packerPublicIP"
|
DefaultSasBlobPermission = "r"
|
||||||
DefaultSasBlobContainer = "system/Microsoft.Compute"
|
DefaultSecretName = "packerKeyVaultSecret"
|
||||||
DefaultSasBlobPermission = "r"
|
|
||||||
DefaultSecretName = "packerKeyVaultSecret"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
||||||
|
@ -303,8 +301,8 @@ func (b *Builder) configureStateBag(stateBag multistep.StateBag) {
|
||||||
stateBag.Put(constants.ArmKeyVaultDeploymentName, fmt.Sprintf("kv%s", b.config.tmpDeploymentName))
|
stateBag.Put(constants.ArmKeyVaultDeploymentName, fmt.Sprintf("kv%s", b.config.tmpDeploymentName))
|
||||||
}
|
}
|
||||||
stateBag.Put(constants.ArmKeyVaultName, b.config.tmpKeyVaultName)
|
stateBag.Put(constants.ArmKeyVaultName, b.config.tmpKeyVaultName)
|
||||||
stateBag.Put(constants.ArmNicName, DefaultNicName)
|
stateBag.Put(constants.ArmNicName, b.config.tmpNicName)
|
||||||
stateBag.Put(constants.ArmPublicIPAddressName, DefaultPublicIPAddressName)
|
stateBag.Put(constants.ArmPublicIPAddressName, b.config.tmpPublicIPAddressName)
|
||||||
if b.config.TempResourceGroupName != "" && b.config.BuildResourceGroupName != "" {
|
if b.config.TempResourceGroupName != "" && b.config.BuildResourceGroupName != "" {
|
||||||
stateBag.Put(constants.ArmDoubleResourceGroupNameSet, true)
|
stateBag.Put(constants.ArmDoubleResourceGroupNameSet, true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,9 +130,13 @@ type Config struct {
|
||||||
tmpCertificatePassword string
|
tmpCertificatePassword string
|
||||||
tmpResourceGroupName string
|
tmpResourceGroupName string
|
||||||
tmpComputeName string
|
tmpComputeName string
|
||||||
|
tmpNicName string
|
||||||
|
tmpPublicIPAddressName string
|
||||||
tmpDeploymentName string
|
tmpDeploymentName string
|
||||||
tmpKeyVaultName string
|
tmpKeyVaultName string
|
||||||
tmpOSDiskName string
|
tmpOSDiskName string
|
||||||
|
tmpSubnetName string
|
||||||
|
tmpVirtualNetworkName string
|
||||||
tmpWinRMCertificateUrl string
|
tmpWinRMCertificateUrl string
|
||||||
|
|
||||||
useDeviceLogin bool
|
useDeviceLogin bool
|
||||||
|
@ -366,7 +370,11 @@ func setRuntimeValues(c *Config) {
|
||||||
} else if c.TempResourceGroupName != "" && c.BuildResourceGroupName == "" {
|
} else if c.TempResourceGroupName != "" && c.BuildResourceGroupName == "" {
|
||||||
c.tmpResourceGroupName = c.TempResourceGroupName
|
c.tmpResourceGroupName = c.TempResourceGroupName
|
||||||
}
|
}
|
||||||
|
c.tmpNicName = tempName.NicName
|
||||||
|
c.tmpPublicIPAddressName = tempName.PublicIPAddressName
|
||||||
c.tmpOSDiskName = tempName.OSDiskName
|
c.tmpOSDiskName = tempName.OSDiskName
|
||||||
|
c.tmpSubnetName = tempName.SubnetName
|
||||||
|
c.tmpVirtualNetworkName = tempName.VirtualNetworkName
|
||||||
c.tmpKeyVaultName = tempName.KeyVaultName
|
c.tmpKeyVaultName = tempName.KeyVaultName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,13 +34,20 @@ func GetVirtualMachineDeployment(config *Config) (*resources.Deployment, error)
|
||||||
AdminUsername: &template.TemplateParameter{Value: config.UserName},
|
AdminUsername: &template.TemplateParameter{Value: config.UserName},
|
||||||
AdminPassword: &template.TemplateParameter{Value: config.Password},
|
AdminPassword: &template.TemplateParameter{Value: config.Password},
|
||||||
DnsNameForPublicIP: &template.TemplateParameter{Value: config.tmpComputeName},
|
DnsNameForPublicIP: &template.TemplateParameter{Value: config.tmpComputeName},
|
||||||
|
NicName: &template.TemplateParameter{Value: config.tmpNicName},
|
||||||
OSDiskName: &template.TemplateParameter{Value: config.tmpOSDiskName},
|
OSDiskName: &template.TemplateParameter{Value: config.tmpOSDiskName},
|
||||||
|
PublicIPAddressName: &template.TemplateParameter{Value: config.tmpPublicIPAddressName},
|
||||||
|
SubnetName: &template.TemplateParameter{Value: config.tmpSubnetName},
|
||||||
StorageAccountBlobEndpoint: &template.TemplateParameter{Value: config.storageAccountBlobEndpoint},
|
StorageAccountBlobEndpoint: &template.TemplateParameter{Value: config.storageAccountBlobEndpoint},
|
||||||
VMSize: &template.TemplateParameter{Value: config.VMSize},
|
VirtualNetworkName: &template.TemplateParameter{Value: config.tmpVirtualNetworkName},
|
||||||
VMName: &template.TemplateParameter{Value: config.tmpComputeName},
|
VMSize: &template.TemplateParameter{Value: config.VMSize},
|
||||||
|
VMName: &template.TemplateParameter{Value: config.tmpComputeName},
|
||||||
}
|
}
|
||||||
|
|
||||||
builder, _ := template.NewTemplateBuilder(template.BasicTemplate)
|
builder, err := template.NewTemplateBuilder(template.BasicTemplate)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
osType := compute.Linux
|
osType := compute.Linux
|
||||||
|
|
||||||
switch config.OSType {
|
switch config.OSType {
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -73,11 +85,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -85,7 +97,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -105,7 +117,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -126,7 +138,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -177,15 +189,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -75,11 +87,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -108,7 +120,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -130,7 +142,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -182,15 +194,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -148,15 +160,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -146,18 +158,16 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -29,7 +41,7 @@
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [],
|
"dependsOn": [],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -48,7 +60,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -64,7 +76,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -107,9 +119,7 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -71,11 +83,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -83,7 +95,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -102,7 +114,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -118,7 +130,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -166,15 +178,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -147,15 +159,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -146,15 +158,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -149,15 +161,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -40,10 +52,10 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]"
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -51,7 +63,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -65,7 +77,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -81,7 +93,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -127,9 +139,7 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -160,15 +172,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -161,15 +173,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -19,6 +19,10 @@ type TempName struct {
|
||||||
KeyVaultName string
|
KeyVaultName string
|
||||||
ResourceGroupName string
|
ResourceGroupName string
|
||||||
OSDiskName string
|
OSDiskName string
|
||||||
|
NicName string
|
||||||
|
SubnetName string
|
||||||
|
PublicIPAddressName string
|
||||||
|
VirtualNetworkName string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTempName() *TempName {
|
func NewTempName() *TempName {
|
||||||
|
@ -29,6 +33,10 @@ func NewTempName() *TempName {
|
||||||
tempName.DeploymentName = fmt.Sprintf("pkrdp%s", suffix)
|
tempName.DeploymentName = fmt.Sprintf("pkrdp%s", suffix)
|
||||||
tempName.KeyVaultName = fmt.Sprintf("pkrkv%s", suffix)
|
tempName.KeyVaultName = fmt.Sprintf("pkrkv%s", suffix)
|
||||||
tempName.OSDiskName = fmt.Sprintf("pkros%s", suffix)
|
tempName.OSDiskName = fmt.Sprintf("pkros%s", suffix)
|
||||||
|
tempName.NicName = fmt.Sprintf("pkrni%s", suffix)
|
||||||
|
tempName.PublicIPAddressName = fmt.Sprintf("pkrip%s", suffix)
|
||||||
|
tempName.SubnetName = fmt.Sprintf("pkrsn%s", suffix)
|
||||||
|
tempName.VirtualNetworkName = fmt.Sprintf("pkrvn%s", suffix)
|
||||||
tempName.ResourceGroupName = fmt.Sprintf("packer-Resource-Group-%s", suffix)
|
tempName.ResourceGroupName = fmt.Sprintf("packer-Resource-Group-%s", suffix)
|
||||||
|
|
||||||
tempName.AdminPassword = common.RandomString(TempPasswordAlphabet, 32)
|
tempName.AdminPassword = common.RandomString(TempPasswordAlphabet, 32)
|
||||||
|
|
|
@ -20,15 +20,35 @@ func TestTempNameShouldCreatePrefixedRandomNames(t *testing.T) {
|
||||||
t.Errorf("Expected OSDiskName to begin with 'pkros', but got '%s'!", tempName.OSDiskName)
|
t.Errorf("Expected OSDiskName to begin with 'pkros', but got '%s'!", tempName.OSDiskName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.Index(tempName.NicName, "pkrni") != 0 {
|
||||||
|
t.Errorf("Expected NicName to begin with 'pkrni', but got '%s'!", tempName.NicName)
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Index(tempName.PublicIPAddressName, "pkrip") != 0 {
|
||||||
|
t.Errorf("Expected PublicIPAddressName to begin with 'pkrip', but got '%s'!", tempName.PublicIPAddressName)
|
||||||
|
}
|
||||||
|
|
||||||
if strings.Index(tempName.ResourceGroupName, "packer-Resource-Group-") != 0 {
|
if strings.Index(tempName.ResourceGroupName, "packer-Resource-Group-") != 0 {
|
||||||
t.Errorf("Expected ResourceGroupName to begin with 'packer-Resource-Group-', but got '%s'!", tempName.ResourceGroupName)
|
t.Errorf("Expected ResourceGroupName to begin with 'packer-Resource-Group-', but got '%s'!", tempName.ResourceGroupName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.Index(tempName.SubnetName, "pkrsn") != 0 {
|
||||||
|
t.Errorf("Expected SubnetName to begin with 'pkrip', but got '%s'!", tempName.SubnetName)
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Index(tempName.VirtualNetworkName, "pkrvn") != 0 {
|
||||||
|
t.Errorf("Expected VirtualNetworkName to begin with 'pkrvn', but got '%s'!", tempName.VirtualNetworkName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTempNameShouldHaveSameSuffix(t *testing.T) {
|
func TestTempNameShouldHaveSameSuffix(t *testing.T) {
|
||||||
tempName := NewTempName()
|
tempName := NewTempName()
|
||||||
suffix := tempName.ComputeName[5:]
|
suffix := tempName.ComputeName[5:]
|
||||||
|
|
||||||
|
if strings.HasSuffix(tempName.ComputeName, suffix) != true {
|
||||||
|
t.Errorf("Expected ComputeName to end with '%s', but the value is '%s'!", suffix, tempName.ComputeName)
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(tempName.DeploymentName, suffix) != true {
|
if strings.HasSuffix(tempName.DeploymentName, suffix) != true {
|
||||||
t.Errorf("Expected DeploymentName to end with '%s', but the value is '%s'!", suffix, tempName.DeploymentName)
|
t.Errorf("Expected DeploymentName to end with '%s', but the value is '%s'!", suffix, tempName.DeploymentName)
|
||||||
}
|
}
|
||||||
|
@ -37,8 +57,23 @@ func TestTempNameShouldHaveSameSuffix(t *testing.T) {
|
||||||
t.Errorf("Expected OSDiskName to end with '%s', but the value is '%s'!", suffix, tempName.OSDiskName)
|
t.Errorf("Expected OSDiskName to end with '%s', but the value is '%s'!", suffix, tempName.OSDiskName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.HasSuffix(tempName.NicName, suffix) != true {
|
||||||
|
t.Errorf("Expected NicName to end with '%s', but the value is '%s'!", suffix, tempName.PublicIPAddressName)
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.HasSuffix(tempName.PublicIPAddressName, suffix) != true {
|
||||||
|
t.Errorf("Expected PublicIPAddressName to end with '%s', but the value is '%s'!", suffix, tempName.PublicIPAddressName)
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(tempName.ResourceGroupName, suffix) != true {
|
if strings.HasSuffix(tempName.ResourceGroupName, suffix) != true {
|
||||||
t.Errorf("Expected ResourceGroupName to end with '%s', but the value is '%s'!", suffix, tempName.ResourceGroupName)
|
t.Errorf("Expected ResourceGroupName to end with '%s', but the value is '%s'!", suffix, tempName.ResourceGroupName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.HasSuffix(tempName.SubnetName, suffix) != true {
|
||||||
|
t.Errorf("Expected SubnetName to end with '%s', but the value is '%s'!", suffix, tempName.SubnetName)
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.HasSuffix(tempName.VirtualNetworkName, suffix) != true {
|
||||||
|
t.Errorf("Expected VirtualNetworkName to end with '%s', but the value is '%s'!", suffix, tempName.VirtualNetworkName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,12 +461,24 @@ const BasicTemplate = `{
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmSize": {
|
"vmSize": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -482,14 +494,12 @@ const BasicTemplate = `{
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
||||||
|
@ -498,7 +508,7 @@ const BasicTemplate = `{
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"type": "Microsoft.Network/publicIPAddresses",
|
"type": "Microsoft.Network/publicIPAddresses",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"publicIPAllocationMethod": "[variables('publicIPAddressType')]",
|
"publicIPAllocationMethod": "[variables('publicIPAddressType')]",
|
||||||
|
@ -531,10 +541,10 @@ const BasicTemplate = `{
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"type": "Microsoft.Network/networkInterfaces",
|
"type": "Microsoft.Network/networkInterfaces",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -544,7 +554,7 @@ const BasicTemplate = `{
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -560,7 +570,7 @@ const BasicTemplate = `{
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"hardwareProfile": {
|
"hardwareProfile": {
|
||||||
|
@ -584,7 +594,7 @@ const BasicTemplate = `{
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -148,18 +160,16 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -146,18 +158,16 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -29,7 +41,7 @@
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [],
|
"dependsOn": [],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -48,7 +60,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -64,7 +76,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -108,9 +120,7 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -162,18 +174,16 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -185,15 +197,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -11,12 +11,24 @@
|
||||||
"dnsNameForPublicIP": {
|
"dnsNameForPublicIP": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"nicName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"osDiskName": {
|
"osDiskName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"publicIPAddressName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"storageAccountBlobEndpoint": {
|
"storageAccountBlobEndpoint": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"subnetName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualNetworkName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"vmName": {
|
"vmName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -28,7 +40,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('publicIPAddressName')]",
|
"name": "[parameters('publicIPAddressName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"dnsSettings": {
|
"dnsSettings": {
|
||||||
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
||||||
|
@ -61,11 +73,11 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
||||||
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[variables('nicName')]",
|
"name": "[parameters('nicName')]",
|
||||||
"properties": {
|
"properties": {
|
||||||
"ipConfigurations": [
|
"ipConfigurations": [
|
||||||
{
|
{
|
||||||
|
@ -73,7 +85,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"privateIPAllocationMethod": "Dynamic",
|
"privateIPAllocationMethod": "Dynamic",
|
||||||
"publicIPAddress": {
|
"publicIPAddress": {
|
||||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
||||||
},
|
},
|
||||||
"subnet": {
|
"subnet": {
|
||||||
"id": "[variables('subnetRef')]"
|
"id": "[variables('subnetRef')]"
|
||||||
|
@ -87,7 +99,7 @@
|
||||||
{
|
{
|
||||||
"apiVersion": "[variables('apiVersion')]",
|
"apiVersion": "[variables('apiVersion')]",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
||||||
],
|
],
|
||||||
"location": "[variables('location')]",
|
"location": "[variables('location')]",
|
||||||
"name": "[parameters('vmName')]",
|
"name": "[parameters('vmName')]",
|
||||||
|
@ -103,7 +115,7 @@
|
||||||
"networkProfile": {
|
"networkProfile": {
|
||||||
"networkInterfaces": [
|
"networkInterfaces": [
|
||||||
{
|
{
|
||||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -178,15 +190,13 @@
|
||||||
"location": "[resourceGroup().location]",
|
"location": "[resourceGroup().location]",
|
||||||
"managedDiskApiVersion": "2017-03-30",
|
"managedDiskApiVersion": "2017-03-30",
|
||||||
"networkInterfacesApiVersion": "2017-04-01",
|
"networkInterfacesApiVersion": "2017-04-01",
|
||||||
"nicName": "packerNic",
|
|
||||||
"publicIPAddressApiVersion": "2017-04-01",
|
"publicIPAddressApiVersion": "2017-04-01",
|
||||||
"publicIPAddressName": "packerPublicIP",
|
|
||||||
"publicIPAddressType": "Dynamic",
|
"publicIPAddressType": "Dynamic",
|
||||||
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
||||||
"subnetAddressPrefix": "10.0.0.0/24",
|
"subnetAddressPrefix": "10.0.0.0/24",
|
||||||
"subnetName": "packerSubnet",
|
"subnetName": "[parameters('subnetName')]",
|
||||||
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
||||||
"virtualNetworkName": "packerNetwork",
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
||||||
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
||||||
"virtualNetworksApiVersion": "2017-04-01",
|
"virtualNetworksApiVersion": "2017-04-01",
|
||||||
"vmStorageAccountContainerName": "images",
|
"vmStorageAccountContainerName": "images",
|
||||||
|
|
|
@ -24,9 +24,13 @@ type TemplateParameters struct {
|
||||||
KeyVaultName *TemplateParameter `json:"keyVaultName,omitempty"`
|
KeyVaultName *TemplateParameter `json:"keyVaultName,omitempty"`
|
||||||
KeyVaultSecretValue *TemplateParameter `json:"keyVaultSecretValue,omitempty"`
|
KeyVaultSecretValue *TemplateParameter `json:"keyVaultSecretValue,omitempty"`
|
||||||
ObjectId *TemplateParameter `json:"objectId,omitempty"`
|
ObjectId *TemplateParameter `json:"objectId,omitempty"`
|
||||||
|
NicName *TemplateParameter `json:"nicName,omitempty"`
|
||||||
OSDiskName *TemplateParameter `json:"osDiskName,omitempty"`
|
OSDiskName *TemplateParameter `json:"osDiskName,omitempty"`
|
||||||
|
PublicIPAddressName *TemplateParameter `json:"publicIPAddressName,omitempty"`
|
||||||
StorageAccountBlobEndpoint *TemplateParameter `json:"storageAccountBlobEndpoint,omitempty"`
|
StorageAccountBlobEndpoint *TemplateParameter `json:"storageAccountBlobEndpoint,omitempty"`
|
||||||
|
SubnetName *TemplateParameter `json:"subnetName,omitempty"`
|
||||||
TenantId *TemplateParameter `json:"tenantId,omitempty"`
|
TenantId *TemplateParameter `json:"tenantId,omitempty"`
|
||||||
|
VirtualNetworkName *TemplateParameter `json:"virtualNetworkName,omitempty"`
|
||||||
VMSize *TemplateParameter `json:"vmSize,omitempty"`
|
VMSize *TemplateParameter `json:"vmSize,omitempty"`
|
||||||
VMName *TemplateParameter `json:"vmName,omitempty"`
|
VMName *TemplateParameter `json:"vmName,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,9 +374,13 @@ The Azure builder creates the following random values at runtime.
|
||||||
- Compute Name: a random 15-character name prefixed with pkrvm; the name of the VM.
|
- Compute Name: a random 15-character name prefixed with pkrvm; the name of the VM.
|
||||||
- Deployment Name: a random 15-character name prefixed with pkfdp; the name of the deployment.
|
- Deployment Name: a random 15-character name prefixed with pkfdp; the name of the deployment.
|
||||||
- KeyVault Name: a random 15-character name prefixed with pkrkv.
|
- KeyVault Name: a random 15-character name prefixed with pkrkv.
|
||||||
|
- NIC Name: a random 15-character name prefixed with pkrni.
|
||||||
|
- Public IP Name: a random 15-character name prefixed with pkrip.
|
||||||
- OS Disk Name: a random 15-character name prefixed with pkros.
|
- OS Disk Name: a random 15-character name prefixed with pkros.
|
||||||
- Resource Group Name: a random 33-character name prefixed with packer-Resource-Group-.
|
- Resource Group Name: a random 33-character name prefixed with packer-Resource-Group-.
|
||||||
|
- Subnet Name: a random 15-character name prefixed with pkrsn.
|
||||||
- SSH Key Pair: a 2,048-bit asymmetric key pair; can be overridden by the user.
|
- SSH Key Pair: a 2,048-bit asymmetric key pair; can be overridden by the user.
|
||||||
|
- Virtual Network Name: a random 15-character name prefixed with pkrvn.
|
||||||
|
|
||||||
The default alphabet used for random values is **0123456789bcdfghjklmnpqrstvwxyz**. The alphabet was reduced (no
|
The default alphabet used for random values is **0123456789bcdfghjklmnpqrstvwxyz**. The alphabet was reduced (no
|
||||||
vowels) to prevent running afoul of Azure decency controls.
|
vowels) to prevent running afoul of Azure decency controls.
|
||||||
|
|
Loading…
Reference in New Issue