Skip to content

Commit

Permalink
6.4.12; azAPICall 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianHayward committed Jul 15, 2024
1 parent 97c78b6 commit f56ab31
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The [Azure Governance Visualizer accelerator](https://github.com/Azure/Azure-Gov

## Release history

**Changes** (2024-July-15 / 6.4.11 Minor)
**Changes** (2024-July-15 / 6.4.12 Minor)

- ALZ policy refresh H2 FY24 (initiatives.json)
- [DevSkim](https://github.com/microsoft/DevSkim-Action), [PSScriptAnalyzer](https://github.com/microsoft/psscriptanalyzer-action) and [OpenSSF Scorecard](https://github.com/ossf/scorecard?tab=readme-ov-file#scorecard-github-action) integration
Expand All @@ -94,6 +94,7 @@ The [Azure Governance Visualizer accelerator](https://github.com/Azure/Azure-Gov
- update getConsumption (experimental for now): instead of full Management Group scope costmanagement data retrieval, batch by Subscription quotaId in batches of 100. Failing batches and batches of Subscriptions of quotaId `CSP_2015-05-01` (see param block variable `SubscriptionQuotaIdsThatDoNotSupportCostManagementManagementGroupScopeQuery`) will fallback to get costmanagement data per Subscription. In order to use this you must update the AzGovVizParallel.ps1 file to use the function `getConsumptionv2` instead of `getConsumption`
- html; update jquery; source tablefilter js
- update `.devcontainer/devcontainer.json`
- use [AzAPICall](https://aka.ms/AzAPICall) PowerShell module version 1.2.3 (Handle costManagement error `SubscriptionCostDisabled`)

[Full release history](history.md)

Expand Down
3 changes: 2 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Azure Governance Visualizer version 6

**Changes** (2024-July-15 / 6.4.11 Minor)
**Changes** (2024-July-15 / 6.4.12 Minor)

- ALZ policy refresh H2 FY24 (initiatives.json)
- [DevSkim](https://github.com/microsoft/DevSkim-Action), [PSScriptAnalyzer](https://github.com/microsoft/psscriptanalyzer-action) and [OpenSSF Scorecard](https://github.com/ossf/scorecard?tab=readme-ov-file#scorecard-github-action) integration
Expand All @@ -16,6 +16,7 @@
- update getConsumption (experimental for now): instead of full Management Group scope costmanagement data retrieval, batch by Subscription quotaId in batches of 100. Failing batches and batches of Subscriptions of quotaId `CSP_2015-05-01` (see param block variable `SubscriptionQuotaIdsThatDoNotSupportCostManagementManagementGroupScopeQuery`) will fallback to get costmanagement data per Subscription. In order to use this you must update the AzGovVizParallel.ps1 file to use the function `getConsumptionv2` instead of `getConsumption`
- html; update jquery; source tablefilter js
- update `.devcontainer/devcontainer.json`
- use [AzAPICall](https://aka.ms/AzAPICall) PowerShell module version 1.2.3 (Handle costManagement error `SubscriptionCostDisabled`)

**Changes** (2024-May-05 / 6.4.5 Minor)

Expand Down
20 changes: 15 additions & 5 deletions pwsh/AzGovVizParallel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,14 @@ Param
$Product = 'AzGovViz',

[string]
$ProductVersion = '6.4.11',
$ProductVersion = '6.4.12',

[string]
$GithubRepository = 'aka.ms/AzGovViz',

# <--- AzAPICall related parameters #consult the AzAPICall GitHub repository for details aka.ms/AzAPICall
[string]
$AzAPICallVersion = '1.2.1',
$AzAPICallVersion = '1.2.3',

[switch]
$DebugAzAPICall,
Expand Down Expand Up @@ -3566,7 +3566,17 @@ function getConsumptionv2 {
}
$subConsumptionData = AzAPICall @subConsumptionDataParametersSplat

if ($subConsumptionData -eq 'Unauthorized' -or $subConsumptionData -eq 'OfferNotSupported' -or $subConsumptionData -eq 'InvalidQueryDefinition' -or $subConsumptionData -eq 'NonValidWebDirectAIRSOfferType' -or $subConsumptionData -eq 'NotFoundNotSupported' -or $subConsumptionData -eq 'IndirectCostDisabled') {
$subscriptionScopeKnownErrors = @(
'Unauthorized',
'OfferNotSupported',
'InvalidQueryDefinition',
'NonValidWebDirectAIRSOfferType',
'NotFoundNotSupported',
'IndirectCostDisabled',
'SubscriptionCostDisabled'
)

if ($subConsumptionData -in $subscriptionScopeKnownErrors) {
Write-Host " Failed ($subConsumptionData) - Getting Consumption data scope Sub (Subscription: $($subNameToProcess) '$($subIdToProcess)' QuotaId '$($subQuotaId)')"
$hlper = $htAllSubscriptionsFromAPI.($subIdToProcess).subDetails
$hlper2 = $htSubscriptionsMgPath.($subIdToProcess)
Expand All @@ -3583,15 +3593,15 @@ function getConsumptionv2 {
}
else {
Write-Host " $($subConsumptionData.properties.rows.Count) Consumption data entries (scope Sub $($subNameToProcess) '$($subIdToProcess)')"
if ($subConsumptionData.Count -gt 0) {
if ($subConsumptionData.properties.rows.Count -gt 0) {
addToAllConsumptionData -consumptiondataFromAPI $subConsumptionData -subscriptionQuotaId $subQuotaId
}
}
} -ThrottleLimit $ThrottleLimit
}
else {
Write-Host " #batch$($batchCnt)/$(($subscriptionsBatch | Measure-Object).Count) for $($batch.Group.Count) Subscriptions of QuotaId '$($quotaIdGroup.Name)' returned $($mgConsumptionData.properties.rows.Count) Consumption data entries"
if ($mgConsumptionData.Count -gt 0) {
if ($mgConsumptionData.properties.rows.Count -gt 0) {
addToAllConsumptionData -consumptiondataFromAPI $mgConsumptionData -subscriptionQuotaId $quotaIdGroup.Name
}
}
Expand Down
4 changes: 2 additions & 2 deletions pwsh/dev/devAzGovVizParallel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,14 @@ Param
$Product = 'AzGovViz',

[string]
$ProductVersion = '6.4.11',
$ProductVersion = '6.4.12',

[string]
$GithubRepository = 'aka.ms/AzGovViz',

# <--- AzAPICall related parameters #consult the AzAPICall GitHub repository for details aka.ms/AzAPICall
[string]
$AzAPICallVersion = '1.2.1',
$AzAPICallVersion = '1.2.3',

[switch]
$DebugAzAPICall,
Expand Down
16 changes: 13 additions & 3 deletions pwsh/dev/functions/getConsumptionv2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,17 @@
}
$subConsumptionData = AzAPICall @subConsumptionDataParametersSplat

if ($subConsumptionData -eq 'Unauthorized' -or $subConsumptionData -eq 'OfferNotSupported' -or $subConsumptionData -eq 'InvalidQueryDefinition' -or $subConsumptionData -eq 'NonValidWebDirectAIRSOfferType' -or $subConsumptionData -eq 'NotFoundNotSupported' -or $subConsumptionData -eq 'IndirectCostDisabled') {
$subscriptionScopeKnownErrors = @(
'Unauthorized',
'OfferNotSupported',
'InvalidQueryDefinition',
'NonValidWebDirectAIRSOfferType',
'NotFoundNotSupported',
'IndirectCostDisabled',
'SubscriptionCostDisabled'
)

if ($subConsumptionData -in $subscriptionScopeKnownErrors) {
Write-Host " Failed ($subConsumptionData) - Getting Consumption data scope Sub (Subscription: $($subNameToProcess) '$($subIdToProcess)' QuotaId '$($subQuotaId)')"
$hlper = $htAllSubscriptionsFromAPI.($subIdToProcess).subDetails
$hlper2 = $htSubscriptionsMgPath.($subIdToProcess)
Expand All @@ -243,15 +253,15 @@
}
else {
Write-Host " $($subConsumptionData.properties.rows.Count) Consumption data entries (scope Sub $($subNameToProcess) '$($subIdToProcess)')"
if ($subConsumptionData.Count -gt 0) {
if ($subConsumptionData.properties.rows.Count -gt 0) {
addToAllConsumptionData -consumptiondataFromAPI $subConsumptionData -subscriptionQuotaId $subQuotaId
}
}
} -ThrottleLimit $ThrottleLimit
}
else {
Write-Host " #batch$($batchCnt)/$(($subscriptionsBatch | Measure-Object).Count) for $($batch.Group.Count) Subscriptions of QuotaId '$($quotaIdGroup.Name)' returned $($mgConsumptionData.properties.rows.Count) Consumption data entries"
if ($mgConsumptionData.Count -gt 0) {
if ($mgConsumptionData.properties.rows.Count -gt 0) {
addToAllConsumptionData -consumptiondataFromAPI $mgConsumptionData -subscriptionQuotaId $quotaIdGroup.Name
}
}
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ProductVersion": "6.4.11"
"ProductVersion": "6.4.12"
}

0 comments on commit f56ab31

Please sign in to comment.