Skip to content

Commit 371c6f2

Browse files
committed
Update error handling in createBearerToken function to include additional error patterns and change version to 1.3.3
1 parent e2e89d0 commit 371c6f2

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

pwsh/module/build/AzAPICall.zip

0 Bytes
Binary file not shown.

pwsh/module/build/AzAPICall/functions/AzAPICallFunctions.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@ function createBearerToken {
16321632
if (($AzApiCallConfiguration['htParameters']).codeRunPlatform -eq 'GitHubActions') {
16331633
if (($AzApiCallConfiguration['htParameters']).GitHubActionsOIDC) {
16341634
if (($AzApiCallConfiguration['htParameters']).GitHubActionsOIDC -eq $true) {
1635-
if ($_ -like '*AADSTS700024*') {
1635+
if ($_ -like '*AADSTS700024*' -or $_ -like '*ClientAssertionCredential authentication failed*') {
16361636
Logging -logMessage " Running on '$(($AzApiCallConfiguration['htParameters']).codeRunPlatform)' OIDC: '$(($AzApiCallConfiguration['htParameters']).GitHubActionsOIDC)' - Getting Bearer Token from Login endpoint '$(($AzApiCallConfiguration['azAPIEndpointUrls']).Login)'"
16371637

16381638
$audience = 'api://AzureADTokenExchange'
@@ -1685,7 +1685,7 @@ function createBearerToken {
16851685
}
16861686
elseif (($AzApiCallConfiguration['htParameters']).codeRunPlatform -eq 'AzureDevOps') {
16871687
if (($AzApiCallConfiguration['htParameters']).accountType -eq 'ClientAssertion') {
1688-
if ($_ -like '*ClientAssertionCredential authentication failed*') {
1688+
if ($_ -like '*AADSTS700024*' -or $_ -like '*ClientAssertionCredential authentication failed*') {
16891689
Logging -logMessage " Running on '$(($AzApiCallConfiguration['htParameters']).codeRunPlatform)' OIDC: '$(($AzApiCallConfiguration['htParameters']).accountType)' - Getting Bearer Token from Login endpoint '$(($AzApiCallConfiguration['azAPIEndpointUrls']).Login)'"
16901690

16911691
if ([string]::IsNullOrWhiteSpace($env:SYSTEM_ACCESSTOKEN)) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
function getAzAPICallVersion { return '1.3.3.2' }
1+
function getAzAPICallVersion { return '1.3.3' }

0 commit comments

Comments
 (0)