mirror of
https://github.com/azure/login.git
synced 2026-03-12 18:07:08 -04:00
remove unregister cloud first
This commit is contained in:
@@ -4037,14 +4037,14 @@ class AzureCliLogin {
|
||||
if (!this.loginConfig.resourceManagerEndpointUrl) {
|
||||
throw new Error("resourceManagerEndpointUrl is a required parameter when environment is defined.");
|
||||
}
|
||||
core.info(`Unregistering cloud: "${this.loginConfig.environment}" first if it exists`);
|
||||
try {
|
||||
yield this.executeAzCliCommand(["cloud", "set", "-n", "AzureCloud"], true);
|
||||
yield this.executeAzCliCommand(["cloud", "unregister", "-n", this.loginConfig.environment], false);
|
||||
}
|
||||
catch (error) {
|
||||
core.info(`Ignore cloud not registered error: "${error}"`);
|
||||
}
|
||||
// core.info(`Unregistering cloud: "${this.loginConfig.environment}" first if it exists`);
|
||||
// try {
|
||||
// await this.executeAzCliCommand(["cloud", "set", "-n", "AzureCloud"], true);
|
||||
// await this.executeAzCliCommand(["cloud", "unregister", "-n", this.loginConfig.environment], false);
|
||||
// }
|
||||
// catch (error) {
|
||||
// core.info(`Ignore cloud not registered error: "${error}"`);
|
||||
// }
|
||||
core.info(`Registering cloud: "${this.loginConfig.environment}" with ARM endpoint: "${this.loginConfig.resourceManagerEndpointUrl}"`);
|
||||
try {
|
||||
let baseUri = this.loginConfig.resourceManagerEndpointUrl;
|
||||
|
||||
@@ -67,14 +67,14 @@ export class AzureCliLogin {
|
||||
throw new Error("resourceManagerEndpointUrl is a required parameter when environment is defined.");
|
||||
}
|
||||
|
||||
core.info(`Unregistering cloud: "${this.loginConfig.environment}" first if it exists`);
|
||||
try {
|
||||
await this.executeAzCliCommand(["cloud", "set", "-n", "AzureCloud"], true);
|
||||
await this.executeAzCliCommand(["cloud", "unregister", "-n", this.loginConfig.environment], false);
|
||||
}
|
||||
catch (error) {
|
||||
core.info(`Ignore cloud not registered error: "${error}"`);
|
||||
}
|
||||
// core.info(`Unregistering cloud: "${this.loginConfig.environment}" first if it exists`);
|
||||
// try {
|
||||
// await this.executeAzCliCommand(["cloud", "set", "-n", "AzureCloud"], true);
|
||||
// await this.executeAzCliCommand(["cloud", "unregister", "-n", this.loginConfig.environment], false);
|
||||
// }
|
||||
// catch (error) {
|
||||
// core.info(`Ignore cloud not registered error: "${error}"`);
|
||||
// }
|
||||
|
||||
core.info(`Registering cloud: "${this.loginConfig.environment}" with ARM endpoint: "${this.loginConfig.resourceManagerEndpointUrl}"`);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user