Azure / Azure/azure-functions-host
Feature - Azure portal function app pause button
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
#### What problem would the feature you're requesting solve? Please describe.
From within the Azure portal, I'd like to pause a function app for 30m, an hour, or maybe a few days.
Azure Functions is missing a button like this ...

_Above: Added a pause button with a user selectable dropdown of some pre-determined time intervals._
Oftentimes organizations need to pause an Azure functions execution for a set period of time. For instance, say your azure function has an external dependency (API) it calls on each run. If that dependency is down, your function app fails. Now, say that we know is "down for maintenance" for several hours. The only _current_ option we have for this is hard stopping the function and remembering to come back. Can we create a way where the function app is automatically re-enabled? Wouldn't it be more convenient if we could **pause** a function app for a set period of time?
I've thought _some_ about how an Azure Function could wake itself from a pause. One thing to try would be having that pause button using the Azure management backplane. For instance, clicking the pause button would call that backplane api to STOP the function app.
**STOP**
```bash
POST https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/sites//stop?api-version=2015-08-01
```
Simultaneously, it would lodge a queue message in it's storage account to turn itself back on. Sa y ... creating a queue message with a START command that only becomes visible X minutes from now.
**START**
```bash
POST https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/sites//start?api-version=2015-08-01
```
This could work right? Every Azure Function can be started and stopped via the right url, and every azure function has a storage account with a queue where we could log START messages.
#### Describe alternatives you've considered
Using a Logic App = https://stackoverflow.com/a/54885118/2048857
C# specific `[Disable()]` method attribute = https://docs.microsoft.com/en-us/azure/azure-functions/disable-function?tabs=portal#c-class-libraries
Note that this request is similar to feature request #7241 but without the explicit ask that azure functions gracefully wind down executions in flight. This ask is just for a scheduled stop and start after X minutes. Thanks!
Contributor guide
Research direction
The request targets an Azure portal pause button that calls the management API STOP and START endpoints, with a delayed storage-queue message for re-enabling the app. Start by checking whether this repository contains the portal or a scheduling entry point for those operations. Done would require an agreed design and an implemented, time-limited pause and resume flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100