PowerShell / PowerShell/DSC

Unable to invoke bicep modules in bicep config files

Open
#1,269 2 comments 0 reactions 1 assignee View on GitHub

@andyleejordan is already working on this.

Since Nov 20, 2025.

Area-Bicep Issue-Bug Need-Review
Dominant language
Rust
Stars
523
Forks
75
Avg merge
3d 16h
Merged PRs (30d)
24

Description

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

I am experiencing a problem with using bicep config files that reference other bicep modules.

Steps to reproduce

1.The first file has its own resource and reference a module that has another resource.

extension dsc
targetScope = 'desiredStateConfiguration'

module dscModule 'hello_from_bicep_ext_transitional_powershell_7.dsc.bicep' = {
  name: 'dscModuleInstance'
}

resource runScript 'Microsoft.DSC.Transitional/PowerShellScript@0.1.0' = {
  setScript: '& "C:\\workspaces\\trydsc\\myscript.ps1" -FileName "C:\\Temp\\from_module_only_file.txt"'
}
  1. This file is the referenced module with 1 resource
extension dsc
targetScope = 'desiredStateConfiguration'



resource runScript 'Microsoft.DSC.Transitional/PowerShellScript@0.1.0' = {
setScript: '& "C:\\workspaces\\trydsc\\myscript.ps1" -FileName "C:\\Temp\\from_resource_only_file.txt"'
}```


3. Use dsc to apply config for the first file

### Expected behavior

```console
The reference bicep module is invoked
Actual behavior
The dsc apply command erros out 2025-11-18T18:23:25.669804Z ERROR dsc::subcommand: 111: Error: Resource not found: Microsoft.Resources/deployments 2025-03-01
Error details
2025-11-18T18:23:25.669804Z ERROR dsc::subcommand: 111: Error: Resource not found: Microsoft.Resources/deployments 2025-03-01
Environment data
Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             Microsoft Windows 10.0.22621
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.8

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.