Search code examples
amazon-web-servicesamazon-ec2azure-devops

Combining Azure Devops and AWS AutoScaling


What are best practices to deploy from Azure Pipeline to pool of AWS Autoscaling instances?

Our current configuration:

  • ELB and few stateless app servers
  • Azure Agent on each server (single deployment group)
  • Pipeline deploy new app to deployment group one by one

Here are couple of challenges I know (probably, there are also some things to discover) which confuses me:

  1. Autoscaling group needs an AMI. In theory it is possible to create a CLI process to create AMI from one of instances, but how can I prevent specific instance from deletion?

  2. Multiple Azure Deployment Agents with same configuration looks like single server in deployment group. Provided release happens during peak hour and we scaled from 2 to 4 I have no control over which of instance actually received update, thus I will not know which instance should be used as a source for AMI.


Solution

  • So, here is a correct strategy how to deploy to AWS from Azure Devops

    1. Azure Devops builds artifact
    2. Calls Code deploy job to deploy it to aws
    3. Code deploy ec2 application known ELB target group and austoscaling group
    4. Once autoscaling kicks in it calls code deploy for new instance automatically, which downloads fresh artifact from S3