Skip to content

Instantly share code, notes, and snippets.

@petevb
Last active November 13, 2019 10:18
Show Gist options
  • Save petevb/2de3f0a111054d18441c20e2ee6434f2 to your computer and use it in GitHub Desktop.
Save petevb/2de3f0a111054d18441c20e2ee6434f2 to your computer and use it in GitHub Desktop.
[AzDO Delete Staging Timer] This stops Functions running its overdue timers when you deploy to a staging slot. #AzDO #Azure #FunctionsApp #YAML

Delete Timers from Storage on Deployment to a Staging Slot.

This stops Functions running its overdue timers when you deploy to a staging slot. You need to define the variables, per the comment in the yaml.

AzDO Pipeline Task showing the delete task

The task is simple:

az storage blob delete-batch --account-name $(StorageAccount) --source azure-webjobs-hosts --pattern timers/$(AppServiceName)-staging/*

The delete task group in AzDO

#Your build pipeline references an undefined variable named ‘StorageAccount’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references an undefined variable named ‘AppServiceName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
steps:
- task: AzureCLI@1
displayName: 'Delete staging timers'
inputs:
azureSubscription: '******'
scriptLocation: inlineScript
inlineScript: 'az storage blob delete-batch --account-name $(StorageAccount) --source azure-webjobs-hosts --pattern timers/$(AppServiceName)-staging/*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment