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

Initial Azure SSH work; login and installer #139

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

p0-andrewa
Copy link
Contributor

This PR represents the start of work on Azure SSH in the P0 CLI. It adds a basic shell of an azureSshProvider that is the bare minimum needed to start development work, and implements automated installers for both Homebrew (required for installing the Azure CLI on macOS) and the Azure CLI (az) itself, and a simple call to az login to log in to Azure when p0 ssh --provider azure is invoked.

Testing requires rebasing this branch on the azure-ssh-dev-base branch (or cherry-picking that branch on top of this one), which contains the scaffolding currently necessary to invoke Azure SSH.

Tested the Homebrew and az installers locally by setting my PATH to not include /opt/homebrew (which covers az as well) and then running ./p0 ssh --provider azure test. Answering "no" to the "Do you want P0 to install these for you?" prompt correctly prints the required commands. I also replaced the Homebrew install script with a dummy script to test that the invocation works correctly when answering "yes" to the same prompt.

With az installed, you are prompted to log in to Azure, as expected, when invoking the same command.

Invoking with PATH hack to simulate missing brew/az, without automated install:
Azure SSH missing commands

Invoking with PATH hack, accepting automated install, but replacing the normal Homebrew install script with my testing script:
Automated installer test
Note that the failure to invoke brew to install az is expected, since I replaced the Homebrew install script with one that doesn't install Homebrew.

Adds a basic shell of an `azureSshProvider`, support for installing
Homebrew and the Azure CLI tool (`az`), and calling out to `az` to log
in to Azure.
@p0-andrewa p0-andrewa requested a review from GGonryun November 9, 2024 01:23
@p0-andrewa p0-andrewa self-assigned this Nov 9, 2024
@p0-andrewa p0-andrewa merged commit e9b2244 into main Nov 13, 2024
3 checks passed
@p0-andrewa p0-andrewa deleted the andrewadams/eng-2550-azure-implement-cli-login branch November 13, 2024 03:07
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.

2 participants