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
stagingslot withproduction - Delete former
production, nowstagingslot
What I have so far is:
- Deploy application to new slot
- Swap
stagingslot with production - Delete former
production, nowstagingslot
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?