Skip to content

Using custom functions through desiredStateConfiguration targetScope does not work #17762

@Gijsreyn

Description

@Gijsreyn

Bicep version
Bicep CLI version 0.37.4 (27cc8db)

Describe the bug
Microsoft DSC v3 implements its own custom functions. For example, to determine the current drive, I could define the following:

targetScope = 'desiredStateConfiguration'

resource powerShellAdapter 'PSDesiredStateConfiguration/File@2025-01-07' = {
  name: 'Use Bicep to create file'
  properties: {
        Ensure: 'Present'
        Type: 'File'
        DestinationPath: '${systemroot()}\\DSC\\config.txt'
        Contents: 'This file was created using Bicep extension from DSC.'
    }
}

Trying to compile this, results in an error:

Image

To Reproduce
Grab the example from the pull request and run bicep build file_with_condition.dsc.bicep

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions