1

To save memory in a development environment I would like to shutdown/stop a given deployment slot X time after a deployment has finished.

What is the best/easiest way to do that?

Rasmus
  • 2,783
  • 2
  • 33
  • 43

1 Answers1

0

You can use the Web jobs to call the Rest API to Stop the deployment slot and Start the Deployment slot. But currently no options for to stop the slot for specific time.

Stops an app (or deployment slot, if specified).

POST [https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop?api-version=2021-02-01]

Start an app (or deployment slot, if specified).

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start?api-version=2021-02-01

Slot:

Name of the deployment slot. If a slot is not specified, the API will stop the production slot.

Refer here

Or you can use the pipeline to stop the slot here

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15
  • Thanks for your reply - too bad there is not an option to schedule this to eg. 2 hours after a swap – Rasmus Nov 02 '21 at 21:13