Skip to content

Adding service endpoint to subnets #13249

Closed Answered by kevball2
Alexprosp247 asked this question in Q&A
Discussion options

You must be logged in to vote

You need to add conditional checks for the serviceEndpoints property. Your first subnet does not include that property, so the validation is failing. You can use safe-dereferences to solve this:

 subnets: [for subnet in subnets: {
      name: subnet.name
      properties: {
        addressPrefix: subnet.addressPrefix
        networkSecurityGroup: contains(subnet, 'networkSecurityGroupId') ? {
          id: subnet.networkSecurityGroupId
        } : null
        routeTable: contains(subnet, 'routeTableId') ? {
         id: subnet.routeTableId
        } : null
         natGateway: contains(subnet, 'natGatewayId') ? {
           id: subnet.natGatewayId
         } : null
         serviceEndpoints

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Alexprosp247
Comment options

Answer selected by Alexprosp247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants