Skip to content

Add @patch decorator for Azure Policy DINE scenarios#18954

Open
jmorerice wants to merge 7 commits intomainfrom
joshuamoraes/patchPolicy-decorator
Open

Add @patch decorator for Azure Policy DINE scenarios#18954
jmorerice wants to merge 7 commits intomainfrom
joshuamoraes/patchPolicy-decorator

Conversation

@jmorerice
Copy link
Copy Markdown
Contributor

@jmorerice jmorerice commented Feb 4, 2026

  • Add patch experimental feature flag (disabled by default)

  • Decorator emits 'method: PATCH' on resource properties

  • Feature is hidden until explicitly enabled via bicepconfig.json

  • Integration tests

- Add patchPolicy experimental feature flag (disabled by default)

- Decorator emits 'method: PATCH' on resource with properties from decorator body

- Feature is hidden until explicitly enabled via bicepconfig.json

- Add comprehensive integration tests
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

Test this change out locally with the following install scripts (Action run 21924444107)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 21924444107
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 21924444107"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 21924444107
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 21924444107"

@jmorerice jmorerice requested a review from majastrz February 5, 2026 00:03
@jmorerice jmorerice changed the title Add @patchPolicy decorator for Azure Policy DINE scenarios Add @patch decorator for Azure Policy DINE scenarios Feb 6, 2026
Introduces the @patch() decorator that allows resources to use the PATCH HTTP method instead of PUT when deployed. This enables partial updates to existing Azure resources.

Usage:
@patch()
resource myResource 'Microsoft.Authorization/policyDefinitions@2021-06-01' = {
  name: 'my-policy'
  properties: { ... }
}

The decorator is gated behind the 'patch' experimental feature flag.
@jmorerice jmorerice requested a review from shenglol February 6, 2026 23:43
@jmorerice jmorerice marked this pull request as ready for review February 10, 2026 17:59
Copy link
Copy Markdown
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Copy Markdown
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants