Azure / Azure/arm-template-whatif

Role Assignment with different `name` wasn't detected

Open
#322 0 comments 1 reaction 0 assignees View on GitHub
Needs Triage :mag:
Dominant language
HTML
Stars
101
Forks
21
Avg merge
3h 35m
Merged PRs (30d)
1

Description

**Describe the bug**
Role Assignment with different `name` wasn't detected as a change.

**To Reproduce**
Steps to reproduce the behavior:
1. In Azure Portal, manually create role assignment on an App Config Service for an APIM
2. In a bicep deployment script, define that same role assignment using a GUID that is generated from the `guid` function.
3. Run `New-AzDeployment` passing the bicep template file and with `-WhatIf:True`
4. WhatIf doesn't list the role assignment as being different
5. If you run `New-AzDeployment` passing the bicep template file and **without** `-WhatIf:True`, the deployment will fail with "role assignment already exists" similar to this issue https://github.com/Azure/azure-quickstart-templates/issues/4205

**Expected behavior**
If the deployment would result in an error, then whatif should fail to validate

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Client** [e.g. PowerShell, CLI, API)
PowerShell

**Additional context**
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue by creating the role assignment in Azure Portal, defining it in a Bicep deployment with a generated GUID, and running New-AzDeployment with -WhatIf. Compare the existing and declared role assignment names, then verify that What-If reports the conflict or validation failure that causes the real deployment to fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.