Not able to trigger an on demand backup in hana db using azure cli?

Moses Abraham, Densinghdaniel 26 Reputation points
2021-12-02T05:31:21.873+00:00

az backup protection backup-now --resource-group $saphanaResourceGroup
--item-name $saphanadatabase;hxe;hxe
--vault-name $saphanaVault
--container-name $friendly name -> e.g HanaVM
--backup-type Full
--retain-until 01-01-2040
--output table

I am using the above command to trigger the on-demand backup but it gives the error "item not, please provide a valid_name"

But I am using the same item details to enable the protection using the command "az backup protection enable-for-azurewl" and it worked.

Please let me know how to provide the item details to trigger the on-demand backup.

@Praveen Prabhakaran and @Prrudram-MSFT

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

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 23,211 Reputation points
    2021-12-02T08:06:15.067+00:00

    Hello @Moses Abraham, Densinghdaniel ,

    Thank you for reaching out to Microsoft Q&A Platform.

    Based on your previous thread, i believe you were able to configure the backup successfully for SAP Hana workload using azure backup and now you would like to trigger an adhoc backup?
    If i am right, the right usage of az cli command for an on-demand backup is

    az backup protection backup-now --container-name MyContainer --item-name MyItem --resource-group MyResourceGroup --retain-until 01-02-2018 --vault-name MyVault --backup-management-type AzureWorkload

    To fetch the info for optional parameters, please refer to https://learn.microsoft.com/en-us/cli/azure/backup/protection?view=azure-cli-latest#az_backup_protection_backup_now-optional-parameters
    For example : for --container-name is Name of the backup container.
    It accepts 'Name' or 'FriendlyName' from the output of az backup container list command. If 'FriendlyName' is passed then BackupManagementType is required.

    Reference : https://learn.microsoft.com/en-us/cli/azure/backup/protection?view=azure-cli-latest#az_backup_protection_backup_now-examples

    Please "Accept as Answer" if any of above helped so that, it can help others in community looking for remediation for the similar issues.

    1 person found this answer helpful.
    0 comments No comments