Azure Audit

To create an up-to-date spreadsheet of Azure Subscriptions, Servers, and Databases I …

  1. Got the code working on my laptop. Using “Export-Csv” to save the data to my C-Drive.
  2. Got the code working on a server. Using “Save-AzContext” to save my Azure login credentials, and “Import-AzContext” to use it in the code.

created a powershell script on the server called “ps_AzureAudit.ps1”.

import-AzContext -Path F:\DBAdmin\Rb.json
Get-AzResourceGroup | Get-AzSqlServer | Get-AzSqlDatabase | Export-Csv -Path c:\Azure.csv -Encoding ascii -NoTypeInformation -Force

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s