Register-AzRecoveryServicesBackupContainer
The Register-AzRecoveryServicesBackupContainer cmdlet registers Azure workload and Azure Storage backup containers with a Recovery Services vault.
Syntax
Register (Default)
Register-AzRecoveryServicesBackupContainer
[-ResourceId] <String>
[-BackupManagementType] <BackupManagementType>
[-WorkloadType] <WorkloadType>
[-Force]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ReRegister
Register-AzRecoveryServicesBackupContainer
[-Container] <ContainerBase>
[-BackupManagementType] <BackupManagementType>
[-WorkloadType] <WorkloadType>
[-Force]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
AzureFileRegister
Register-AzRecoveryServicesBackupContainer
[-StorageAccountName] <String>
[-BackupManagementType] <BackupManagementType>
[-WorkloadType] <WorkloadType>
[-AccessType <String>]
[-IsSystemAssignedIdentity]
[-UserAssignedIdentityArmUrl <String>]
[-Force]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
This command allows Azure Backup to convert the resource to a Backup Container that is registered to the specified Recovery Services vault. It supports Azure workload containers and Azure Storage containers used for Azure File Share backup. An Azure Storage container can use shared-key or managed identity access.
Examples
Example 1 Register a backup container
Register-AzRecoveryServicesBackupContainer -ResourceId <AzureVMID> -VaultId <vaultID> -WorkloadType MSSQL -BackupManagementType AzureWorkload
The cmdlet registers an azure VM as a container for the workload MSSQL.
Example 2 Re-register a backup container
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "rgName" -Name "vaultName"
$container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVMAppContainer -VaultId $vault.ID
Register-AzRecoveryServicesBackupContainer -Container $container[-1] -BackupManagementType AzureWorkload -WorkloadType MSSQL -VaultId $vault.ID
The first command fetches the recovery services vault. The second command fetches all the backup containers registered with the recovery services vault. The third command triggers a re-register operation for the container $container[-1], to re-register an already registered container we pass -Container parameter.
Example 3: Register an Azure Storage account by using a user-assigned managed identity
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "vaultResourceGroup" -Name "vaultName"
$identityId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/backupIdentity"
Register-AzRecoveryServicesBackupContainer -StorageAccountName "storageAccountName" -BackupManagementType AzureStorage -WorkloadType AzureFiles -AccessType IdentityBased -UserAssignedIdentityArmUrl $identityId -VaultId $vault.ID
This example registers an Azure Storage account for Azure File Share backup using a user-assigned managed identity. If the account is already registered with a different access type or identity, the cmdlet requests confirmation. Specify -Force to skip that confirmation.
Parameters
-AccessType
Specifies how Azure Backup accesses an Azure Storage account. Use KeyBased for shared-key access or IdentityBased for managed identity access.
Parameter properties
Type: String
Default value: None
Accepted values: KeyBased, IdentityBased
Supports wildcards: False
DontShow: False
Parameter sets
AzureFileRegister
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-BackupManagementType
The class of resources being protected. Supported values are AzureWorkload and AzureStorage.
Parameter properties
Type: BackupManagementType
Default value: None
Accepted values: AzureWorkload, AzureStorage
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Container
Container where the item resides
Parameter properties
Type: ContainerBase
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ReRegister
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Force
Skips the confirmation dialog when registering or re-registering a container.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IsSystemAssignedIdentity
Indicates that Azure Backup uses the Recovery Services vault's system-assigned managed identity to access the storage account.
Parameter properties
Type: SwitchParameter
Default value: False
Supports wildcards: False
DontShow: False
Parameter sets
AzureFileRegister
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceId
ID of the Azure Resource whose representative item needs to be checked if it is already protected by some RecoveryServices Vault in the subscription.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
Register
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StorageAccountName
Specifies the name of the Azure Storage account to register for Azure File Share backup.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
AzureFileRegister
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UserAssignedIdentityArmUrl
Specifies the ARM resource ID of the user-assigned managed identity that Azure Backup uses to access the storage account.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
AzureFileRegister
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VaultId
ARM ID of the Recovery Services Vault.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WorkloadType
Workload type of the resource. The current supported value is AzureVM, WindowsServer, AzureFiles, MSSQL
Parameter properties
Type: WorkloadType
Default value: None
Accepted values: AzureVM, AzureSQLDatabase, AzureFiles, MSSQL
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 2
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs