Azure / Azure/azure-rest-api-specs
Microsoft.Security/governanceRules API not idempotent
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
Hi,
This is linked to the following issue: https://github.com/Azure/bicep-types-az/issues/1664#event-9605619956
I can create a new Azure Defender For Cloud Governance rule via Bicep (see API call issue above).
If the same IaC is executed a second time, I get the error
```
[{"code":"GovernanceRulePriorityConflict","message":"Rule priority 1 already exist"}
```
As name of the resource I specify the following parameter:
```
param highGovRoleGuid string = newGuid()
```
Can you make the necessary adjustments to the REST API so that the same code can un twice without error?
Contributor guide
Research direction
Start with the linked bicep-types-az issue and reproduce the reported Azure Defender for Cloud governance-rule deployment twice using the shown newGuid parameter. Trace the Microsoft.Security/governanceRules REST behavior around the GovernanceRulePriorityConflict response; done means the same IaC can run again without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100