How to avoid what-if-short-circuting
with system assigned managed identity?
#15691
Replies: 1 comment 1 reply
-
@o-l-a-v is it possible to show an example of your Often where I've seen this come up is a pattern like the following:
The problem this creates is that because Bicep isn't able to predict the "principalId" at the start of the deployment, it isn't able to predict the name of the role assignment resource, which means it's not able to give you any accurate predictions about the role assignment. To explain what I mean by "runtime", we often use the following terminology:
The linter rule is flagging any places where the use of a runtime value makes it impossible to predict the resourceId of a resource that is going to be deployed. The reason this is problematic is that WhatIf relies on being able to fetch the current state of the resource to diff against. If we can't accurately obtain the resourceId without starting the deployment, then we can't do this, and the whole resource is skipped in WhatIf. |
Beta Was this translation helpful? Give feedback.
-
The linter rule
what-if-short-circuting
complains about waiting for the output of a resource to get the ID of the system assigned managed identity which I then use for RBAC.I prefer using system assigned managed identity where possible. What options to we have to avoid What-If short circuting in this scenario? 🤔
Warning
Runtime value 'aa.outputs.msiId' will reduce the precision of what-if analysis for module 'subrbac'
Code snippet on the relevant resources:
Beta Was this translation helpful? Give feedback.
All reactions