Azure / Azure/bicep

Partial Bicep file to flip a property on an existing resource (PATCH or PUT/CH) method for ARM

Open
#10,781 2 comments 10 reactions 0 assignees View on GitHub
Needs: Upvote
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 4h
Merged PRs (30d)
81

Description

### Discussed in https://github.com/Azure/bicep/discussions/9034

**Original title: Partial Bicep file to flip a property on an existing resource**

Originally posted by **stan-sz** November 15, 2022
Scenario: flip a property on all existing resources of a given type across RGs or regions.

Can below syntax (and semantics) be possible to just modify a property on an existing resource (see also #9033):

```bicep
param accountName string
param location string

resource sa 'Microsoft.Storage/storageAccounts' existing = {
name: accountName
location: location
properties: {
supportsHttpsTrafficOnly: true
}
}
```

This could help turn Bicep to be declarative language to run some operator actions instead of a full deployment of all resources (the idea for the snippet was taken from #8725).

### additional comment.
Here is something interesting that I spotted with the AKS RP today with the latest API

- It looks like they created their own `incremental` mode for adding or modifying individual properties 😁

```bicep
resource AKS 'Microsoft.ContainerService/managedClusters@2023-01-01' = {
name: 'aeu1-pe-ctl-d1-aks01'
location: resourceGroup().location
properties: {
mode: 'Incremental'
azureMonitorProfile: {
metrics: {
enabled: true
kubeStateMetrics: {
metricLabelsAllowlist: ''
metricAnnotationsAllowList: ''
}
}
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the linked discussion #9034 and related issue #9033, then examine how the shown existing-resource syntax maps to ARM resource updates. The work is done when the supported PATCH or PUT/CH behavior, syntax, and semantics for changing individual properties are clearly defined and implemented or formally resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.