output private ip of VM in azure ARM - azure

I am spinning up more than one Azure VM using copyindex() in ARM template. Here is the resource I am using :
{
"apiVersion": "[variables('apiVersion')]",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(parameters('vmDnsPrefixClientNode'),copyIndex(1))]",
"location": "[resourceGroup().location]",
"copy": {
"name": "virtualMachineLoop",
"count": "[parameters('vmInstancesClientNode')]"
},
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'),copyindex(1))]",
"[concat('Microsoft.Network/networkInterfaces/', parameters('vmDnsPrefixClientNode'),copyindex(1),'-nic')]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSizeClientNode')]"
},
"osProfile": {
"computername": "[concat(parameters('vmDnsPrefixClientNode'), copyIndex(1))]",
"adminUsername": "[parameters('username')]",
"adminPassword": "[parameters('password')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku": "[variables('ubuntuOSVersion')]",
"version": "latest"
},
"osDisk": {
"name": "osdisk1",
"vhd": {
"uri": "[concat('http://',variables('storageAccountName'),copyindex(1),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',parameters('vmDnsPrefixClientNode'),copyIndex(1),'-osdisk1.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
},
"dataDisks": [
{
"name": "datadisk1",
"diskSizeGB": "10",
"lun": 0,
"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'),copyindex(1)), variables('apiVersion')).primaryEndpoints.blob, variables('vmDataContainerName'),'/',parameters('vmDnsPrefixClientNode'),copyIndex(1),'-',variables('dataDisk1VhdName'),'.vhd')]"
},
"createOption": "Empty"
}
]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(parameters('vmDnsPrefixClientNode'),copyindex(1),'-nic'))]"
}
]
}
}
},
I tried something like this, which isn't working
"outputs": {
"privateIP": {
"value": "[reference(concat(parameters('vmDnsPrefixClientNode'),copyindex(1),'-nic'),providers('Microsoft.Network', 'privateIPAddresses').apiVersions[0]).dnsSettings.fqdn]",
"type": "string",
"copy": {
"name": "vmNic",
"count": "[parameters('vmInstancesClientNode')]"
}
}
}
anyone knows how to get private IP or internal FQDN in output ?

I have used the following code in my template to get the private ip address from network interface.
"outputs":{
"networkInterface":{
"value": "[reference(resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName')),'2016-09-01')]",
"type": "object"
}
}
Once you get the output, then you can find the IP address at
outputs.networkInterface.value.ipConfigurations[0].properties.privateIPAddress
and dns suffix at
outputs.networkInterface.value.dnsSettings.internalDomainNameSuffix

Related

How to get ResourceId as output for VM when using copyIndex

I use copyIndex(0) to create several virtualMachine resources (along with publicIP addresses, nic...)
I need the resourceID as output from the deployment for further processing. Usually I do this with the resourceId() function, but since the names are dynamic and copyIndex is not valid in outputs section, I can't figure out the proper syntax for this:
{
"code": "DeploymentOutputEvaluationFailed",
"message": "Unable to evaluate template outputs: 'resourceID'. Please see error details and deployment operations. Please see https://aka.ms/arm-debug for usage details.",
"details": [
{
"code": "DeploymentOutputEvaluationFailed",
"target": "resourceID",
"message": "The template output 'resourceID' is not valid: The template function 'copyIndex' is not expected at this location. The function can only be used in a resource with copy specified. Please see https://aka.ms/arm-copy for usage details.."
}
]
}
I guess I need to change resourceID to array, but what is the proper syntax for fetching the resourceId of the dynamically created VMs?
Full ARM template below:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualMachineNamePrefix": {
"type": "string"
},
"virtualMachineSize": {
"type": "string"
},
"virtualMachineCount": {
"type": "int"
},
"adminUsername": {
"type": "string"
},
"adminPassword": {
"type": "secureString"
}
},
"variables": {
"resourceGroupName": "[toLower(ResourceGroup().name)]",
"location": "[resourceGroup().location]",
"networkSecurityGroupName": "[concat(variables('resourceGroupName'), '-nsg')]",
"nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]",
"subnetName": "default",
"virtualNetworkId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', ResourceGroup().name, '/providers/Microsoft.Network/virtualNetworks/', variables('resourceGroupName'), '-vnet')]",
"operatingSystem": "Server2016",
"operatingSystemValues": {
"Server2016": {
"PublisherValue": "MicrosoftWindowsServer",
"OfferValue": "WindowsServer",
"SkuValue": "2016-Datacenter"
}
},
"subnetRef": "[concat(variables('virtualNetworkId'), '/subnets/', variables('subnetName'))]"
},
"resources": [
{
"apiVersion": "2016-03-30",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[concat(parameters('virtualMachineNamePrefix'), copyIndex(0), '-ip')]",
"location": "[variables('location')]",
"copy": {
"name": "PIPCopy",
"count": "[parameters('virtualMachineCount')]"
},
"tags": {
"displayName": "[concat(parameters('virtualMachineNamePrefix'), copyIndex(0), '-ip')]"
},
"properties": {
"publicIPAllocationMethod": "Dynamic"
}
},
{
"name": "[concat(parameters('virtualMachineNamePrefix'), copyIndex(0), '-nic')]",
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2016-03-30",
"location": "[variables('location')]",
"copy": {
"name": "NICCopy",
"count": "[parameters('virtualMachineCount')]"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIpAddresses/', parameters('virtualMachineNamePrefix'), copyIndex(0), '-ip')]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', concat(parameters('virtualMachineNamePrefix'), copyIndex(0), '-ip'))]"
},
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
],
"networkSecurityGroup": {
"id": "[variables('nsgId')]"
}
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(parameters('virtualMachineNamePrefix'), copyIndex(0))]",
"apiVersion": "2017-03-30",
"location": "[variables('location')]",
"identity": {
"type": "SystemAssigned"
},
"copy": {
"name": "VMcopy",
"count": "[parameters('virtualMachineCount')]"
},
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('virtualMachineSize')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('operatingSystemValues')[variables('operatingSystem')].PublisherValue]",
"offer": "[variables('operatingSystemValues')[variables('operatingSystem')].OfferValue]",
"sku": "[variables('operatingSystemValues')[variables('operatingSystem')].SkuValue]",
"version": "latest"
},
"osDisk": {
"name": "[concat(parameters('virtualMachineNamePrefix'),copyIndex(0), '-disk')]",
"createOption": "FromImage",
"managedDisk": {
"storageAccountType": "Premium_LRS"
},
"caching": "ReadWrite"
}
},
"osProfile": {
"computerName": "[concat(parameters('virtualMachineNamePrefix'),copyIndex(0))]",
"adminUsername": "[parameters('adminUsername')]",
"windowsConfiguration": {
"provisionVMAgent": true
},
"secrets": [],
"adminPassword": "[parameters('adminPassword')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', concat(parameters('virtualMachineNamePrefix'), copyIndex(0), '-nic'))]"
}
]
}
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('virtualMachineNamePrefix'), copyIndex(0), '-nic')]"
]
}
],
"outputs": {
"resourceID": {
"type": "string",
"value": "[resourceId('Microsoft.Network/networkInterfaces', concat(parameters('virtualMachineNamePrefix'), copyIndex(0)))]"
}
}
}
UPDATE:
Thanks # 4c74356b41 for a working answer:
"copy": [
{
"name": "resources",
"count": "[parameters('virtualMachineCount')]",
"input": {
"id": "[resourceId('Microsoft.Compute/virtualMachines', concat(parameters('virtualMachineNamePrefix'), copyIndex('resources')))]"
}
}
]
probably use a variable and output it?
"variables": {
"copy": [
{
"name": "resources",
"count": "[parameters('virtualMachineCount')]"
"input": {
"id": "[resourceId('Microsoft.Network/networkInterfaces', concat(parameters('virtualMachineNamePrefix'), copyIndex('resources')))]"
}
}
]
}
and just use that var:
"outputs": {
"resourceID": {
"type": "array",
"value": "[variables('resources')]"
}
}
update: I've just noticed your comment in one of the previous answers, so I'm not sure if this answer is what you are looking for, if not - tell me in the comments what you are after exactly, since I'm a bit confused.

ARM- VMSS Output private ips of all instances

Im looking for a way to output all private ips of VMSS using outputs section in the ARM into an array. I have done a similar exercise to get public ip for a VM using the network interface ref [reference(variables('pipname')).ipAddress] and it worked, but here in VMSS since we do not have a NIC instance created, i'm not sure what object i need to reference. I looked online for documentation but could not find any. Please point me in the right direction. This is what i'm using
"variables": {
"appGatewayBackendPool": "appGatewayBackendPool",
"privateip": "/subscriptions/d6f9c1f8-f319-4a65-a590-86acc53e6e18/resourceGroups/maz-cac-iac-dal-gg-rg/providers/Microsoft.Compute/virtualMachineScaleSets/mazcaciacggapp/virtualMachines/networkInterfaces/mazcaciacggapp-nic"
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"name": "[concat(parameters('vmssName'))]",
"location": "[resourceGroup().location]",
"apiVersion": "2017-03-30",
"sku": {
"name": "[parameters('vmSku')]",
"capacity": "[parameters('instanceCount')]"
},
"properties": {
"overprovision": true,
"upgradePolicy": {
"mode": "Manual"
},
"virtualMachineProfile": {
"storageProfile": {
"osDisk": {
"createOption": "FromImage",
"caching": "[parameters('osDiskCaching')]",
"managedDisk": {
"storageAccountType": "[parameters('osDiskStorageType')]"
}
},
"dataDisks": [
{
"lun": 0,
"createOption": "Empty",
"caching": "[parameters('dataDiskCaching')]",
"diskSizeGB": "[parameters('vmssDataDisk1Size')]",
"managedDisk": {
"storageAccountType": "[parameters('dataDiskStorageType')]"
}
},
{
"lun": 1,
"createOption": "Empty",
"caching": "[parameters('dataDiskCaching')]",
"diskSizeGB": "[parameters('vmssDataDisk2Size')]",
"managedDisk": {
"storageAccountType": "[parameters('dataDiskStorageType')]"
}
}
],
"imageReference": {
"publisher": "[parameters('imageReference.publisher')]",
"offer": "[parameters('imageReference.offer')]",
"sku": "[parameters('imageReference.sku')]",
"version": "[parameters('imageReference.version')]"
}
},
"osProfile": {
"computerNamePrefix": "[parameters('vmssName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "[concat(parameters('vmssName'), '-nic')]",
"properties": {
"primary": true,
"ipConfigurations": [
{
"name": "[concat(parameters('vmssName'), '-ipconfig')]",
"properties": {
"subnet": {
"id": "[resourceId(parameters('vnetResourceGroupName'),'Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"
},
"ApplicationGatewayBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/applicationGateways/', parameters('appGatewayName'), '/backendAddressPools/', variables('appGatewayBackendPool'))]"
}
]
}
}
]
}
}
]
}
}
}
}
],
"outputs": {
"privateips": {
"type": "object",
"value": "[variables('privateip').IpConfigurations.PrivateIpAddress]",
}
}
}
resolved: used a powershell task in azure pipelines and set the ips as pipeline varibales

How to create Azure VM with Public IP address through REST API

how to I create a Azure VM with a public IP address using requests through there API. This is the current request body but I dont know what I need to add to have the VM have an public IP address - Thanks
{
"location": "ukwest",
"properties": {
"hardwareProfile": {
"vmSize": "Standard_B1s"
},
"storageProfile": {
"imageReference": {
"id": "/subscriptions/28f23ba2-c344-448c-808b-e45a97a29764/resourceGroups/main/providers/Microsoft.Compute/images/ukproxy"
},
"osDisk": {
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"name": "myVMosdisk",
"createOption": "FromImage"
}
},
"osProfile": {
"adminUsername": "user",
"computerName": "user",
"adminPassword": "password!"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/28f23ba2-c344-448c-808b-e45a97a29764/resourceGroups/main/providers/Microsoft.Network/networkInterfaces/nic",
"properties": {
"primary": true
}
}
]
}
},
"name": "VM"
}
The public IP just associate to the network interface. So you do not need to worry about the public IP when you create the VM. All the thing you have to do is create the public IP and associate it to your interface which belongs to the VM.
For example, the request body when you create the network interface will like this:
{
"name": "test-nic",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic",
"location": "eastus",
"properties": {
"provisioningState": "Succeeded",
"ipConfigurations": [
{
"name": "ipconfig1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1",
"properties": {
"provisioningState": "Succeeded",
"privateIPAddress": "172.20.2.4",
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip"
},
"subnet": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default"
},
"primary": true,
"privateIPAddressVersion": "IPv4"
}
}
],
"dnsSettings": {
"dnsServers": [],
"appliedDnsServers": []
},
"enableAcceleratedNetworking": true,
"enableIPForwarding": false
},
"type": "Microsoft.Network/networkInterfaces"
}

Addition of a managed disk to a VM with blob based disks is not supported

I am trying to deploy VM from managed image and data disk using the following with the API version "2015-06-15" for the VM. I am unable to attach the data disk to the VM when I run below ARM template. I tried the preview as well but the preview API version doesn't support the storage account. I have commented on the same while trying the preview API version and latest version.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"customVmName": {
"type": "string",
"metadata": {
"description": "This is the name of the your VM"
}
},
"osDiskVhdUri": {
"type": "string",
"metadata": {
"description": "Uri of the your user image"
}
},
"adminUserName": {
"type": "string",
"metadata": {
"description": "User Name for the Virtual Machine"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine"
}
},
"userImageStorageAccountName": {
"type": "string",
"metadata": {
"description": "This is the name of the your storage account"
}
},
"osType": {
"type": "string",
"allowedValues": [
"Windows",
"Linux"
],
"metadata": {
"description": "This is the OS that your VM will be running"
}
},
"vmSize": {
"type": "string",
"metadata": {
"description": "This is the size of your VM"
}
},
"ExistingVnet": {
"allowedValues": [ "new", "existing" ],
"type": "string",
"metadata": {
"description": "Select if this template needs a new VNet or will reference an existing VNet"
}
},
"ExistingVnetName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "New or Existing VNet Name"
}
},
"ExistingSubnetName": {
"type": "string",
"defaultValue": "subnet",
"metadata": {
"description": "Subnet Name"
}
},
"existingdiagnosticsStorageAccountName": {
"type": "string"
}
},
"variables": {
"vmName": "[parameters('customVmName')]",
"nicName": "[parameters('customVmName')]",
"apiVersion": "2015-06-15",
"vnetID": "[resourceId('ISE-MarkW', 'Microsoft.Network/virtualNetworks', parameters('ExistingVnetName'))]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/', parameters('ExistingSubnetName'))]",
},
"resources": [
{
"apiVersion": "2016-06-01",
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"location": "[resourceGroup().location]",
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
]
}
},
{
"type": "Microsoft.Compute/disks",
"name": "[concat(variables('vmName'),'-datadisk1')]",
"apiVersion": "2017-03-30",
"location": "[resourceGroup().location]",
"sku": {
"name": "Premium_LRS"
},
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 128
}
},
{
"apiVersion": "[variables('apiVersion')]",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('vmName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]",
"[resourceId('Microsoft.Compute/disks/', concat(variables('vmName'),'-datadisk1'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"osDisk": {
"name": "[concat(variables('vmName'),'-osDisk')]",
"osType": "[parameters('osType')]",
"caching": "ReadWrite",
"createOption": "FromImage",
"image": {
"uri": "[parameters('osDiskVhdUri')]"
},
"vhd": {
"uri": "[concat(reference(concat('/subscriptions/xxxx/resourceGroups/inflabimages-rg/providers/Microsoft.Storage/storageAccounts/', parameters('userImageStorageAccountName')), variables('apiVersion')).primaryEndpoints.blob, 'vhds/',variables('vmName'), uniquestring(resourceGroup().id), 'osDisk.vhd')]"
}
},
"dataDisks": [
{
"lun": 0,
"name": "[concat(variables('vmName'),'-datadisk1')]",
"createOption": "Attach",
"managedDisk": {
"id": "[resourceId('Microsoft.Compute/disks/', concat(variables('vmName'),'-datadisk1'))]"
},
"caching": "ReadWrite"
}
]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat('http://', parameters('existingdiagnosticsStorageAccountName'), '.blob.core.windows.net')]"
}
}
}
}
]
}
I am getting VM deployment failed below message
"error": {
"code": "OperationNotAllowed",
"message": "Addition of a managed disk to a VM with blob based disks is not supported.",
"target": "dataDisk"
}
you are not using managed disk for OS disk, sample for managed disk with data disks:
"imageReference": {
"id": "[resourceId('Microsoft.Compute/images', variables('imageName'))]"
},
"osDisk": {
"createOption": "FromImage",
"managedDisk": {
"storageAccountType": "Standard_LRS"
}
},
"dataDisks": [
{
"lun": 2,
"createOption": "Empty",
"caching": "None",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"diskSizeGB": 128
}
]
I was able to attach the data disk by using image reference instead of using the VHD URI with API version 2018-06-01.
{
"apiVersion": "[variables('apiVersion')]",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('vmName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]",
"[resourceId('Microsoft.Compute/disks/', concat(variables('vmName'),'-datadisk1'))]"
],
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets', parameters('availabilitySets_name'))]"
},
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"imageReference": {
"id": "[parameters('virtualMachines_image')]"
},
"osDisk": {
"name": "[concat(variables('vmName'),'-osDisk')]",
"osType": "[parameters('osType')]",
"caching": "ReadWrite",
"createOption": "FromImage",
"managedDisk": {
"storageAccountType":"Premium_LRS"
}
},
"dataDisks": [
{
"lun": 1,
"name": "[concat(variables('vmName'),'-datadisk1')]",
"createOption": "Attach",
"managedDisk": {
"id": "[resourceId('Microsoft.Compute/disks/', concat(variables('vmName'),'-datadisk1'))]",
"storageAccountType":"Premium_LRS"
},
"caching": "None"
}
]
},

Azure Linux VM Template - Parameter osProfile not allowed but without I can't connect

I created a VM manually in Azure then used the automation script to generate a template to use from Visual Studio for a deployment however when I try to deploy it everything else works bar the VM which complains about the osProfile parameter, If I remove the osProfile section the deployment works but creates a VM I have no way to login to, all the examples I find say the osProfile I have should be fine so I'm a bit stuck
The template attached only works when the osProfile is commented out and then you can't login to the VM
Appreciate any suggestions as I've tried all sorts and am stumped now!
This is the error when the osProfile is included:
08:58:16 - Template deployment returned the following errors:
08:58:16 - 08:58:15 - Resource Microsoft.Compute/virtualMachines 'TheFaireyDevSolr' failed with message '{
08:58:16 - "error": {
08:58:16 - "code": "InvalidParameter",
08:58:16 - "target": "osProfile",
08:58:16 - "message": "Parameter 'osProfile' is not allowed."
08:58:16 - }
08:58:16 - }'
I updated the Password parameter to something more complex that I know meets the min reqs.
Below is the template json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "User name for the Virtual Machine."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
},
"disks_TheFaireyDevSolrDataDisk_name": {
"type": "string"
},
"disks_TheFaireyDevSolrOsDisk_name": {
"type": "string"
},
"virtualMachines_TheFaireyDevSolr_name": {
"type": "string"
},
"networkInterfaces_thefaireydevsolr_ni_name": {
"type": "string"
},
"networkSecurityGroups_TheFaireyDevSolr_nsg_name": {
"type": "string"
},
"publicIPAddresses_TheFaireyDevSolr_ip_name": {
"type": "string"
},
"virtualNetworks_TheFaireyDev_vnet_name": {
"type": "string"
},
"storageAccounts_thefaireydevmainstorage_name": {
"type": "string"
},
"extensions_Microsoft.Insights.VMDiagnosticsSettings_name": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.Compute/disks",
"name": "[parameters('disks_TheFaireyDevSolrDataDisk_name')]",
"apiVersion": "2016-04-30-preview",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"accountType": "Standard_LRS",
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 32
},
"dependsOn": []
},
{
"type": "Microsoft.Compute/disks",
"name": "[parameters('disks_TheFaireyDevSolrOsDisk_name')]",
"apiVersion": "2016-04-30-preview",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"accountType": "Standard_LRS",
"osType": "Linux",
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/<YOUR SUBSCRIPTION ID>/Providers/Microsoft.Compute/Locations/uksouth/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/17.04/Versions/latest"
}
},
"diskSizeGB": 30
},
"dependsOn": []
},
{
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('virtualMachines_TheFaireyDevSolr_name')]",
"apiVersion": "2016-04-30-preview",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"hardwareProfile": {
"vmSize": "Standard_A1_v2"
},
"storageProfile": {
"osDisk": {
"osType": "Linux",
"name": "[parameters('disks_TheFaireyDevSolrOSDisk_name')]",
"createOption": "Attach",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "[resourceId('Microsoft.Compute/disks', parameters('disks_TheFaireyDevSolrOsDisk_name'))]"
},
"diskSizeGB": 30
},
"dataDisks": [
{
"lun": 0,
"name": "[concat(parameters('virtualMachines_TheFaireyDevSolr_name'),'DataDisk')]",
"createOption": "Attach",
"caching": "None",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "[resourceId('Microsoft.Compute/disks', parameters('disks_TheFaireyDevSolrDataDisk_name'))]"
},
"diskSizeGB": 32
}
]
},
"osProfile": {
"computerName": "[parameters('virtualMachines_TheFaireyDevSolr_name')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_thefaireydevsolr_ni_name'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat('https', '://', parameters('storageAccounts_thefaireydevmainstorage_name'), '.blob.core.windows.net', '/')]"
}
}
},
"dependsOn": [
"[resourceId('Microsoft.Compute/disks', parameters('disks_TheFaireyDevSolrOsDisk_name'))]",
"[resourceId('Microsoft.Compute/disks', parameters('disks_TheFaireyDevSolrDataDisk_name'))]",
"[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaces_thefaireydevsolr_ni_name'))]",
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_thefaireydevmainstorage_name'))]"
]
},
{
"type": "Microsoft.Network/networkInterfaces",
"name": "[parameters('networkInterfaces_thefaireydevsolr_ni_name')]",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAddress": "10.0.0.4",
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_TheFaireyDevSolr_ip_name'))]"
},
"subnet": {
"id": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_TheFaireyDev_vnet_name')), '/subnets/default')]"
}
}
}
],
"dnsSettings": {
"dnsServers": []
},
"enableIPForwarding": false,
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_TheFaireyDevSolr_nsg_name'))]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_TheFaireyDevSolr_ip_name'))]",
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_TheFaireyDev_vnet_name'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_TheFaireyDevSolr_nsg_name'))]"
]
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[parameters('networkSecurityGroups_TheFaireyDevSolr_nsg_name')]",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"securityRules": [
{
"name": "default-allow-ssh",
"properties": {
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "22",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 1000,
"direction": "Inbound"
}
}
]
},
"dependsOn": []
},
{
"type": "Microsoft.Network/publicIPAddresses",
"name": "[parameters('publicIPAddresses_TheFaireyDevSolr_ip_name')]",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"publicIPAllocationMethod": "Dynamic",
"idleTimeoutInMinutes": 4
},
"dependsOn": []
},
{
"type": "Microsoft.Network/virtualNetworks",
"name": "[parameters('virtualNetworks_TheFaireyDev_vnet_name')]",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/24"
]
},
"subnets": [
{
"name": "default",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
}
],
"virtualNetworkPeerings": []
},
"dependsOn": []
},
{
"type": "Microsoft.Storage/storageAccounts",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "Storage",
"name": "[parameters('storageAccounts_thefaireydevmainstorage_name')]",
"apiVersion": "2016-01-01",
"location": "[resourceGroup().location]",
"tags": {},
"scale": null,
"properties": {},
"dependsOn": []
},
//{
// "type": "Microsoft.Compute/virtualMachines/extensions",
// "name": "[parameters('extensions_Microsoft.Insights.VMDiagnosticsSettings_name')]",
// "apiVersion": "2016-04-30-preview",
// "location": "[resourceGroup().location]",
// "scale": null,
// "properties": {
// "publisher": "Microsoft.OSTCExtensions",
// "type": "LinuxDiagnostic",
// "typeHandlerVersion": "2.3",
// "autoUpgradeMinorVersion": true,
// "settings": {
// "xmlCfg": "PFdhZENmZz48RGlhZ25vc3RpY01vbml0b3JDb25maWd1cmF0aW9uIG92ZXJhbGxRdW90YUluTUI9IjQwOTYiPjxEaWFnbm9zdGljSW5mcmFzdHJ1Y3R1cmVMb2dzIHNjaGVkdWxlZFRyYW5zZmVyUGVyaW9kPSJQVDFNIiBzY2hlZHVsZWRUcmFuc2ZlckxvZ0xldmVsRmlsdGVyPSJXYXJuaW5nIi8+PFBlcmZvcm1hbmNlQ291bnRlcnMgc2NoZWR1bGVkVHJhbnNmZXJQZXJpb2Q9IlBUMU0iPjxQZXJmb3JtYW5jZUNvdW50ZXJDb25maWd1cmF0aW9uIGNvdW50ZXJTcGVjaWZpZXI9IlxNZW1vcnlcQXZhaWxhYmxlTWVtb3J5IiBzYW1wbGVSYXRlPSJQVDE1UyIgdW5pdD0iQnl0ZXMiPjxhbm5vdGF0aW9uIGRpc3BsYXlOYW1lPSJNZW1vcnkgYXZhaWxhYmxlIiBsb2NhbGU9ImVuLXVzIi8+PC9QZXJmb3JtYW5jZUNvdW50ZXJDb25maWd1cmF0aW9uPjxQZXJmb3JtYW5jZUNvdW50ZXJDb25maWd1cmF0aW9uIGNvdW50ZXJTcGVjaWZpZXI9IlxNZW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U0iLz48L01ldHJpY3M+PC9EaWFnbm9zdGljTW9uaXRvckNvbmZpZ3VyYXRpb24+PC9XYWRDZmc+"
// },
// "protectedSettings": {}
// },
// "dependsOn": [
// "[resourceId('Microsoft.Compute/virtualMachines', parameters('virtualMachines_TheFaireyDevSolr_name'))]"
// ]
//}
],
"variables": {}
}
and the parameters json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"value": "thefairey"
},
"disks_TheFaireyDevSolrDataDisk_name": {
"value": "TheFaireyDevSolrDataDisk"
},
"disks_TheFaireyDevSolrOsDisk_name": {
"value": "TheFaireyDevSolrOsDisk"
},
"virtualMachines_TheFaireyDevSolr_name": {
"value": "TheFaireyDevSolr"
},
"networkInterfaces_thefaireydevsolr_ni_name": {
"value": "TheFaireyDevSolr-ni"
},
"networkSecurityGroups_TheFaireyDevSolr_nsg_name": {
"value": "TheFaireyDevSolr-nsg"
},
"publicIPAddresses_TheFaireyDevSolr_ip_name": {
"value": "TheFaireyDevSolr-ip"
},
"virtualNetworks_TheFaireyDev_vnet_name": {
"value": "TheFaireyDev-vnet"
},
"storageAccounts_thefaireydevmainstorage_name": {
"value": "thefaireydevmainstorage"
},
"extensions_Microsoft.Insights.VMDiagnosticsSettings_name": {
"value": "TheFaireyDevSolr/Microsoft.Insights.VMDiagnosticsSettings"
}
}
}
UPDATE
I started with a plain Ubuntu VM template from VS and started adding stuff and the problem regarding the osProfile starts happening as soon as I try to add a Managed Disk as the OS disk, I removed that but tried with a managed disk for the DataDisk and got the error "Addition of a managed disk to a VM with blob based disks is not supported"
Not sure if it helps but I believe the issue may be related to having a Managed Disk as the OS disk. Will continue to research and experiment!
Ok worked it out, the automation script I guess isn't quite up to speed with Managed Disks which is fair enough as they are in preview, when I ran it it created a separate resource for the OS Managed disk.
In order to have a managed disk as the OS disk you need to define the storageProfile as follows:
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku": "[parameters('ubuntuOSVersion')]",
"version": "latest"
},
"osDisk": {
"osType": "Linux",
"name": "YourOSDiskName",
"createOption": "FromImage",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"diskSizeGB": 32
},
}
The important thing is that you don't need to define the managed disk as a separate resource, it appears the VM creation handles creation of the Managed disk resource and you just need to specify the storageAccountType for the disk.
After that everything appears to work correctly.
Trying to Attach a previously defined Managed Disk based on an OS image and specifying the id parameter in the managedDisk settings in the VM doesn't appear to work.
Hope this helps someone!
osProfile is required if the VHD is sysprepped & generalized - meaning when it starts you want to run through first time setup. If the image is not generalized then you can't specify the osProfile (e.g. user/pass) because it already exists.
re: ManagedDisks - you can use an implicit disk or explicit. If you wanted to use one of your own disk images your storageProfile would be:
"storageProfile": {
"imageReference": {
"id": "[parameters('imageResourceId')]"
}
}
If you want to use your own disk (say, created from a snapshot) you would use:
"storageProfile": {
"osDisk": {
"osType": "[parameters('osType')]",
"name": "[parameters('managedOsDiskName')]",
"createOption": "Attach",
"managedDisk": {
"id": "[resourceId('Microsoft.Compute/disks', parameters('managedOsDiskName'))]"
},
"caching": "ReadWrite"
}
}
There are a lot of options available w/ managed disks... This doc isn't perfect but does help.

Resources