Bicep A nested resource type must have identical number of segments as its resource name

ERROR: {‘code’: ‘InvalidTemplate’, ‘message’: “Deployment template validation failed: ‘The template resource ‘rwf-npd/GetClient’ for type ‘Microsoft.ApiManagement/service/apis/operations’ at line ’38’ and column ’63’ has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name. Please see https://aka.ms/arm-template/#resources for usage details.’.”, ‘additionalInfo’: [{‘type’: ‘TemplateViolation’, ‘info’: {‘lineNumber’: 38, ‘linePosition’: 63, ‘path’: ‘properties.template.resources[1].type’}}]}

[error]Script failed with exit code: 1

Solution: Make sure you are not using any slash (/) in the resource name

resource exampleApiOperationGetPolicy ‘Microsoft.ApiManagement/service/apis/operations/[email protected]’ = {  name: ‘${apimInstance.name}policy’  properties: {    value: ‘<policies></policies>’  }}

Add Comment