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

Add login command #74

Merged
merged 7 commits into from
Jan 24, 2025
Merged

Add login command #74

merged 7 commits into from
Jan 24, 2025

Conversation

lbergnehr
Copy link
Contributor

@lbergnehr lbergnehr commented Dec 17, 2024

Closes #33.

  1. Check for the existence of ~/.azure, which signals we're already
    logged in using some means.
  2. Check the environment for a service principal as defined by the
    environment variables AZURE_CLIENT_ID, AZURE_TENANT_ID, and
    AZURE_CLIENT_SECRET.
  3. Check the AZURE_CLIENT_ID environment variable for the client ID of
    a user-assigned managed identity.
  4. Use the system-assigned managed identity for the Azure resource if
    it's enabled.
  • Add documentation.
  • Use a good default command/flags for when mounting .azure directory.

@lbergnehr lbergnehr mentioned this pull request Dec 17, 2024
@lbergnehr lbergnehr force-pushed the main branch 3 times, most recently from c259af5 to 25cbf5d Compare December 17, 2024 13:23
@kichristensen
Copy link
Contributor

It think it would be beneficial to add some examples to the documentation showing the different ways to login

1. Check for the existence of `~/.azure`, which signals we're already
   logged in using some means.
2. Check the environment for a service principal as defined by the
   environment variables `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and
   `AZURE_CLIENT_SECRET`.
3. Check the `AZURE_CLIENT_ID` environment variable for the client ID of
   a user-assigned managed identity.
4. Use the system-assigned managed identity for the Azure resource if
   it's enabled.

Signed-off-by: Leo Bergnéhr <[email protected]>
Signed-off-by: Leo Bergnéhr <[email protected]>
- Refactor some common code into method.
- Use `true` as a no-op command when using an existin .azure directory.
- Fix indentation.

Signed-off-by: Leo Bergnéhr <[email protected]>
@lbergnehr lbergnehr marked this pull request as ready for review January 21, 2025 12:41
@kichristensen kichristensen merged commit 29f44ca into getporter:main Jan 24, 2025
2 checks passed
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.

Improved login
2 participants