Skip to content

Commit a3a8ebd

Browse files
committed
update
1 parent 07c8f44 commit a3a8ebd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Cli/AzureCliLogin.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)