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

Fail to create JIT Access Role - Operation returned an invalid status code 'Conflict' #919

Open
Enver-Adams opened this issue Nov 17, 2024 · 0 comments

Comments

@Enver-Adams
Copy link

Describe the bug

I have set the set-azcontext to the current subscription I would like to apply the JIT Access Role.

I am the owner of all the subscriptions in the tenant. I managed to run this successfully once, for the first time. I am trying to recreate this role in subsequent subscriptions for and when I specify any other subscription ID I run into the following error.

New-AzRoleDefinition: /home/enver/Set-JitLeastPrivilegedRole.ps1:86
Line |
86 | $newRole = New-AzRoleDefinition -Role $role
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Operation returned an invalid status code 'Conflict'
Fail to create JIT Access Role

To Reproduce
Steps to reproduce the behaviour:

  1. Run Set-AzContext -Subscription 'xxxx'
  2. Run ./Set-JitLeastPrivilegedRole.ps1 -subscriptionId 'xxxx'
  3. See error

Expected behaviour
I am able to run this command against any other subscription to recreate this role.

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

1 participant