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

azure:login: make deps explicit #108

Open
katcipis opened this issue Apr 28, 2017 · 8 comments
Open

azure:login: make deps explicit #108

katcipis opened this issue Apr 28, 2017 · 8 comments

Comments

@katcipis
Copy link
Contributor

katcipis commented Apr 28, 2017

The way we do login today is practical but obligates the user to export env vars (credentials could be loaded from other place) and also does not make dependencies explicit (instead of using code to make deps explicit we use documentation, that can lie, specially about runtime dependencies like env vars). I propose we change azure_login to:

fn azure_login(service_principal, tenantid, clientid, secretid) {
}

And create another azure_login_from_env, or azure_login_env (or another name), that loads env vars according to the pattern established on the project and calls the azure_login function.

@vitorarins
Copy link
Contributor

I agree completely. But I think it should be subscription instead of service_principal. Am I tripping?

@i4ki
Copy link

i4ki commented Apr 28, 2017

but then klb users will have to invoke azure_login passing the environment variables anyway.
I'm not against this change, only missing the benefits.

@katcipis
Copy link
Contributor Author

@tiago4orion why they have to use env vars ? it is not required, we assumed that was the best way. It could be a config file that is loaded from the user HOME (like aws/azure cli).

We can go on using env vars, from another helper function, but it seems like a good idea to have a explicit login function that is not coupled with environment variables.

@katcipis
Copy link
Contributor Author

Even the name change seems advantageous to me, it is very odd to just call azure_login with no parameters and it just works, or not :-P

azure_login_env would make the env vars explicit and give an option to people who want to handle this differently.

I think @ppizarro is one of these people =)

@i4ki
Copy link

i4ki commented Apr 28, 2017

got it! Only wondering for real use cases for that. Thanks!

@katcipis
Copy link
Contributor Author

@vitorarins it was @lborguetti who called like that, I never inspected in details. I looked here:

https://github.com/NeowayLabs/klb/blob/master/azure/login.sh#L24

And it seems that it is a username...got a little confused. @lborguetti some help ?

@vitorarins
Copy link
Contributor

@katcipis Ok then.

@tiago4orion maybe a use case would be automating resources in more than one subscription.

@ppizarro
Copy link
Contributor

ppizarro commented Apr 30, 2017 via email

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

No branches or pull requests

4 participants