Skip a parameter if its not defined in a loop #16635
cr0wen
started this conversation in
Authoring Help
Replies: 2 comments 2 replies
-
|
You could make the identity parameter optional much like you're doing with enforcementMode. Then do something like this: param identity object?
resource policyAssignments 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
name: name
scope: managementGroup()
location: location
identity: identity ?? null
properties: {
displayName: displayName
description: policyDescription
policyDefinitionId: policyDefinitionId
parameters: parameters
enforcementMode: enforcementMode
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
can be closed |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Im working with loops and im have some issues and wondering if there is a way around it or if its by design.
Now to the problem that i have. I have one policy that will use a identity and the other does not have a identity. The policy with a identity works because its defined in the policywithidentity.json file, but the other policywithoutidentity.json does not have idenity value defined in it. So the deployment fails, Is there a way to work around this?
Beta Was this translation helpful? Give feedback.
All reactions