Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 1.26 KB

File metadata and controls

47 lines (31 loc) · 1.26 KB
title BCP238
description Unexpected new line character after a comma.
ms.topic reference
ms.custom devx-track-bicep
ms.date 10/30/2025

Bicep diagnostic code - BCP238

In Bicep, arrays or objects can be declared on a single line or across multiple lines. In single-line declarations, values are separated by commas (,), while in multi-line declarations, commas aren't used. You can combine single-line and multi-line styles, but each element must be separated by no more than one comma or one set of new lines. This diagnostic occurs when this rule isn't followed. For more information, see Arrays or Objects.

Description

Unexpected new line character after a comma.

Level

Error

Solution

Remove Use a name of a value.

Examples

The following example raises the diagnostic because a comma and a new line are used in between 'def' and 'ghi':

var mixedArray = ['abc', 'def',
    'ghi']

You can fix the diagnostic by removing either the comma or the new line:

var mixedArray = ['abc', 'def'
    'ghi']
var mixedArray = ['abc', 'def', 'ghi']

Next steps

For more information about Bicep diagnostics, see Bicep core diagnostics.