Create-AzDiagPolicy

2.9

This script takes a SubscriptionID, ResourceType, ResourceGroup as parameters, analyzes the subscription or
specific ResourceGroup defined for the resources specified in $Resources, and builds a custom policy for
diagnostic metrics/logs for Event Hubs, Storage and Log Analytics as sink points for selected resource types.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Create-AzDiagPolicy

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

Microsoft

Package Details

Author(s)

  • jbritt@microsoft.com

Functions

BuildBody Get-ResourceType Add-IndexNumberToArray New-LogArray New-MetricArray Update-LogAnalyticsJSON Update-EventHubJSON Update-StorageJSON Parse-ResourceType Validate-JSON New-PolicyInitiative Format-JSON Create-Hash

Dependencies

This script has no dependencies.

Release Notes

September 07, 2021 2.9
Update
* Updated the API version for both below types.  This was recently caught with the help
of ARM TTK: https://github.com/Azure/arm-ttk indicating an old version of an API for Azure Policy
within the ARM template that is generated as part of this script.
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2020-09-01"
and
"type": "Microsoft.Authorization/policySetDefinitions",
"apiVersion": "2020-09-01"
**NOTE**: Previous API version leveraged was 2019-09-01

FileList

Version History

Version Downloads Last updated
2.9 (current version) 1,998 9/9/2021