I would like to perform the following operations from an Azure DevOps pipeline:
- Create new deployment slot for an existing WebApp (
staging
) - Deploy application to new slot
- Swap
staging
slot withproduction
- Delete former
production
, nowstaging
slot
What I have so far is:
- Deploy application to new slot
- Swap
staging
slot with production - Delete former
production
, nowstaging
slot
The YAML:
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'BizSpark(...)'
appType: 'webApp'
WebAppName: 'foo'
deployToSlotOrASE: true
ResourceGroupName: 'Default-WestEurope'
SlotName: 'staging'
packageForLinux: '$(Build.ArtifactStagingDirectory)/**/*.zip'
- task: AzureAppServiceManage@0
inputs:
azureSubscription: 'BizSpark(..)'
Action: 'Swap Slots'
WebAppName: 'foo'
ResourceGroupName: 'Default-WestEurope'
SourceSlot: 'staging'
- task: AzureAppServiceManage@0
inputs:
azureSubscription: 'BizSpark(..)'
Action: 'Delete Slot'
WebAppName: 'foo'
ResourceGroupName: 'Default-WestEurope'
Slot: 'staging'
However, AzureAppServiceManage
task does not provide a method to create a deployment slot.
How can this be done?