Octopus Deploy On Azure VMSS


(Satish Y) #1

Hi Team,

We used to deploy out 10 applications on Azure VM as IIS applications using Octopus.

Now we want to deploy these applications on Azure VM Scale Set, I just wondering if we have any plugin to do this or any other method is there, also wan to know when new system spin up through VMSS how Octopus will deploy these 10 applications on new VM IIS application physical slots.

Regards,
Satish


Octopus Deployment to Azure VM Scale Set
(Mark Siedle) #3

Hi Satish,

Thanks for getting in touch.

When thinking about load-balancing (or cloud-based auto-scaling like Azure VMSS), Automation Deployment Triggers can help.

For example, in your project, you could setup a Deployment Target Project Trigger, filtering on the “Machine becomes available for deployment” event group (and matching whatever roles/environments you’re expecting for these VMs).

Then, as your Azure VMSS adds new VMs and they register their Tentacles with your Octopus Server, Octopus knows to deploy the latest successful release to that new deployment target for that project.

Hope this helps.

Cheers
Mark


(Satish Y) #4

Hi Mark,

Thanks for your reply.

I got to know that how we can deploy latest code using trigger.

I am facing an issue while installing the Octopus DSC along with VMSS using ARM template.

I followed below link to install the tentacle, I downloaded latest OctopusDSC repo and I created OctopusTentacle.ps1 script and placed next to extracted OctopusDSC folder and then zipped both and placed on Azure blob.

While running the ARM template it is not able to find OctopusTentacle.ps1 script file under the below location from VM launched.

C:/Packages/Plugins/Microsoft.Powershell.DSC/2.77.0.0/DSCWork/OctopusDsc.1

Please find my script and zip file calling from Azure blob.

Please let me know if I miss any configuration here.

Regards,
Satishtemplate.json (19.0 KB)
OctopusTentacle.zip (113.4 KB)


(Mark Siedle) #5

Hi Satish,

Thanks for the additional information.

One thing that stood out is the contents of your OctopusTentacle.zip file. It contains a sub-folder called OctopusTentacle.

I.e. OctopusTentacle.zip contains:

  • OctopusTentacle
    – OctopusDSC
    – OctopusTentacle.ps1

Whereas those files need to be in the root of the zip file, so OctopusTentacle.zip contains just these:

  • OctopusDSC
  • OctopusTentacle.ps1

Could you please remake your zip file so those sit in the root of the zip file and try again?

Cheers
Mark


(Satish Y) #6

Hi Mark,

Thanks for your help, Octopus trigger worked well and when ever new tentacle added it deployed the all applications.

I just wondering one thing that when any tentacle instance became terminated from VMSS how we can remove that from Octopus server automatically.

Regards,
Satish


(Mark Siedle) #7

Hi Satish,

That’s great news, well done :slight_smile:

Re. Removing targets: One approach is to script the removal of the machine manually (using our REST API), as your VM is being torn down / terminated. This way you keep Azure and Octopus in sync.

You could also consider an Azure Automation account and look at using the OctoPosh PowerShell module (specifically the Remove-OctopusResource cmdlet).

For a full walkthrough of that, there was an article posted recently (early 2018) by another customer looking to do just this: https://mathieubuisson.github.io/trigger-octopus-removal-azure/

While they’re not targeting AzureVMSS specifically, he does mention how to achieve this in the comments, so hopefully that sets you on the right track.

Let me know how you go.

Cheers
Mark


(Satish Y) #8

Hi Mark,

Thanks for sharing details, I will go through them and try to implement.

I will get back to you if I require some thing from your end.

Regards,
Satish