@@ -656,15 +656,15 @@ public static string GetAzAccessToken(PSCmdlet cmdletPassedIn)
656
656
657
657
var credOptions = new DefaultAzureCredentialOptions
658
658
{
659
- ExcludeEnvironmentCredential = true ,
660
- ExcludeVisualStudioCodeCredential = true ,
661
- ExcludeVisualStudioCredential = true ,
662
- ExcludeWorkloadIdentityCredential = true ,
663
- ExcludeManagedIdentityCredential = true , // ManagedIdentityCredential makes the experience slow
664
- ExcludeSharedTokenCacheCredential = true , // SharedTokenCacheCredential is not supported on macOS
665
- ExcludeAzureCliCredential = false ,
666
- ExcludeAzurePowerShellCredential = false ,
667
- ExcludeInteractiveBrowserCredential = false
659
+ ExcludeEnvironmentCredential = true ,
660
+ ExcludeVisualStudioCodeCredential = true ,
661
+ ExcludeVisualStudioCredential = true ,
662
+ ExcludeWorkloadIdentityCredential = true ,
663
+ ExcludeManagedIdentityCredential = true , // ManagedIdentityCredential makes the experience slow
664
+ ExcludeSharedTokenCacheCredential = true , // SharedTokenCacheCredential is not supported on macOS
665
+ ExcludeAzureCliCredential = false ,
666
+ ExcludeAzurePowerShellCredential = false ,
667
+ ExcludeInteractiveBrowserCredential = false
668
668
} ;
669
669
670
670
var dCred = new DefaultAzureCredential ( credOptions ) ;
@@ -681,12 +681,12 @@ public static string GetAzAccessToken(PSCmdlet cmdletPassedIn)
681
681
catch ( OperationCanceledException )
682
682
{
683
683
cmdletPassedIn . WriteWarning ( "Timeout occurred while acquiring Azure access token." ) ;
684
- throw ;
684
+ return null ;
685
685
}
686
686
catch ( Exception ex )
687
687
{
688
688
cmdletPassedIn . WriteWarning ( $ "Failed to acquire Azure access token: { ex . Message } ") ;
689
- throw ;
689
+ return null ;
690
690
}
691
691
}
692
692
0 commit comments