Skip to content

Switch-AzureRmWebAppSlot can't cancel a swap if the slot has been deleted [Need to support cancel Swap if a two phase swap is initiated] #3667

Closed
@AWahlqvist

Description

Cmdlet(s)

Switch-AzureRmWebAppSlot

PowerShell Version

5.1.14393.953

Module Version

AzureRM.WebSites 2.5.0

OS Version

Azure Automation/Windows 10

Description

Consider the following scenario:

  1. You create a new slot
  2. You initiate a swap with preview process (Switch-AzureRmWebAppSlot -SwapWithPreviewAction ApplySlotConfig)
  3. The new slot get's deleted for whatever reason

You know have a "lingering" swap process. You can run "Switch-AzureRmWebAppSlot -SwapWithPreviewAction ResetSlotSwap" but it has no effect whatsoever (doesn't throw any errors though). Doesn't matter if you create a new slot with the same name as the old one. It does work if you cancel the swap before deleting the slot.

As long as it is in this state, a new swap (ApplySlotConfig) can't be ran.

If you cancel the swap in the Azure portal however, it works as expected and everything get's reset. Feels like the cmdlet should have the same effect.

Debug Output

When attempting to run ApplySlotConfig again you get the following error:
"Cannot apply configuration from slot 'Production' because this slot has already been prepared for swap with slot ''."

Script/Steps for Reproduction

Create a new slot
New-AzureRmWebAppSlot

Initiate a swap with preview
Switch-AzureRmWebAppSlot -SwapWithPreviewAction ApplySlotConfig

Delete the slot
Remove-AzureRmWebAppSlot

Attempt to reset the ongoing swap
Switch-AzureRmWebAppSlot -SwapWithPreviewAction ResetSlotConfig

Create a new slot
New-AzureRmWebAppSlot

Initiate a swap with preview again, and it throws
Switch-AzureRmWebAppSlot -SwapWithPreviewAction ApplySlotConfig

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

App Servicesaka WebSitesService AttentionThis issue is responsible by Azure service team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions