Resource Group - ManagedBy NULL/Empty String issue#4351
Resource Group - ManagedBy NULL/Empty String issue#4351coolhome wants to merge 1 commit intoAzure:mainfrom
Conversation
|
Hey @coolhome, thanks for the PR :) Sorry that I didn't get around to it earlier - yet alone the linked issue. As the module is already migrated to AVM, @segraef, could you take a look at this? As @coolhome says, we should also test this out, but if it checks out, it would be great to get updated in the resource group module. |
| location: location | ||
| name: name | ||
| tags: tags | ||
| managedBy: length(managedBy ?? '') > 0 ? managedBy : '' |
There was a problem hiding this comment.
| managedBy: length(managedBy ?? '') > 0 ? managedBy : '' | |
| managedBy: managedBy ?? '' |
If I'm not mistaken, this should do the trick to. Even better would be only mangedBy: mangedBy, IF null is accepted by the RP.
There was a problem hiding this comment.
That is correct, but the RP does not accept null. If its json property exists it has to be a string, which makes this problem hard. This is why I've had challenges figuring out who to report this to CARML/AVM, Bicep, or Azure Support for RP.
I think the RP should accept null and require a string length greater than 0. Regardless it's a breaking change if someone used this module to create the resource group because it has to be deleted to remove managedBy AFAIK.
There was a problem hiding this comment.
In the corresponding AVM module the owner now opted to not expose the ability to write to this property. This won't impact the RP but at least it wouldn't cause any other issues for users of the module.
Testing ... |
|
Alright, I tested some cases and all of them circle back to I simulated a managed resource group which gets its As we all know a nullable I've never seen (maybe someone else?) a use case where |
[](https://github.com/segraef/bicep-registry-modules/actions/workflows/avm.res.resources.resource-group.yml) Fix for Azure/ResourceModules#4351
Description
Potential fix for #3386
This allowed me to omit the value. I have not tested lock module or the role assignment resource.
Unfortunately, this is a breaking change as
managedByis implicitly null and cannot be defaulted to an empty string. However, I think this may be desired since Azure CLI/PowerShell set this as null.Please feel free to pick up and continue with testing.
Pipeline references
Type of Change
Checklist