Switch-AzureRmWebAppSlot

Swap two slots with a Web App

Caution

Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.

To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.

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
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
Accept pipeline input:False
Accept wildcard characters:False

-DestinationSlotName

Destination Slot Name

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

-Name

WebApp Name

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

-PreserveVnet

Preserve Vnet Boolean

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

-ResourceGroupName

Resource Group Name

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

-SourceSlotName

Source Slot Name

Type:String
Position:0
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False

-WebApp

WebApp Object

Type:PSSite
Position:0
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Site

Parameters: WebApp (ByValue)

Outputs

Void