-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[BUG]: AzureCLI@2 task ignores existing optimizations on hosted agent #19209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Something like: private static setConfigDirectory(): void {
if (tl.getBoolInput("useGlobalConfig") || !!tl.getVariable("agent.cloudid")) {
return;
}
if (!!tl.getVariable('Agent.TempDirectory')) {
var azCliConfigPath = path.join(tl.getVariable('Agent.TempDirectory'), ".azclitask");
console.log(tl.loc('SettingAzureConfigDir', azCliConfigPath));
process.env['AZURE_CONFIG_DIR'] = azCliConfigPath;
} else {
console.warn(tl.loc('GlobalCliConfigAgentVersionWarning'));
}
} or private static setConfigDirectory(): void {
if (tl.getBoolInput("useGlobalConfig")) {
return;
}
if (!!tl.getVariable('Agent.TempDirectory')) {
if (!!tl.getVariable("agent.cloudid"))
{
console.log("Consider setting 'useGlobalConfig: true' for significantly higher performance");
}
var azCliConfigPath = path.join(tl.getVariable('Agent.TempDirectory'), ".azclitask");
console.log(tl.loc('SettingAzureConfigDir', azCliConfigPath));
process.env['AZURE_CONFIG_DIR'] = azCliConfigPath;
} else {
console.warn(tl.loc('GlobalCliConfigAgentVersionWarning'));
}
} |
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
Not stale! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Task name
AzureCLI
Task version
2
Environment type (Please select at least one environment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Operation system
Windows-latest
Task log
n/a
Relevant log output
Aditional info
The Azure Pipelines Hosted Agent images take extra care making sure that azure-cli is configured, pre-compiled, all required additional packages have been installed and the command index has been built.
By redirecting the
AZURE_CONFIG_DIR
to the agent's temp directory, all of that goes to waste and the performance difference is quite high. On the Windows Hosted Agents the time to run a simple command is about 1 extra minute than is needed.Setting the
useGlobalConfig: true
prevents the overriding of the azure configuration directory.I'm proposing that when:
AZURE_CONFIG_DIR
environment variable is already setThen:
AZURE_CONFIG_DIR
variableOR:
useGlobalConfig
isn't explicitly set tofalse
to indicate the perf improvement that's possible by introducing this setting.The method that would be changed:
azure-pipelines-tasks/Tasks/AzureCLIV2/azureclitask.ts
Lines 181 to 193 in 16dcae9
useGlobalConfig
with bothtrue
andfalse
on the hosted agent, in the same job. hence my alternative of logging the suggestion.The text was updated successfully, but these errors were encountered: