Author's Notes
In April 2021 I got sick of having bits of Azure utility code scattered all over the place. I created this library and driver DOS command to slowly centralize all of the Azure code. At the moment there is only a single utility function, but others will slowly arrive.
The SubscriptionReader class contains some technically interesting and tricky code to enumerate all of the storage accounts in an Azure subcription. This powerful feature allows the Summary
action (described below) to create a summary of all Containers, Blobs and Tables in all storage accounts. For more information see my blog post Enumerate Azure Storage Accounts .
Command Syntax
azutil commandFileName commandName
commandFileName
Specifies the name of an XML file which has the following shape.
<commands>
<command name="command-1">
<action>...</action>
... action parameter elements ...
</command>
:
</commands>
commandName
The name of a <command>
element to execute.
▶️ <action>Summary</action>
Scan an Azure subscription and generate a summary report in a HTML file. This action scans all containers and tables in the account, so the processing can take a long time if the subscription contains a large amount of data.
<subscriptionId>...</subscriptionId>
A Guid-like string taken from the Azure portal, Subscriptions, Account blade.
<tenantId>...</tenantId>
A Guid-like string taken from the Azure portal, Active Directory blade.
<applicationId>...</applicationId>
A Guid-like string taken from the Azure portal, Active Directory, App Registrations, Application Client Id. An app must be registered with AD, then in the Subscriptions, IAM blade it is given the 'Owner' role assignment for the subscription (at most, a lesser role may be sufficient).
<applicationSecret>...</applicationSecret>
An application secret (aka Client secret) is created in the Active Directory, App registrations, Certificates and secrets blade for the app identified by applicationId
. The secret can only be copied and saved immediately after it is created.
<outputHtmlFile>...</outputHtmlFile>
Specifies the name of the output file to contain the generated summary report. The name will normally have a .htm or .html suffix because the report is formatted as a self-contained web page. If the element is omitted then the generated file name is %TEMP%\subscriptionId.htm
.
👉 A pair of files will actually be generated. One is the html report file, the other is an XML file with the same name as the report file with the extension .xml. This xml file may be useful as input to other utilities.
<generateOnly>...</generateOnly>
A True/False value element optionally specifies that the scan of the Azure subscription can be skipped and only the html report file will be generated from the xml file.
Other actions will arrive as code is migrated over to this project.