Backup-AzureRmApiManagement

Backs up an API Management service.

Syntax

Backup-AzureRmApiManagement
      -ResourceGroupName <String>
      -Name <String>
      -StorageContext <IStorageContext>
      -TargetContainerName <String>
      [-TargetBlobName <String>]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [<CommonParameters>]

Description

The Backup-AzureRmApiManagement cmdlet backs up an instance of an Azure API Management service. This cmdlet stores the backup as an Azure Storage blob.

Examples

Example 1: Back up an API Management service

PS C:\>New-AzureRmStorageAccount -StorageAccountName "ContosoStorage" -Location $location -ResourceGroupName "ContosoGroup02" -Type Standard_LRS
PS C:\>$storageKey = (Get-AzureRmStorageAccountKey -ResourceGroupName "ContosoGroup02" -StorageAccountName "ContosoStorage")[0].Value
PS C:\>$storageContext = New-AzureStorageContext -StorageAccountName "ContosoStorage" -StorageAccountKey $storageKey
PS C:\>Backup-AzureRmApiManagement -ResourceGroupName "ContosoGroup02" -Name "ContosoApi" -StorageContext $StorageContext -TargetContainerName "ContosoBackups" -TargetBlobName "ContosoBackup.apimbackup"

This command backs up an API Management service to a Storage blob.

Required Parameters

-Name

Specifies the name of the API Management deployment that this cmdlet backs up.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the of resource group under which the API Management deployment exists.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-StorageContext

Specifies a storage connection context.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TargetContainerName

Specifies the name of the container of the blob for the backup. If the container does not exist, this cmdlet creates it.

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

Optional Parameters

-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Indicates that this cmdlet returns the backed up PsApiManagement object, if the operation succeeds.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TargetBlobName

Specifies the name of the blob for the backup. If the blob does not exist, this cmdlet creates it. This cmdlet generates a default value based on the following pattern:

{Name}-{yyyy-MM-dd-HH-mm}.apimbackup

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

Outputs

Microsoft.Azure.Commands.ApiManagement.Models.PsApiManagement