Skip to content
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

Fix #175: Mount AZURE_CONFIG_DIR folder instead of ~/.azure #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MoChilia
Copy link
Member

@MoChilia MoChilia commented Jan 15, 2025

Due to a breaking change made in the latest GitHub runner image, AZURE_CONFIG_DIR was set to /opt/az-config. Since Azure/cli used to mount the ~/.azure folder as the user's Azure configuration directory, this will cause Azure/cli to not work with Azure/login. In this pr, we will mount AZURE_CONFIG_DIR folder instead of ~/.azure, and reset the AZURE_CONFIG_DIR to /root/.azure within this action.

Test: https://github.com/Azure/azclitools-actions-test/actions/runs/12782376451/job/35631745972

Close #175

@MoChilia MoChilia requested review from jiasli and YanaXu January 15, 2025 05:26
@MoChilia MoChilia self-assigned this Jan 15, 2025
@@ -52,6 +52,9 @@ export async function main() {
inlineScript = ` set -e >&2; echo '${START_SCRIPT_EXECUTION_MARKER}' >&2; ${inlineScript}`;
scriptFileName = await createScriptFile(inlineScript);

const azureConfigDir = process.env.AZURE_CONFIG_DIR || path.join(process.env.HOME, '.azure');
process.env.AZURE_CONFIG_DIR = '/root/.azure';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the AZURE_CONFIG_DIR env var of the host.

If any Azure CLI command is run after docker run is executed, it will see AZURE_CONFIG_DIR as /root/.azure which doesn't exist on the host.

I would recommend exactly setting AZURE_CONFIG_DIR env var of the docker process via -e, --env, instead of inheriting from process.env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Action is not compatible with latest Github base image
2 participants