How to manage Application version for VM's in Azure Autoscaling group

0 votes

I am running an application with autoscaled Azure VM. Let's suppose the current version of application is 1.0 is being served by 4 VM's as per the current load on application. Now, if I have a patch update and release a new version of application,i.e 2.0, then how will this new version of application updated to the currently VM's running? If load increases, and new VM gets started, they all will be having this new version of application 2.0, but the previously running 4 VM's, will they have this new version of application? And if yes, how? Can anyone solve my query?

Thanks

Apr 23, 2018 in DevOps on Cloud by Atul
• 10,240 points
78 views

1 answer to this question.

0 votes

First of all, You have to launch Azure VMSS from ARM Template which will be having Custom Image as Source Image instead of Image from Marketplace. If you want to update application on VMs, again create a Custom image of VM having updated application and then update this new VM in VMSS with Powershell. Azure VMSS then automatically update all VMs in Scale Set with updated Image. Below is the code for Updating existing VMSS with new Custom Image.

  $rgname = "myrg"
    $vmssname = "myvmss"
    # get the VMSS model
    $vmss = Get-AzureRmVmss -ResourceGroupName $rgname -VMScaleSetName $vmssname
    # set the new version in the model data
    $vmss.virtualMachineProfile.storageProfile.imageReference.id = $newImageReference
    # update the virtual machine scale set model
    Update-AzureRmVmss -ResourceGroupName $rgname -Name $vmssname -VirtualMachineScaleSet $vmss
    # now start updating instances
    Update-AzureRmVmssInstance -ResourceGroupName $rgname -VMScaleSetName $vmssname -InstanceId $instanceId
I hope this will work for you.

answered Apr 23, 2018 by shubham
• 6,890 points

Related Questions In DevOps on Cloud

0 votes
1 answer
0 votes
1 answer

How to control development/prod/staging application settings using azure functions?

You should use a build-release system like ...READ MORE

answered May 10, 2018 in DevOps on Cloud by ajs3033
• 7,280 points
314 views
0 votes
1 answer
0 votes
2 answers
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
1,032 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
207 views
+2 votes
3 answers

How do I deploy Scala PlayFramework Project to IBM Bluemix

It seems that they are more than ...READ MORE

answered Oct 18, 2018 in DevOps on Cloud by lina
• 8,110 points
123 views
0 votes
1 answer