Skip to content

Allow array indexing issue #1139

@Gijsreyn

Description

@Gijsreyn

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Summary

Looking through the history, I found the following PR #527, which allows for the ability to index arrays within an expression. Regardless, after starting to work on the range() function, I would have expected the following Bicep resource to work:

targetScope = 'desiredStateConfiguration'

resource rangeExample 'Microsoft.DSC.Debug/Echo@2025-08-27' = {
  name: 'rangeExample'
  properties: {
    output: range(2147473647, 10000)[0]
    }
  }

Steps to reproduce

Run the example above

Expected behavior

Expected output would be: 2147473647

Actual behavior

2025-09-26T13:00:24.795125Z ERROR Parser: Unable to parse: [first(range(2147473647, 10000))][0]

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.3
PSEdition                      Core
GitCommitId                    7.5.3
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

dsc 3.2.0-preview.5

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions