From 808dcee2661f160bfe4a5a6093bcde7a72d9ddf9 Mon Sep 17 00:00:00 2001 From: Shiying Chen Date: Thu, 20 Jun 2024 11:02:39 +0800 Subject: [PATCH] fix the bug for azurestack --- src/Cli/AzureCliLogin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cli/AzureCliLogin.ts b/src/Cli/AzureCliLogin.ts index 5db52b7c1..2c4c5f8f0 100644 --- a/src/Cli/AzureCliLogin.ts +++ b/src/Cli/AzureCliLogin.ts @@ -31,7 +31,7 @@ export class AzureCliLogin { await this.executeAzCliCommand(["version"], true, execOptions); core.debug(`Azure CLI version used:\n${output}`); - this.setAzurestackEnvIfNecessary(); + await this.registerAzurestackEnvIfNecessary(); await this.executeAzCliCommand(["cloud", "set", "-n", this.loginConfig.environment], false); core.info(`Done setting cloud: "${this.loginConfig.environment}"`); @@ -59,7 +59,7 @@ export class AzureCliLogin { } } - async setAzurestackEnvIfNecessary() { + async registerAzurestackEnvIfNecessary() { if (this.loginConfig.environment != "azurestack") { return; } @@ -85,7 +85,7 @@ export class AzureCliLogin { let suffixKeyvault = ".vault" + baseUri.substring(baseUri.indexOf('.')); // keyvault suffix starts with . let suffixStorage = baseUri.substring(baseUri.indexOf('.') + 1); // storage suffix starts without . let profileVersion = "2019-03-01-hybrid"; - await this.executeAzCliCommand(["cloud", "register", "-n", this.loginConfig.environment, "--endpoint-resource-manager", `"${this.loginConfig.resourceManagerEndpointUrl}"`, "--suffix-keyvault-dns", `"${suffixKeyvault}"`, "--suffix-storage-endpoint", `"${suffixStorage}"`, "--profile", `"${profileVersion}"`], false); + await this.executeAzCliCommand(["cloud", "register", "-n", this.loginConfig.environment, "--endpoint-resource-manager", this.loginConfig.resourceManagerEndpointUrl, "--suffix-keyvault-dns", suffixKeyvault, "--suffix-storage-endpoint", suffixStorage, "--profile", profileVersion], false); } catch (error) { core.error(`Error while trying to register cloud "${this.loginConfig.environment}"`);