azure vm backup Application/File/Crash Consistent

Siva 646 Reputation points
2021-11-17T08:03:42.103+00:00

Do we have an option to set the file/crash/application consistence backup alert or do we have any PowerShell script to identify the recovery point details.

we can see that backup completed without warning, but vm backup is in file consistency. so for avoid manually checking each backup, do we have any other option for find out or make sure all backups good?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,807 questions
Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,131 questions
0 comments No comments
{count} votes

Accepted answer
  1. SadiqhAhmed-MSFT 37,921 Reputation points Microsoft Employee
    2021-11-19T12:21:21.13+00:00

    @Siva Apologies for the delayed response!

    Here is a script which can help you check what was the type of snapshot crash or app

    $targetVault = Get-AzRecoveryServicesVault -Name "CentralSQL" -ResourceGroupName "a2ademorecoveryrg" | Set-AzRecoveryServicesVaultContext  
      
    $namedContainer = Get-AzRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -FriendlyName "testformanifest" -VaultId $targetVault.ID  
    $backupitem = Get-AzRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM" -VaultId $targetVault.ID  
      
    $startDate = (Get-Date).AddDays(-7)  
    $endDate = Get-Date  
    $rp = Get-AzRecoveryServicesBackupRecoveryPoint -Item $backupitem -StartDate $startdate.ToUniversalTime() -EndDate $enddate.ToUniversalTime() -VaultId $targetVault.ID  
    $rp[0]  
    

    Hope this helps!

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

    If the response helped, do "Accept Answer" and up-vote it


1 additional answer

Sort by: Most helpful
  1. Bhanu Ejjagiri 261 Reputation points Microsoft Employee
    2021-12-09T10:45:51.367+00:00

    Hi @Siva

    Seems friendly name will be the VM name of all the backup itemps, and hoping the below script works for youe requirement.

    $servers = Get-Content -Path C:\servers.txt
    $output =@()

    foreach($server in $servers){

    $targetVault = Get-AzRecoveryServicesVault -Name "CentralSQL" -ResourceGroupName "a2ademorecoveryrg" | Set-AzRecoveryServicesVaultContext

    $namedContainer = Get-AzRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -FriendlyName $server -VaultId $targetVault.ID
    $backupitem = Get-AzRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM" -VaultId $targetVault.ID

    $startDate = (Get-Date).AddDays(-7)
    $endDate = Get-Date
    $rp = Get-AzRecoveryServicesBackupRecoveryPoint -Item $backupitem -StartDate $startdate.ToUniversalTime() -EndDate $enddate.ToUniversalTime() -VaultId $targetVault.ID
    $output += $rp
    }

    $rp | Export-csv "$PSScriptRoot\output.csv" -NoTypeInformation

    Please accept this solution if answers your question!

    0 comments No comments