-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Service Principal credential in Azure CLI? #8726
Comments
Just for my understanding: am I missing something? |
The endpoint authorization parameters (i.e., service principal id, key etc.) are not available as environment variables. I don't think it's recommended to access these directly from the bash script. @TingluoHuang - Please correct me if I'm wrong here. Regarding your requirement, I can think of two options:
|
I do not think the options you mentioned are viable, at least from my perspecitve:
It looks to me that no access to the service principal is a serious limitation that reduces the use cases for this task. |
Just to put a bit more context: my starting point was https://open.microsoft.com/2018/05/22/cicd-azure-terraform-ansible-vsts-java-springboot-app/ in which they use bash and store secrets in the release variables as you mentioned. This is quite annoying if you have many pipelines. And I do not see why it is safer. |
@andreacassioli Being able to pull out service principal credentials from a service connection in Azure CLI would be a security hole. In my company, someone with higher privileges than me sets up the service principal and sets up the service connection. This means I can use it, but I can't just steal credentials and take them home. However, if you own the credentials and time's of the essence, option 2. is the best one. |
@xenalite - Agreed. Thanks for your inputs. |
I see the security concern. My use case is exactly what @xenalite describes. Even though I own the credential (we are a small team, basically we all share the admin burden...) I do not need to Anyway, it seems I will have to define variables... Thank you for the feedback guys. |
@andreacassioli You can store sensitive values in a way that they cannot be seen or changed by users of the release pipelines. Please try this functionality, hope this will fulfill the requirements here. |
#8819 is trying to fix this issue |
@sachinma awesome! when is it planned to be released? |
We will start rolling it out this week and should reach all accounts in around 2-3 weeks. |
The fix has been rolled out. Please let us know if you are still facing the issue. |
@vineetmimrot So you approved a change that would expose credentials even though it was explicitly mentioned that it would be security role? |
It is not a security hole. If you can use the service connection, you can do whatever and that is with the same identity as if you took the credentials elsewhere and used them. |
@rhummelmose Let me refer you to my previous reply.
|
I am running on linux host agents in cloud VSTS some build pipelines where I use Azure CLI tasks to execute some az cli commands. All works fine as we have define some service principal.
However, I also would like to execute a Terraform command (in particular plan), that requires to specify explicitly the service principal credential:
https://www.terraform.io/docs/providers/azurerm/index.html#argument-reference
I have been looking at the env variables that Azure CLI provides and I cannot see those credential. Is there a way to get them somehow in bash?
The text was updated successfully, but these errors were encountered: