@@ -656,15 +656,15 @@ public static string GetAzAccessToken(PSCmdlet cmdletPassedIn)
656656
657657 var credOptions = new DefaultAzureCredentialOptions
658658 {
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
668668 } ;
669669
670670 var dCred = new DefaultAzureCredential ( credOptions ) ;
@@ -681,12 +681,12 @@ public static string GetAzAccessToken(PSCmdlet cmdletPassedIn)
681681 catch ( OperationCanceledException )
682682 {
683683 cmdletPassedIn . WriteWarning ( "Timeout occurred while acquiring Azure access token." ) ;
684- throw ;
684+ return null ;
685685 }
686686 catch ( Exception ex )
687687 {
688688 cmdletPassedIn . WriteWarning ( $ "Failed to acquire Azure access token: { ex . Message } ") ;
689- throw ;
689+ return null ;
690690 }
691691 }
692692
0 commit comments