The PowerShell script is an Azure automation runbook that pulls the below data and populates the data into a CSV file. The script then summarizes the data into an email’s body and sends an email to the recipient with the CSV files as attachments.
If the Azure automation runbook is scheduled to run every day, you will get a summary/high-level view of what is happening in your environment to your email box. The email could be the first report any organization’s high management would desire to look at.
1. Count of De-allocated Azure virtual machines
2. Count of Running Azure virtual machines
3. Count of Stopped Azure virtual machines
4. Count of Azure virtual machines that do not have native backup configured (Azure Back up and Recovery service)
5. Count of Inbound Security rules that causes vulnerability
Azure Backup is the Azure-based service you can use to back up (or protect) and restore your data in the Microsoft cloud. Azure Backup replaces your existing on-premises or off-site backup solution with a cloud-based solution that is reliable, secure, and cost-competitive.
Azure Backup offers multiple components that you download and deploy on the appropriate computer, server, or in the cloud. The component, or agent that you deploy depends on what you want to protect.
All Azure Backup components (no matter whether you’re protecting data on-premises or in the cloud) can be used to back up data to a Recovery Services vault in Azure.
You might come across a need to automate the process of generating a report every day and share it with stakeholders to keep track of your backup details.
The PowerShell script will list the “Backup Items” from your Azure subscription. And saves the data into an excel file under the folder “C:\Backup_job_report.” The excel file will contain multiple worksheets for each “Vault” that exists. The script expects you to provide a text file containing the list of Azure Servers, for which you want to fetch the “Backup Items.”
The details include:
1. VM Resource Name
2. VM Name
3. Recovery Vault Name
4. Last Backup Status
5. Latest Recovery Point
The script is uploaded to Microsoft Technet Script Center’s repository: