Skip to content

Conversation

Gijsreyn
Copy link
Contributor

@Gijsreyn Gijsreyn commented Aug 15, 2025

Description

Adds support for DSC scope to Bicep resource ID formatting. DSC resources don't use traditional ARM resource IDS, so the implementation uses a custom concatenation format.

Example Usage

Tested this change with a local file reported in issue #17670. Bicep file:

targetScope = 'desiredStateConfiguration'

// use workaround where Bicep currently requires version in date format
resource echo 'Microsoft.DSC.Debug/Echo@2025-01-01' = {
  name: 'exampleEcho'
  properties: {
    output: 'Hello, world!'
  }
}

output exampleOutput string = echo.properties.output

Returns:

{
  "$schema": "https://aka.ms/dsc/schemas/v3/bundled/config/document.json",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.37.52.64608",
      "templateHash": "928342520835393415"
    }
  },
  "resources": [
    {
      "type": "Microsoft.DSC.Debug/Echo",
      "apiVersion": "2025-01-01",
      "name": "exampleEcho",
      "properties": {
        "output": "Hello, world!"
      }
    }
  ],
  "outputs": {
    "exampleOutput": {
      "type": "string",
      "value": "[reference(concat('Microsoft.DSC.Debug/Echo', '/', 'exampleEcho'), '2025-01-01').output]"
    }
  }
}

Checklist

Microsoft Reviewers: Open in CodeFlow

@Gijsreyn
Copy link
Contributor Author

Hey @anthony-c-martin or @andyleejordan, is this perhaps something you can look at? It's currently a blocker on the DSC side. Much appreciated!

@andyleejordan
Copy link
Contributor

Hi @Gijsreyn, trust me, I would love to get back to this work. Unfortunately, more pressing things have filled my plate. Hopefully we'll get to it soon enough.

};
dscNameParts.AddRange(nameSegments);

return new FunctionExpression("concat", [.. dscNameParts.SelectMany(expr => new LanguageExpression[]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change with this PR PowerShell/DSC#1188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants