Skip to content

az backup protection enable-for-azurewl do have server parameter instead of vmname and resourcegroup #28186

@franpb90

Description

@franpb90

Describe the bug

I am not fully sure if this is an issue from the Azure CLI or from the Recovery Service Backup.

In the 'az backup protection enable-for-azurewl' command you cannot specify the VM Resource Group for SQLDatabase, just the server.

If you have two VMs (or you had and they were registered with the Recovery Service Vault) with the same name in two different resource groups. You cannot decide which VM is going to configure because the protectable-item-name for SQLDatabases (sqldatabase;mssqlserver;msdb) does not contain the VM name and Resource Group like in the case of SQLInstance (vmappcontainer;compute;rgname;vmname), and you just can supply the server name.

Using 'az backup protectable-item list' you can check in the id that the protectable-item of type SQLDatabase contains the relation with a specific resource group and vm.

I think the api should retrieve this information and not just keep it in the id. The only solution that, I think can be achieved from the Az CLI is the support to supply the --protectable-item-id.

Related command

az backup protection enable-for-azurewl

Errors

{
"endTime": "2024-01-12T09:54:53.834358+00:00",
"error": {
"code": "UserErrorRegisteredVMNotFound",
"message": "Azure Backup service is unable to find the virtual machine registered for workload backup."
},
"id": "01f53968-bf10-402d-86de-e8f5648ec11b",
"name": "01f53968-bf10-402d-86de-e8f5648ec11b",
"properties": null,
"startTime": "2024-01-12T09:54:53.834358+00:00",
"status": "Failed"
}

Issue script & Debug output

I will add it later, without private information

Expected behavior

It should work because there is a new vm with the same name and in another resource group with a datasabe named msdb.

Environment Summary

azure-cli 2.56.0

core 2.56.0
telemetry 1.1.0

Extensions:
azure-devops 0.26.0

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location '/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/bin/python'
Extensions directory '/Users/f.palomino/.azure/cliextensions'

Python (Darwin) 3.11.7 (main, Dec 4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botRecovery Services Backupaz backupService AttentionThis issue is responsible by Azure service team.act-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions