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

Improved login #33

Open
carolynvs opened this issue Jan 4, 2022 · 5 comments · May be fixed by #74
Open

Improved login #33

carolynvs opened this issue Jan 4, 2022 · 5 comments · May be fixed by #74

Comments

@carolynvs
Copy link
Member

Logging in is a pain right now. You have to specify it for each action, and pass in a bunch of flags and remember to suppress output:

- az: 
      description: "Logging into Azure..."  
      arguments:
        - login
      flags:
        service-principal: ""
        username: "'{{bundle.credentials.AZURE_CLIENT_ID}}'"
        password: "'{{bundle.credentials.AZURE_CLIENT_SECRET}}'"
        tenant: "'{{bundle.credentials.AZURE_TENANT_ID}}'"
      suppress-output: true

We could add a custom login command to the mixin to simplify the default login, which assumes the default environment variable names:

install:
- az:
     login:

In addition, we could have the mixin detect if we are logged in (a file gets stored in ~/.azure after login) before running a command and then automatically logging in if needed.

@Doommius
Copy link

It would be awesome if support was added for using azcli credentials like Packer , as you'd be able to use a service principle from azure pipelines and handle permissions that way.

@lbergnehr
Copy link

That should be possible now that you can mount the ~/.azure directory into the invocation image.

@lbergnehr lbergnehr linked a pull request Dec 17, 2024 that will close this issue
3 tasks
@lbergnehr
Copy link

lbergnehr commented Dec 17, 2024

I drafted #74. Please have a look and let me know if this is on the right track to solving this issue @kichristensen , @schristoff .

@kichristensen
Copy link
Contributor

@lbergnehr Thank you for working on this, it looks like a good way to handle this issue. I have a few comments, nothing big, but I didn't want to add them to the PR yet, as it is still in draft. If you want me to add them, please let me know, just don't know how "draft" the PR is in the current state :)

@lbergnehr
Copy link

@lbergnehr Thank you for working on this, it looks like a good way to handle this issue. I have a few comments, nothing big, but I didn't want to add them to the PR yet, as it is still in draft. If you want me to add them, please let me know, just don't know how "draft" the PR is in the current state :)

No problem adding them now from my side! I added a checklist in the PR of things I already know are missing and that I thought I'd add if I would continue finishing this up.

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 a pull request may close this issue.

4 participants