How to include excluded disks in azure backup

HARRAG Achraf [ECM] (EXT) 6 Reputation points
2020-11-06T14:25:04.1+00:00

Hi All,

I have 2 excluded disks from backup. I want to include them to my bakcup azure, but when i run my az command i have an error.

My az command (I use --vm $() because my VM is not in the same Resource group of the Backup vault name):

az backup protection enable-for-vm --resource-group backup-RG --vault-name backup-VN --policy-name MyBackupPolicyName --disk-list-setting include --diskslist 5 6 --vm $(az vm show -g VM-RG -n MyVM --query '\"03dd2217-6c9a-4970-92aa-340b9e276be6\"' --output tsv)

And i have this error :

ArgumentParseError: argument --vm: expected one argument

Thanks for your help.

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,256 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 45,181 Reputation points Microsoft Employee
    2020-11-09T08:31:18.443+00:00

    Hello @HARRAG Achraf [ECM] (EXT) ,
    Welcome to Microsoft Q&A community forums!

    Apologies for delay in response to your query. Much appreciate your time and patience.

    Reg: your query: You may want to modify protection instead of enabling protection as I assume you already have the VM protected currently and excluded two of the disks.

    You can either reconfigure disk inclusion settings using modify protection - https://video2.skills-academy.com/en-us/azure/backup/selective-disk-backup-restore#modify-protection-for-already-backed-up-vms-with-azure-cli

    OR just remove disk exclusion setting all together - https://video2.skills-academy.com/en-us/azure/backup/selective-disk-backup-restore#remove-disk-exclusion-settings-and-get-protected-item-with-azure-cli

    Hope this helps!

    ------------------------------------------------------------------------------------------------------------------------------

    If an Answer is helpful, please “Accept Answer” and Up-Vote for the same which might be beneficial to other community members reading this thread.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.