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

test: add object ID azure resource group assignment (🚧) #215

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stijnmoreels
Copy link
Member

No description provided.

@stijnmoreels stijnmoreels marked this pull request as draft August 19, 2021 05:38
@netlify
Copy link

netlify bot commented Aug 19, 2021

✔️ Deploy Preview for arcus-scripting canceled.

🔨 Explore the source changes: fb0ee04

🔍 Inspect the deploy log: https://app.netlify.com/sites/arcus-scripting/deploys/611dee37ebbdbb000793dfd7

@stijnmoreels
Copy link
Member Author

I may need some help with this one as I don't really know how to set this up properly to test. I thought I could test it by giving our automation user lower access (Reader) to another resource group, but that's either failing with a general exception (see below), or failing when it gets removed in the tear down.

WARNING: Failed to grant access: Microsoft.Rest.Azure.CloudException: Exception of type
'Microsoft.Rest.Azure.CloudException' was thrown.
   at Microsoft.Azure.Graph.RBAC.ObjectsOperations.<GetObjectsByObjectIdsWithHttpMessagesAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Graph.RBAC.ObjectsOperationsExtensions.<GetObjectsByObjectIdsAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Azure.Graph.RBAC.ObjectsOperationsExtensions.GetObjectsByObjectIds(IObjectsOperations operations,
   at Microsoft.Azure.Commands.ActiveDirectory.ActiveDirectoryClient.GetObjectsByObjectId(List`1 objectIds)
Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient.CreateRoleAssignment(FilterRoleAssignmentsOptio ns parameters, Guid roleAssignmentId)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()

@stijnmoreels stijnmoreels changed the title test: add object ID azure resource group assignment test: add object ID azure resource group assignment (🚧) Aug 19, 2021
@mbraekman
Copy link
Contributor

I may need some help with this one as I don't really know how to set this up properly to test. I thought I could test it by giving our automation user lower access (Reader) to another resource group, but that's either failing with a general exception (see below), or failing when it gets removed in the tear down.

WARNING: Failed to grant access: Microsoft.Rest.Azure.CloudException: Exception of type
'Microsoft.Rest.Azure.CloudException' was thrown.
   at Microsoft.Azure.Graph.RBAC.ObjectsOperations.<GetObjectsByObjectIdsWithHttpMessagesAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Graph.RBAC.ObjectsOperationsExtensions.<GetObjectsByObjectIdsAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Azure.Graph.RBAC.ObjectsOperationsExtensions.GetObjectsByObjectIds(IObjectsOperations operations,
   at Microsoft.Azure.Commands.ActiveDirectory.ActiveDirectoryClient.GetObjectsByObjectId(List`1 objectIds)
Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient.CreateRoleAssignment(FilterRoleAssignmentsOptio ns parameters, Guid roleAssignmentId)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()

I would need to invest some time in this issue to investigate it, as I've noticed that this either fails with the general exception as you've mentioned above, on the initial creating - even when the creation has actually succeeded.
When executing the same command a second time it will then simply indicate that the assignment already exists.
But I haven't been able to figure out how or why this exception is being thrown or how to drill down into the exception-details to discover if this can be skipped or not.

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 this pull request may close these issues.

2 participants