-
Notifications
You must be signed in to change notification settings - Fork 161
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 userAssignedIdentity to AAD group #858
Conversation
Manual test results using (Control) No groups``` Compatible version of Azure CLI 2.29.1 detected Checking Azure CLI logged in status... you are already logged in, nothing to do. Using subscription '***' (***). Creating resource group aad-identity-group (1/1)... Deploying ARM template (please be patient, this can take a while)... All done, now parsing ARM response to get any outputs... Press any key to continue . . . ```Add to group``` Compatible version of Azure CLI 2.29.1 detected Checking Azure CLI logged in status... you are already logged in, nothing to do. Using subscription '***' (***). Creating resource group aad-identity-group (1/1)... Deploying ARM template (please be patient, this can take a while)... Getting object id for identity 'my-test-identity' Adding identity 'my-test-identity' (***) to group '***'...OK: my-test-identity added to group '***' All done, now parsing ARM response to get any outputs... Press any key to continue . . . ```Add to group already containing member``` Compatible version of Azure CLI 2.29.1 detected Checking Azure CLI logged in status... you are already logged in, nothing to do. Using subscription '***' (***). Creating resource group aad-identity-group (1/1)... Deploying ARM template (please be patient, this can take a while)... Getting object id for identity 'my-test-identity' Adding identity 'my-test-identity' (***) to group '***'...OK: my-test-identity already in group '***' All done, now parsing ARM response to get any outputs... Press any key to continue . . . ```Non-existent AAD group``` Compatible version of Azure CLI 2.29.1 detected Checking Azure CLI logged in status... you are already logged in, nothing to do. Using subscription '***' (***). Creating resource group aad-identity-group (1/1)... Deploying ARM template (please be patient, this can take a while)... Getting object id for identity 'my-test-identity' Adding identity 'my-test-identity' (***) to group 'my-aad-group'...Farmer.FarmerException: ERROR: No group matches the name of 'my-aad-group'at Farmer.Exceptions.raiseFarmer[a](String msg) in C:\dev\farmer\src\Farmer\Result.fs:line 7
|
Is there some way to assign these groups with an ARM deployment? |
Not that I could find. There is also this question which implies it's not
possible:
https://docs.microsoft.com/en-us/answers/questions/214227/can-we-add-users-group-azure-ad-using-arm-template.html
|
We shouldn't put it in the same builder, then. There is no way to tell that this isn't going to be in the resulting template. |
Maybe this should be a CLI wrapper only and go in the |
I thought the whole point of PostDeploy actions was to do things exactly like this from the builder? Similar to webapp's Or is the concern the location of the logic rather than the addition of an operator in the builder? |
Those two are rolling out your application code to those resources. |
I'm in two minds here. I'm not specifically opposed to this as a post-deploy action personally - it's not the end of the world if some bits go into the CLI as well as ARM - as long as everything that can go into ARM, does. Then again, for the AD side of things, we already have some CLI helpers - could this not be one of them? I'm not sure I have the answer here. I think maybe it's about the declarative nature of "I want to create this identity, it's part of these groups" as a declarative statement - in which case this might be fine. This is the approach we took for the upload app stuff. |
It may make sense to have some CLI wrappers around AD group assignments, but I don't think it's a good idea to tie them to user assigned identities. You have to have much greater permissions to manage AD group assignments than to simply create an identity for a resource, so this would be a deployment that would partially fail in a lot of cases. Also you can't really even do them through ARM deployments, and this limitation isn't really clear to a user that's creating the resource. |
I was hoping to achieve the declarative statement as mentioned by isaac but I do see that this would be confusing for users who only use Farmer as an ARM generator (rather than a deployment tool).
I'm assuming that |
Hi @TheRSP - can we look at getting the conflicts dealt with? Thanks |
This PR closes #857
The changes in this PR are as follows:
I have read the contributing guidelines and have completed the following:
If I haven't completed any of the tasks above, I include the reasons why here:
Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure: