Microsoft.Authorization/roleEligibilityScheduleRequests API not idempotent? #8075
-
The process for manually adding/updating multiple PIM eligibility assignments is incredibly tedious. We're trying to programmatically create these using Bicep templates. However, the Bicep API doesn't seem to be idempotent. This isn't ideal for redeploying template to update existing assignments' properties. Here's the template we're using for a single Bicep PIM assignment deployment:
We're deploying at Subscription scope with When re-deploying this template we recieve an "Assignment already exists" error. It seems that we'd need to find and delete the existing assignment before we can update it. Is this an API limitation, or will we be able to update existing assignments by redeploying via Bicep in future? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@MPowellFDB You are correct, this API is not idempotent. You have to provide a new guid each time you change or even delete the scheduleRequest. I simply use the following and it works fine. param name string = newGuid() Also note that when I roleElegibilitySchedule is activated, you are unable to modify them and the deployment will fail. |
Beta Was this translation helpful? Give feedback.
@MPowellFDB You are correct, this API is not idempotent.
You have to provide a new guid each time you change or even delete the scheduleRequest.
I simply use the following and it works fine.
Also note that when I roleElegibilitySchedule is activated, you are unable to modify them and the deployment will fail.