Restore-AzureRmWebAppSnapshot

Restores a web app snapshot.

Important

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

Restore-AzureRmWebAppSnapshot
       [-RecoverConfiguration]
       [-Force]
       [-AsJob]
       [-ResourceGroupName] <String>
       [-Name] <String>
       [[-Slot] <String>]
       [-DefaultProfile <IAzureContextContainer>]
       [-InputObject] <AzureWebAppSnapshot>
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restore-AzureRmWebAppSnapshot
       [-RecoverConfiguration]
       [-Force]
       [-AsJob]
       [-WebApp] <PSSite>
       [-DefaultProfile <IAzureContextContainer>]
       [-InputObject] <AzureWebAppSnapshot>
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

Restores a web app snapshot to the web app. Restoring a snapshot overwrites all files in a web app with the files contained in the snapshot. To restore settings as well, use the RecoverConfiguration switch parameter. A snapshot from one web app can be restored to any other web app in the same subscription.

Examples

Example 1

PS C:\> $snapshot = (Get-AzureRmWebAppSnapshot -ResourceGroupName "Default-Web-WestUS" -Name "ContosoApp" -Slot "Staging")[0]
PS C:\> Restore-AzureRmWebAppSnapshot -ResourceGroupName "Default-Web-WestUS" -Name "ContosoApp" -Slot "Restore" -InputObject $snapshot -RecoverConfiguration

Gets the latest snapshot of a web app named "ContosoApp" with a slot named "Staging" in the "Default-Web-WestUS" resource group. Restores the snapshot to the web app's "Restore" slot.

Parameters

-AsJob

Run cmdlet in the background

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

Allows the original web app to be overwritten without displaying a warning.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-InputObject

The Azure Web App snapshot.

Type:AzureWebAppSnapshot
Position:3
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Name

The name of the web app.

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

Recover the web app's configuration in addition to files.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ResourceGroupName

The name of the resource group.

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

The name of the web app slot.

Type:String
Position:2
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-WebApp

The web app 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

SwitchParameter

String

Site

Parameters: WebApp (ByValue)

AzureWebAppSnapshot

Parameters: InputObject (ByValue)

Outputs

Void