question

jbassking-7863 avatar image
1 Vote"
jbassking-7863 asked jbassking-7863 published

Best practice for production deployments of API

Hi all!

I'm pretty new to Azure so please bare with me.
I have two current VMs, one for dev/qa and one for prod. Since we can't have any down time, what's the best way to deploy our latest builds?

I thought cloning the prod server, updating it, bringing it online, changing over the DNS and then taking the current one down after several hours to make sure the DNS change propagated would be the right way to go, however I ran into an issue if I do a capture on the prod server, it will get deallocated, which will cause down time which we cannot have.

Is there another way to do this? Should I add a load balancer and add/remove servers from that?

Am I using the wrong products for hosting our APIs and Website?

azure-virtual-machines
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

marionzr avatar image
1 Vote"
marionzr answered jbassking-7863 published

Hello jbassking-7863,

I'm provide my own experience with 2 scenarios that could help you.
The first uses two VMs in for production and one for QA (Each Dev has it own private VM). We use load balancer to keep the APIs always on, so when we stop our ASP.NET Core microservices in one machine to update, the balancer redirects the calls to the other machine. To speed-up the process, each machine as 2 environments, so we first deploy in the secondary environment and run some tests to make sure everything will run smoothly, the stop the services in the first environment and promote the second one as primary. We keep the environment one with the previous version so in case of a rollback we have everything set up.

The second approach, cheaper one, is having the QA and production VMs working as two environments. So, when we updated one machine with a new version, it first becomes the QA environment. When we are ready to go, we switch the proxy to redirection external requests to this machine. The, one that was working as the production stays in with previous version for shortime, then we update it with the new version and it free to be used as QA.

There also azure features that helps to promote apps easily. Take a look
https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots

Any questions, let me know.
Kind regards,
marionzr

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi marionzr, thanks for describing your process to me, it makes a lot of sense.

How would I handle creating a new image from the existing prod to create a second one?

I had followed these steps in part once but it seem like it's more complicated than I would think it needs to be.
https://www.techmanyu.com/how-to-quickly-clone-a-vm-in-azure/

When I was using 1 & 1 cloud, all I had to do was select a VM and click Clone and with a minute or so the new VM was up and running.

0 Votes 0 ·