Best practice for production deployments of API

jbassking 106 Reputation points
2019-12-02T21:23:50.967+00:00

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
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,151 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Mario 6 Reputation points
    2019-12-03T02:34:54.033+00:00

    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://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots

    Any questions, let me know.
    Kind regards,
    marionzr

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.