How to deploy a blue deployment in an azure managed online endpoint while having a green deployment with 100% traffic allocation, and avoid downtime

Matias Larsson 125 Reputation points
2025-04-29T22:38:38.5+00:00

I have a green deployment with 100% traffic allocation, and I need to know how can I deploy a blue deployment to the same endpoint and not have the traffic in green set to 0% while blue is building up (this seems to be the default behaviour).

What I am currently doing is: After having the blue deployment ready for serving, I update the allocation to either {"blue": 0%, "green": 100%}, or to {"blue": 100%, "green": 0%}, but I cannot avoid the 2-4 mins downtime I get on the deployment that was serving traffic originally.

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,335 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pavankumar Purilla 8,335 Reputation points Microsoft External Staff Moderator
    2025-04-30T08:48:58.76+00:00

    Hi Matias Larsson,

    To deploy a blue deployment in an Azure Managed Online Endpoint while maintaining 100% traffic allocation to the existing green deployment without causing downtime, you need to explicitly create the blue deployment with zero traffic allocation. By default, if you create a new deployment (blue) without specifying traffic allocation, Azure will automatically adjust the traffic so that blue receives 100% of the traffic during its startup, which temporarily sets green to 0% and results in a brief service interruption. To avoid this, use the Azure CLI or SDK to create the blue deployment with --traffic-weight 0, ensuring that green continues serving all traffic while blue is being provisioned. Once the blue deployment is successfully created and healthy, you can test it in isolation using the azureml-model-deployment header in inference requests. After verifying that the blue deployment performs correctly, you can gradually shift traffic from green to blue (e.g., 90% green, 10% blue) or fully reallocate it (100% blue, 0% green) without any downtime. This safe rollout strategy allows seamless updates while maintaining service availability.
    For more information: az ml online-deployment.

    I hope this information helps. Thank you!

    1 person found this answer helpful.

0 additional answers

Sort by: Most 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.