We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the Parse-ResourceType function found in the Create-AzDiagPolicy.ps1 script there are currently checks for 1 or 2 / characters, but not 3.
Parse-ResourceType
/
Block in question:
if($ResourceType.Split("/").count -eq 3) { $nameField = "fullName" $DirectoryNameBase = "Apply-Diag-Settings-$sinkDest-" + $($resourceType.Split("/", 3))[0] + "-" + $($resourceType.Split("/", 3))[1] + "-" + $($resourceType.Split("/", 3))[2] + $KindDirVar } if($ResourceType.Split("/").count -eq 2) { $nameField = "name" $DirectoryNameBase = "Apply-Diag-Settings-$sinkDest-" + $($resourceType.Split("/", 2))[0] + "-" + $($resourceType.Split("/", 2))[1] + $KindDirVar }
.\Create-AzDiagPolicy.ps1 -ExportLA -ValidateJSON -ManagementGroup -ManagementGroupID <management_group_id> -ExportAll -ExportDir policies -AllRegions
Update-LogAnalyticsJSON : Cannot bind argument to parameter 'nameField' because it is an empty string. At C:\Users\<user>\Documents\WindowsPowerShell\Scripts\Create-AzDiagPolicy.ps1:2376 char:153 + ... rray $metricsArray -logsArray $logsArray -nameField $RPVar[1] -kind $ ... + ~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Update-LogAnalyticsJSON], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Update-LogAnalyticsJSON
Diagnostic Policy JSON is generated for Microsoft.NetApp/netAppAccounts/capacityPools/volumes
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
In the
Parse-ResourceType
function found in the Create-AzDiagPolicy.ps1 script there are currently checks for 1 or 2/
characters, but not 3.Block in question:
Command Ran
.\Create-AzDiagPolicy.ps1 -ExportLA -ValidateJSON -ManagementGroup -ManagementGroupID <management_group_id> -ExportAll -ExportDir policies -AllRegions
Error
Expected Behavior
Diagnostic Policy JSON is generated for Microsoft.NetApp/netAppAccounts/capacityPools/volumes
The text was updated successfully, but these errors were encountered: