Do we have any option to get the azure vm backup policy associated clients

Siva 646 Reputation points
2022-11-16T14:55:37.657+00:00

Hi Team,

Do we have any option to get the azure vm backup policy associated clients using the powershell cmds

we need to reassociate the policy to another policy.. its around 100+vms.

we have command to reassociate to another policy.. but we need to get the vm details, which is already associated in vm policyA. so that we can reassociate to Policy B.

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,114 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,108 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
781 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,344 questions
0 comments No comments
{count} votes

Accepted answer
  1. Roderick Bant 2,046 Reputation points
    2022-11-16T18:43:55.647+00:00

    Hi @Siva

    You can use azure cli to manage Azure backup. It has commands to [list items associated to a backup policy(https://learn.microsoft.com/en-us/cli/azure/backup/policy?view=azure-cli-latest#az-backup-policy-list-associated-items) and the backup item set-policy command enables you to change the policy associated with a backup item.

    For example you can get a list of associated items for a backup policy:

       az backup policy list-associated-items --name MyBackupPolicy --resource-group MyResourceGroup --vault-name MyVault --backup-management-type AzureIaasVM  
    

    And change the associated backup policy:

       az backup item set-policy --vault-name MyVault --resource-group MyResourceGroup --container-name MyContainer --name MyItem --policy-name MyPolicy --backup-management-type AzureIaasVM  
    

    Alternatively you can use PowerShell:

    Get the items for a container in Azure Backup: Get-AzRecoveryServicesBackupItem

    Change the policy assigned to a backup item: Enable-AzRecoveryServicesBackupProtection


0 additional answers

Sort by: Most helpful