Switch-AzureRmWebAppSlot

Swap two slots with a Web App

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Switch-AzureRmWebAppSlot
      [-SourceSlotName] <String>
      [[-DestinationSlotName] <String>]
      [[-SwapWithPreviewAction] <SwapWithPreviewAction>]
      [[-PreserveVnet] <Boolean>]
      [-ResourceGroupName] <String>
      [-Name] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Switch-AzureRmWebAppSlot
      [-SourceSlotName] <String>
      [[-DestinationSlotName] <String>]
      [[-SwapWithPreviewAction] <SwapWithPreviewAction>]
      [[-PreserveVnet] <Boolean>]
      [-WebApp] <PSSite>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Switch-AzureRmWebAppSlot switches two slots associated with an Azure Web App.

Examples

Example 1

PS C:\> Switch-AzureRmWebAppSlot -SourceSlotName "sourceslot" -DestinationSlotName "destinationslot" -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp"

This command will switch slot "sourceslot" slot with "destinationslot" for Web App ContosoWebApp associated with the resource group Default-Web-WestUS

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DestinationSlotName

Destination Slot Name

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

WebApp Name

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PreserveVnet

Preserve Vnet Boolean

Type:Nullable<T>[Boolean]
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Resource Group Name

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SourceSlotName

Source Slot Name

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SwapWithPreviewAction

Swap With Preview Action

Type:Nullable<T>[SwapWithPreviewAction]
Accepted values:ApplySlotConfig, CompleteSlotSwap, ResetSlotSwap
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WebApp

WebApp Object

Type:PSSite
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Site

Parameters: WebApp (ByValue)

Outputs

Void