Skip to content

Commit

Permalink
1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianHayward committed Jul 15, 2024
1 parent 5745ef7 commit 6826d07
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
Binary file modified pwsh/module/build/AzAPICall.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion pwsh/module/build/AzAPICall/AzAPICall.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AzAPICall.psm1'

# Version number of this module.
ModuleVersion = '1.2.2'
ModuleVersion = '1.2.3'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
12 changes: 11 additions & 1 deletion pwsh/module/build/AzAPICall/functions/AzAPICallFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@ function AzAPICallErrorHandler {
$getARMCostManagement -and (
$catchResult.error.code -eq 404 -or
$catchResult.error.code -eq 'AccountCostDisabled' -or
$catchResult.error.code -eq 'SubscriptionCostDisabled' -or
$catchResult.error.message -like '*does not have any valid subscriptions*' -or
$catchResult.error.code -eq 'Unauthorized' -or
($catchResult.error.code -eq 'NotFound' -and $catchResult.error.message -like '*have valid WebDirect/AIRS offer type*') -or
Expand Down Expand Up @@ -1034,6 +1035,15 @@ function AzAPICallErrorHandler {
return $response
}

if ($catchResult.error.code -eq 'SubscriptionCostDisabled') {
Logging -preventWriteOutput $true -logMessage "$defaultErrorInfo - (plain : $catchResult) - AzAPICall: seems Access to cost data has been disabled for this Subscription - skipping CostManagement for this Subscription - return 'SubscriptionCostDisabled'"
$response = @{
action = 'return' #break or return or returnCollection
returnVar = 'SubscriptionCostDisabled'
}
return $response
}

if ($catchResult.error.message -like '*does not have any valid subscriptions*') {
Logging -preventWriteOutput $true -logMessage "$defaultErrorInfo - (plain : $catchResult) - AzAPICall: seems there are no valid Subscriptions present - skipping CostManagement on MG level - return 'NoValidSubscriptions'"
$response = @{
Expand Down Expand Up @@ -1713,7 +1723,7 @@ function getAzAPICallFunctions {
function getAzAPICallRuleSet {
return $function:AzAPICallErrorHandler.ToString()
}
function getAzAPICallVersion { return '1.2.2' }
function getAzAPICallVersion { return '1.2.3' }

function getJWTDetails {
<#
Expand Down
2 changes: 1 addition & 1 deletion pwsh/module/dev/AzAPICall/AzAPICall.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AzAPICall.psm1'

# Version number of this module.
ModuleVersion = '1.2.2'
ModuleVersion = '1.2.3'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
10 changes: 10 additions & 0 deletions pwsh/module/dev/AzAPICall/functions/AzAPICallRuleSet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ function AzAPICallErrorHandler {
$getARMCostManagement -and (
$catchResult.error.code -eq 404 -or
$catchResult.error.code -eq 'AccountCostDisabled' -or
$catchResult.error.code -eq 'SubscriptionCostDisabled' -or
$catchResult.error.message -like '*does not have any valid subscriptions*' -or
$catchResult.error.code -eq 'Unauthorized' -or
($catchResult.error.code -eq 'NotFound' -and $catchResult.error.message -like '*have valid WebDirect/AIRS offer type*') -or
Expand Down Expand Up @@ -328,6 +329,15 @@ function AzAPICallErrorHandler {
return $response
}

if ($catchResult.error.code -eq 'SubscriptionCostDisabled') {
Logging -preventWriteOutput $true -logMessage "$defaultErrorInfo - (plain : $catchResult) - AzAPICall: seems Access to cost data has been disabled for this Subscription - skipping CostManagement for this Subscription - return 'SubscriptionCostDisabled'"
$response = @{
action = 'return' #break or return or returnCollection
returnVar = 'SubscriptionCostDisabled'
}
return $response
}

if ($catchResult.error.message -like '*does not have any valid subscriptions*') {
Logging -preventWriteOutput $true -logMessage "$defaultErrorInfo - (plain : $catchResult) - AzAPICall: seems there are no valid Subscriptions present - skipping CostManagement on MG level - return 'NoValidSubscriptions'"
$response = @{
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
function getAzAPICallVersion { return '1.2.2' }
function getAzAPICallVersion { return '1.2.3' }

0 comments on commit 6826d07

Please sign in to comment.