question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to disable all functions in a deployment slot?

See original GitHub issue

Is there a similar setting to WEBJOBS_STOPPED that can be turned on and it’ll disable all of your functions from running? My project is node based if that matters.

I’m trying to change my deployment process to use a deployment slot, auto swap, and zip push. I’d like to turn the functions off in the staging slot once this is working. I could setup a secondary storage account for the staging slot, but since this is just a deployment target for auto swap it’d be much easier to just turn them all off with a slot setting.

I also don’t want the old version of my functions running along side the production version post swap. For my web apps I set WEBJOBS_STOPPED to 1 in the staging slots but that didn’t seem to do anything for my functions app.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:12
  • Comments:24 (4 by maintainers)

github_iconTop GitHub Comments

23reactions
nbgyxicommented, Mar 18, 2020

In my opinion, all functions that are triggered automatically, like timer and queue, should be disabled by default, in the deployment slot.

I think it is quite common to use deployment slots like this:

  1. Deploy to deployment slot
  2. Warm up
  3. Swap with production

That brings your new and bug free code to production. Great.

You don’t want your buggy code still running in the deployment slot, causing errors that you thought you already solved.

9reactions
crowbarsolutionscommented, Mar 1, 2019

Edit: after some confusion I got the suggestion above to work. You need to disable each function in your staging slot individually. Once that is done, go into your staging slot’s application settings and notice that there are new settings listed, named AzureWebJobs.FunctionName.Disabled, one for each of your functions. You need to enable the “slot setting” checkbox next to each of those to make sure it is a slot-specific setting that doesn’t carry over when you swap.

Overall not the smoothest experience, and certainly prone to issues if functions are added or renamed. Would be nice if there was just a single application setting by convention that disabled all functions.

If I have a function app using mostly timer and queue triggered functions, should I even be using staging slots for my deployments? I don’t want my functions in the staging slot competing for timer trigger locks and queue message locks with my actual production code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable functions in Azure Functions
Navigate to the slot instance of your function app by selecting Deployment slots under Deployment, choosing your slot, and selecting Functions ...
Read more >
Azure Function - disable all the Functions in an app?
One can use app settings AzureWebJobs.<FUNCTION_NAME>.Disabled to disable individual Functions in an Azure Function. However, that of course ...
Read more >
Function app + Deployment slot + Timer triggered functions
Hello, We would like to deploy a function app that has timer-triggered functions. The function when triggered saves data to the Azure SQL ......
Read more >
Azure Deployment Slots: Benefits and How to Use Them
Azure deployment slots are one of the killer features for Azure App Services. Learn what they are, how to use them, and the...
Read more >
Continuous Deployment of Azure Functions with Slots
Tutorial for setting up Continuous Deployment of Azure Functions using deployment slots and auto swapping features on Microsoft Azure.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found