Score:0

LogAnalyticsReader unable to access AzRecoveryServicesBackupStatus

sb flag

I'm writing a Powershell script that queries the status of the latest backup of VMs as follows:

$recoveryVaultInfo = Get-AzRecoveryServicesBackupStatus -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -Type 'AzureVM'

When I run this piece of the script, I get this error:

Get-AzRecoveryServicesBackupStatus: The client 'XXX' with object id 'XXX' does not have authorization to perform action 'Microsoft.RecoveryServices/locations/backupStatus/action' over scope '/subscriptions/XXX' or the scope is invalid. If access was recently granted, please refresh your credentials.

I am a member of the LogAnalyticsReader group on the BackupVault. I am able to see the status of backups through the Backup Vault > Backup Items blade.

Why can't I do it through Powershell?

Score:0
de flag

Backup reports can be viewed as long as their data is being sent to a Log Analytics workspace. To view reports for a vault or a set of vaults, you need to have reader access to the Log Analytics workspace to which the vault is sending its data. You don't have to have access to the vault.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.