Azure Functions and deployment slots

In a previous blog post I discussed deployment slots for Azure App Service.

A great way to be able to do A/B testing and to achieve zero-downtime deployments. However back then this didn't work for Azure Functions. The portal for Azure Functions was very much different from App Service and support for deployment slots was not fully implemented.

This screenshot is just from a couple of months ago, but still remember this one?

Old style Functions slot

One of the issues with Functions and deployment slots was that, although slots existed, there was no way to address individual slots or specify the percentage of traffic to flow through the Function in a particular slot. This effectivly blocked Functions from being used for A/B testing. In May 2020 the portal UI for Functions was aligned with App Service, but does that mean deployment slots also fully work now?

I've done a couple of tests and the sort answer is: yes!

Just like with App Service you can now create full featured deployment slots and split the traffic when you need to. Keep in mind in Consumption plan you can only create 1 deployment slot.

New Functions deployment slot

That in itself is not a big surprise however. Since the redesign, Azure Functions use the App Service platform for core functionality like deployments and configuration.

This means also the logic behind deployment slots has been aligned with App Service, so you can use x-ms-routing-name just like with App Service and also the behavior is exactly the same.

So no need to rewrite what I wrote on App Service and deployment slots. If you want to know how it works, please check out the post I mentioned at the start.

I'm very happy to see App Service and Functions now work the same way. Often you find them together in projects, so being able to use the same approach in testing is great!