Describe the bug
Azure defaults ResourceGroup.managedBy as null but the ResourceModule template defaults to empty string. It is also not possible to set null with this module.

If I check if empty and send null then I get another error:
InvalidTemplate - Long running operation failed with status 'Failed'.
| Additional Info:'Deployment template validation failed: 'The template
| resource 'RG-Workday' at line '1' and column '2529' is not valid:
| Evaluation result of language expression
| '[if(empty(parameters('managedBy')), null(), parameters('managedBy'))]'
| is type 'Null', expected type is 'String'.. Please see
| https://aka.ms/arm-functions for usage details.'.
To reproduce
- Create a resource group through azure portal
- Create bicep for this resource group
module ResourceGroup '.carml/resources/resource-groups/main.bicep' = {
name: '${deployment().name}-ResourceGroup'
params: {
name: resourceGroupName
location: resourceGroupLocation
}
}
- Deploy Bicep
The managed by property of the resource group cannot be changed from its current value '<null>'
Code snippet
No response
Relevant log output
{
"code": "DeploymentFailed",
"target": "/subscriptions/***",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
"details": [
{
"code": "ResourceGroupManagedByMismatch",
"message": "The managed by property of the resource group cannot be changed from its current value '<null>'."
}
]
}
Describe the bug
Azure defaults
ResourceGroup.managedByasnullbut the ResourceModule template defaults to empty string. It is also not possible to set null with this module.If I check if empty and send null then I get another error:
To reproduce
Code snippet
No response
Relevant log output
{ "code": "DeploymentFailed", "target": "/subscriptions/***", "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.", "details": [ { "code": "ResourceGroupManagedByMismatch", "message": "The managed by property of the resource group cannot be changed from its current value '<null>'." } ] }