Skip to content

[Feature]: Get-AzRecoveryServicesBackupContainer cannot retrieve SQL Always On Availability Group containers #29392

@SQLCanuck

Description

@SQLCanuck

Description of the new feature

The Get-AzRecoveryServicesBackupContainer cmdlet cannot retrieve SQL Server Always On Availability Group (AG) containers that use the SQLAGWorkLoadContainer type. This creates a gap in automation capabilities for managing SQL AG backups.

The cmdlet currently only supports the following -ContainerType parameter values:

AzureVM
Windows
AzureStorage
AzureVMAppContainer

When retrieving containers, AG containers with the internal type SQLAGWorkLoadContainer are not returned, even though they exist in the vault and are visible in:

Azure REST API responses
The ContainerName property of backup items

# Set vault context
$vault = Get-AzRecoveryServicesVault -Name "your-vault-name"
Set-AzRecoveryServicesVaultContext -Vault $vault

# Attempt to get all containers
$containers = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVMAppContainer

# Result: Only VMAppContainer types returned, no SQLAGWorkLoadContainer types
$containers | Where-Object { $_.Name -like '*SQLAGWorkLoadContainer*' }
# Returns: Nothing

# However, AG backup items exist and reference these containers
$agItems = Get-AzRecoveryServicesBackupItem -BackupManagementType AzureWorkload -WorkloadType MSSQL | 
    Where-Object { $_.ParentType -like '*Availability*' }

$agItems | Select-Object -First 1 | Select-Object ContainerName
# Returns: SQLAGWorkLoadContainer;{GUID}

Proposed implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions