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

AzureRM delegated user access? #12208

Closed
glenjamin opened this issue Feb 23, 2017 · 4 comments
Closed

AzureRM delegated user access? #12208

glenjamin opened this issue Feb 23, 2017 · 4 comments

Comments

@glenjamin
Copy link
Contributor

Terraform Version

terraform 0.8.7

Affected Resource(s)

Azure Provider

I've been using terraform to configure a few things with the azurerm provider, which is broadly working well.

The part I'm not entirely keen on is how I have to create an Azure AD application that has appropriate permissions to perform resource operations per user who I want to have that ability - and annoyingly that azure apps can't be added to groups for permissions.

Clearly this isn't really terraform's fault. Azure AD applications are also allowed to run in a delegated resource mode, where they perform commands as the user in question - this is how the NodeJS, Python CLI apps and the Powershell Cmdlets work. The python code samples are relatively easy to follow here: https://github.com/AzureAD/azure-activedirectory-library-for-python

Currently terraform is effectively using the "Acquire Token with Client Credentials" method whereas the other CLI tools use "Acquire Token with device code".

Is this something that terraform could be extended to support?

Annoyingly there's no existing go code in the AzureAD org, but the pieces it uses all seem to be standard parts of OAuth2. The other downside is that the token only lasts for 1 hour, but does provide a refresh token that can be used to get a fresh one.

Perhaps an "easy" extension would be to allow terraform to accept the fully resolved azure bearer token, and then it would be possible for users to use their own mechanism to get and keep a valid bearer token if they wanted?

@mynkow
Copy link

mynkow commented Mar 10, 2017

I am a terraform newbe
I am fighting this for 2 days and I still cant configure Azure to work with terraform. I did not find any tutorial which is working how to do this configuration.

@bpoland
Copy link

bpoland commented Jun 6, 2017

Yeah, would be great if you could log in with the az CLI or something to get a token, and then use that with Terraform to authenticate against Azure.

@KJTsanaktsidis
Copy link

Yup - would be awesome if Terraform could use the bearer tokens that the aqzure CLI can generate. Then you could do something like export TF_VAR_bearer_token="$(az account get-access-token | jq -r .accessToken)" and use terraform like normal.

@ghost
Copy link

ghost commented Apr 9, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants