Backup-AzureRmApiManagement

Backs up an API Management service.

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

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.

Parameters

-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

-Name

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

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

-PassThru

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

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

-StorageContext

Specifies a storage connection context.

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

Inputs

String

IStorageContext

Outputs

PsApiManagement