onlyIfNotExists #19690
Replies: 1 comment
|
@onlyIfNotExists works by checking the name of the resource. This means only it will work if the resource name is the same. The error that you see is coming from the Resource provider. The resource provider does not allow having a role assignment with the same properties - service principal, role definition and scope deployed more than once when it is with different name. So @onlyIfNotExists works but you need to understand that it checks for resource with the same name. If the name of the role assignment is the same it will work. Imagine deploying VM resource with different name and you expect to not deploy it because you have the another VM with same parameters but with different name. The only difference with role assignment resource is because the role assignment resource does not allow having a resource with same parameters deployed more than once. |
Uh oh!
There was an error while loading. Please reload this page.
I thought if I used @onlyIfNotExists on the role assignments it would recognize the role assignment already existed. the deployed fails basically with the assignment already exist. Can someone explain why this does not work on existing role assignments?
Thanks,
Patti
All reactions