File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,13 @@ export class AzureCliLogin {
114114 }
115115
116116 async loginWithUserAssignedIdentity ( args : string [ ] ) {
117- const azcliMinorVersion = parseInt ( this . azVersion . split ( '.' ) [ 1 ] , 10 ) ;
117+ let azcliMinorVersion = 0 ;
118+ try {
119+ azcliMinorVersion = parseInt ( this . azVersion . split ( '.' ) [ 1 ] , 10 ) ;
120+ }
121+ catch ( error ) {
122+ core . warning ( "Failed to parse the minor version of Azure CLI. Assuming the version is less than 2.69.0" ) ;
123+ }
118124 //From Azure-cli v2.69.0, `--username` is replaced with `--client-id`, `--object-id` or `--resource-id`: https://github.com/Azure/azure-cli/pull/30525
119125 if ( azcliMinorVersion < 69 ) {
120126 args . push ( "--username" , this . loginConfig . servicePrincipalId ) ;
You can’t perform that action at this time.
0 commit comments