New-AzureRmRecoveryServicesAsrNetworkMapping

Creates an ASR network mapping between two networks.

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

New-AzureRmRecoveryServicesAsrNetworkMapping
   -Name <String>
   -PrimaryNetwork <ASRNetwork>
   -RecoveryNetwork <ASRNetwork>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmRecoveryServicesAsrNetworkMapping
   [-AzureToAzure]
   -Name <String>
   -PrimaryFabric <ASRFabric>
   -PrimaryAzureNetworkId <String>
   -RecoveryFabric <ASRFabric>
   -RecoveryAzureNetworkId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmRecoveryServicesAsrNetworkMapping
   -Name <String>
   -PrimaryNetwork <ASRNetwork>
   -RecoveryAzureNetworkId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzureRmRecoveryServicesAsrNetworkMapping cmdlet starts the operation of creating an ASR network mapping between two networks and returns the ASR job object for the ASR job used to track the operation.

Examples

Example 1

PS C:\> $currentJob = New-AzureRmRecoveryServicesAsrNetworkMapping -Name $NetworkMapName -PrimaryNetwork $PrimaryNetwork -RecoveryNetwork $RecoveryNetwork

Starts the network mapping creation operation using the specified name, primary and recovery networks, and returns an ASR job to track the operation.

Example 2

PS C:\> $currentJob = New-AzureRmRecoveryServicesAsrNetworkMapping -AzureToAzure -Name "mappingName" -PrimaryFabric $AzureFabric `
 -PrimaryAzureNetworkId $AzureNetworkId -RecoveryFabric $RecoveryAzureFabric -RecoveryAzureNetworkId $RecoveryNetworkId

Starts the network mapping for creation operation using the specified name, primary and recovery networks, and returns an ASR job to track the operation(Azure to Azure scenario).

Parameters

-AzureToAzure

Switch parameter specifying that the network mapping being created will be used to replicated Azure virtual machines between two Azure regions.

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

-Name

Name of the ASR network mapping to create.

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

-PrimaryAzureNetworkId

Specifies the Azure virtual network ID of the primary network for the mapping.

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

-PrimaryFabric

Specifes the ASR fabric where mapping should be created.

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

-PrimaryNetwork

Specifies the primary network object for the ASR network mapping.

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

-RecoveryAzureNetworkId

Specifies the recovery azure network ID for the network mapping.

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

-RecoveryFabric

The Azure Site Recovery fabric object corresponding to the recovery Azure region.

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

-RecoveryNetwork

Specifies the recovery network object for the ASR network mapping.

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

ASRNetwork

Outputs

ASRJob