Skip to content

Unable to invoke bicep modules in bicep config files #1269

@snehanagendra

Description

@snehanagendra

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/[email protected]' = {
  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/[email protected]' = {
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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions