Skip to content

Commit

Permalink
v6_major_20221202_5
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianHayward committed Dec 2, 2022
1 parent 92cb043 commit d9cc426
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .azuredevops/pipelines/AzGovViz.variables.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AzGovViz v6_major_20221023_1
# AzGovViz v6_major_20221202_4
# First things first:
# 1. Replace <YourServiceConnection> with the name of your service connection
# 2. Replace <YourManagementGroupId> with the your ManagementGroupId
Expand Down Expand Up @@ -257,7 +257,7 @@ variables:

# Define the number of script blocks running in parallel. Leveraging PowerShell Core´s parallel capability you can define the ThrottleLimit (default=5)
- name: ThrottleLimit
# Integer | Default = 5 | example: value: 10
# Integer | Default = 10 | example: value: 11
value:

# Will show memory usage
Expand Down
24 changes: 15 additions & 9 deletions pwsh/AzGovVizParallel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ Param
$Product = 'AzGovViz',

[string]
$AzAPICallVersion = '1.1.55',
$AzAPICallVersion = '1.1.57',

[string]
$ProductVersion = 'v6_major_20221202_3',
$ProductVersion = 'v6_major_20221202_5',

[string]
$GithubRepository = 'aka.ms/AzGovViz',
Expand Down Expand Up @@ -659,6 +659,7 @@ function addHtParameters {
NoStorageAccountAccessAnalysis = [bool]$NoStorageAccountAccessAnalysis
GitHubActionsOIDC = [bool]$GitHubActionsOIDC
NoNetwork = [bool]$NoNetwork
ThrottleLimit = $ThrottleLimit
}
Write-Host 'htParameters:'
$azAPICallConf['htParameters'] | Format-Table -AutoSize | Out-String
Expand Down Expand Up @@ -3267,8 +3268,11 @@ function getOrphanedResources {
$subscriptions = '"{0}"' -f ($batch.Group.subscriptionId -join '","')
$body = @"
{
"query": "$($queryDetail.query)",
"subscriptions": [$($subscriptions)]
"query": "$($queryDetail.query)",
"subscriptions": [$($subscriptions)],
"options": {
"`$top": 100
}
}
"@

Expand Down Expand Up @@ -14361,7 +14365,7 @@ extensions: [{ name: 'sort' }]

$htmlSUMMARYALZPolicyVersionChecker = $null
$exemptionData4CSVExport = [System.Collections.ArrayList]@()
$alzPoliciesInTenantSorted = $alzPoliciesInTenant | Sort-Object -Property PolicyName, PolicyId, ALZPolicyName
$alzPoliciesInTenantSorted = $alzPoliciesInTenant | Sort-Object -Property PolicyName, PolicyId, ALZPolicyName, Type
$htmlSUMMARYALZPolicyVersionChecker = foreach ($entry in $alzPoliciesInTenantSorted) {
if ([string]::IsNullOrWhiteSpace($entry.AzAdvertizerUrl)) {
$link = ''
Expand Down Expand Up @@ -28281,19 +28285,21 @@ function dataCollectionResources {

if ($htResourceProvidersRef.($resource.type)) {
$apiVersionToUse = $htResourceProvidersRef.($resource.type).APIFirst
$currentTask = "Getting Resource for PSRule API-version: '{0}'; ResourceId: '{1}'" -f $apiVersionToUse, $resourceId
$currentTask = "Getting Resource for PSRule API-version: '$apiVersionToUse'; ResourceType: '$($resource.type)'; ResourceId: '$resourceId'"
$uri = "$($azAPICallConf['azAPIEndpointUrls'].ARM)$($resourceId)?api-version=$apiVersionToUse"
$method = 'GET'
$resource = AzAPICall -AzAPICallConfiguration $azAPICallConf -uri $uri -method $method -currentTask $currentTask -caller 'CustomDataCollection' -listenOn Content -unhandledErrorAction Continue
$null = $script:arrayResourcesWithProperties.Add($resource)
$resourceResult = AzAPICall -AzAPICallConfiguration $azAPICallConf -uri $uri -method $method -currentTask $currentTask -caller 'CustomDataCollection' -listenOn Content -unhandledErrorAction Continue
if ($resourceResult -ne 'ResourceOrResourcegroupNotFound') {
$null = $script:arrayResourcesWithProperties.Add($resourceResult)
}
}
else {
Write-Host 'Please report at AzGovViz Repo ... No API-version matches!'
Write-Host 'ResourceType:' $resource.type
Write-Host 'ResourceId:' $resourceId
}

} -ThrottleLimit 20
} -ThrottleLimit $azAPICallConf['htParameters'].ThrottleLimit
#Write-Host 'arm resGet count:' $arrayResourcesWithProperties.Count

# $currentTask = "Getting Resources (ARG) for Subscription: '$($scopeDisplayName)' ('$scopeId') [quotaId:'$subscriptionQuotaId']"
Expand Down
4 changes: 2 additions & 2 deletions pwsh/dev/devAzGovVizParallel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ Param
$Product = 'AzGovViz',

[string]
$AzAPICallVersion = '1.1.55',
$AzAPICallVersion = '1.1.57',

[string]
$ProductVersion = 'v6_major_20221202_3',
$ProductVersion = 'v6_major_20221202_5',

[string]
$GithubRepository = 'aka.ms/AzGovViz',
Expand Down
1 change: 1 addition & 0 deletions pwsh/dev/functions/addHtParameters.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function addHtParameters {
NoStorageAccountAccessAnalysis = [bool]$NoStorageAccountAccessAnalysis
GitHubActionsOIDC = [bool]$GitHubActionsOIDC
NoNetwork = [bool]$NoNetwork
ThrottleLimit = $ThrottleLimit
}
Write-Host 'htParameters:'
$azAPICallConf['htParameters'] | Format-Table -AutoSize | Out-String
Expand Down
10 changes: 6 additions & 4 deletions pwsh/dev/functions/dataCollection/dataCollectionFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -457,19 +457,21 @@ function dataCollectionResources {

if ($htResourceProvidersRef.($resource.type)) {
$apiVersionToUse = $htResourceProvidersRef.($resource.type).APIFirst
$currentTask = "Getting Resource for PSRule API-version: '{0}'; ResourceId: '{1}'" -f $apiVersionToUse, $resourceId
$currentTask = "Getting Resource for PSRule API-version: '$apiVersionToUse'; ResourceType: '$($resource.type)'; ResourceId: '$resourceId'"
$uri = "$($azAPICallConf['azAPIEndpointUrls'].ARM)$($resourceId)?api-version=$apiVersionToUse"
$method = 'GET'
$resource = AzAPICall -AzAPICallConfiguration $azAPICallConf -uri $uri -method $method -currentTask $currentTask -caller 'CustomDataCollection' -listenOn Content -unhandledErrorAction Continue
$null = $script:arrayResourcesWithProperties.Add($resource)
$resourceResult = AzAPICall -AzAPICallConfiguration $azAPICallConf -uri $uri -method $method -currentTask $currentTask -caller 'CustomDataCollection' -listenOn Content -unhandledErrorAction Continue
if ($resourceResult -ne 'ResourceOrResourcegroupNotFound') {
$null = $script:arrayResourcesWithProperties.Add($resourceResult)
}
}
else {
Write-Host 'Please report at AzGovViz Repo ... No API-version matches!'
Write-Host 'ResourceType:' $resource.type
Write-Host 'ResourceId:' $resourceId
}

} -ThrottleLimit 20
} -ThrottleLimit $azAPICallConf['htParameters'].ThrottleLimit
#Write-Host 'arm resGet count:' $arrayResourcesWithProperties.Count

# $currentTask = "Getting Resources (ARG) for Subscription: '$($scopeDisplayName)' ('$scopeId') [quotaId:'$subscriptionQuotaId']"
Expand Down
7 changes: 5 additions & 2 deletions pwsh/dev/functions/getOrphanedResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ function getOrphanedResources {
$subscriptions = '"{0}"' -f ($batch.Group.subscriptionId -join '","')
$body = @"
{
"query": "$($queryDetail.query)",
"subscriptions": [$($subscriptions)]
"query": "$($queryDetail.query)",
"subscriptions": [$($subscriptions)],
"options": {
"`$top": 100
}
}
"@

Expand Down
2 changes: 1 addition & 1 deletion pwsh/dev/functions/processTenantSummary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ extensions: [{ name: 'sort' }]

$htmlSUMMARYALZPolicyVersionChecker = $null
$exemptionData4CSVExport = [System.Collections.ArrayList]@()
$alzPoliciesInTenantSorted = $alzPoliciesInTenant | Sort-Object -Property PolicyName, PolicyId, ALZPolicyName
$alzPoliciesInTenantSorted = $alzPoliciesInTenant | Sort-Object -Property PolicyName, PolicyId, ALZPolicyName, Type
$htmlSUMMARYALZPolicyVersionChecker = foreach ($entry in $alzPoliciesInTenantSorted) {
if ([string]::IsNullOrWhiteSpace($entry.AzAdvertizerUrl)) {
$link = ''
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v6_major_20221202_3
v6_major_20221202_5

0 comments on commit d9cc426

Please sign in to comment.