You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bicep version
Bicep CLI version 0.31.92 (b06509316a)
Describe the bug
When deploying subnets in a loop using an array, I want to enable subnet delegation for a specific subnet based on a condition. However, the deployment fails with an error indicating a null value for item.name which is definitely not true, because when I comment out the delegation part with the condition, the subnet creates without any issues.
I expect only one subnet with a name containing db should have delegation enabled.
All other subnets should be deployed without delegation.
To Reproduce
Steps to reproduce the behavior:
Define an array of subnet configurations like this: [{"name":"xxx","prefix":"10.0.0.0/28"},{...},...]
Add a condition to enable delegation for subnets whose name contains 'db':
It's not marked as required in the docs, but the error message you're seeing indicates that it might be. If that doesn't solve the issue, there is likely something else in the template that expects a name property where one isn't set.
I can confirm that the issue was resolved after I set the name property in the delegation object. Thank you for your assistance. It would be great if the Bicep linter could indicate that this is a required parameter.
jeskew
changed the title
Condition-Based Subnet Delegation Results in InvalidRequestFormat Error
Subnet Delegation without name property Results in InvalidRequestFormat Error
Nov 22, 2024
Whether a property is required or optional is determined by the resource provider's service model. Transferring this issue to the bicep-types-az repo so we can ask the service team to update this upstream of Bicep.
Bicep version
Bicep CLI version 0.31.92 (b06509316a)
Describe the bug
When deploying subnets in a loop using an array, I want to enable subnet delegation for a specific subnet based on a condition. However, the deployment fails with an error indicating a null value for
item.name
which is definitely not true, because when I comment out the delegation part with the condition, the subnet creates without any issues.I expect only one subnet with a name containing
db
should have delegation enabled.All other subnets should be deployed without delegation.
To Reproduce
Steps to reproduce the behavior:
[{"name":"xxx","prefix":"10.0.0.0/28"},{...},...]
The deployment fails with the error:
The Azure Portal also displays the error:
The text was updated successfully, but these errors were encountered: