Editar

Compartilhar via


Restore-AzWebAppSnapshot

Restores a web app snapshot.

Syntax

Restore-AzWebAppSnapshot
       [-RecoverConfiguration]
       [-UseDisasterRecovery]
       [-Force]
       [-AsJob]
       [-ResourceGroupName] <String>
       [-Name] <String>
       [[-Slot] <String>]
       [-DefaultProfile <IAzureContextContainer>]
       [-InputObject] <AzureWebAppSnapshot>
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restore-AzWebAppSnapshot
       [-RecoverConfiguration]
       [-UseDisasterRecovery]
       [-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

$snapshot = (Get-AzWebAppSnapshot -ResourceGroupName "Default-Web-WestUS" -Name "ContosoApp" -Slot "Staging")[0]
Restore-AzWebAppSnapshot -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
Required:False
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
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:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-InputObject

The Azure Web App snapshot.

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

-Name

The name of the web app.

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

-ResourceGroupName

The name of the resource group.

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

-Slot

The name of the web app slot.

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

-UseDisasterRecovery

Use to recover a snapshot from a scale unit that is offline.

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

-WebApp

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

SwitchParameter

String

PSSite

AzureWebAppSnapshot

Outputs

Void