[Bug Report]: Resource Group modules for Managedby
- Lingua principale
- PowerShell
- Stelle
- 737
- Fork
- 436
- Merge medio
- 10g 7h
- PR unite (30g)
- 1
Descrizione
### Describe the bug
When updating from the old resources modules, the below code set the managedBy to ''
```
@description('Optional. The ID of the resource that manages this resource group.')
param managedBy string = ''
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
name: name
tags: tags
managedBy: managedBy
properties: {}
}
```
In the new AVM modules its commented out and so its reverts to $null
```
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
name: name
tags: tags
// managedBy: managedBy // removed due to immutable string, only used for managed resource groups
properties: {}
}
```
When testing, it will try and update the property but this is not allowed
```
"details": [
{
"code": "ResourceGroupManagedByMismatch",
"message": "The managed by property of the resource group cannot be changed from its current value ''."
}
]
```
### To reproduce
Deploy a resource group using the resource deployment of
```
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
name: name
tags: tags
managedBy: managedBy
properties: {}
}
```
Update the code to comment out the managedBy property
```
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
name: name
tags: tags
// managedBy: managedBy // removed due to immutable string, only used for managed resource groups
properties: {}
}
```
### Code snippet
```Bicep
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
name: name
tags: tags
managedBy: managedBy
properties: {}
}
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
name: name
tags: tags
// managedBy: managedBy // removed due to immutable string, only used for managed resource groups
properties: {}
}
```
### Relevant log output
```Shell
"details": [
{
"code": "ResourceGroupManagedByMismatch",
"message": "The managed by property of the resource group cannot be changed from its current value ''."
}
]
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con il Resource Group AVM module e la relativa dichiarazione della risorsa, confrontando il comportamento precedente di managedBy con la property attualmente commentata. Riproduci l’aggiornamento dell’issue e verifica che il module non produca più un errore ResourceGroupManagedByMismatch, preservando al contempo il comportamento previsto del gruppo di risorse gestito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure
- Ambito
- cloud, infrastructure
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100