Skip to content

[BUG] Bicep Feature: '[Experimental] Runtime values in tags and sku' breaks PSRule #3425

Open

Description

@niekhodes

Description of the issue

When using the new experimental feature in Bicep from 0.46.1: https://github.com/Azure/bicep/releases
([Experimental] Runtime values in tags and sku)

resource example 'Microsoft...' = {
   name: 'example'
   location: resourceGroup().location
   sku: {
      name: this.existingResource().?sku.name ?? 'Standard'
   }
   tags: this.existingResource().?tags ?? {}
}

I now always get the following error shown in the error messages.

Error messages

Exception calling "GetBicepParamResources" with "2" argument(s): "Unable to expand resources because the source file '/home/vsts/work/1/s/main.bicep' was not valid. The deployment 'root/2026-08-07_14.45' with symbolic name 'hubResourceGroup' failed. An error occurred evaluating expression '[if(parameters('keepExistingTags'), union(coalesce(tryGet(target('full'), 'tags'), createObject()), parameters('tags')), parameters('tags'))]' line 701 at path 'tags'. The function "target" was not found."

Reproduction

Create a bicep file containing the new function:

resource example 'Microsoft...' = {
   name: 'example'
   location: resourceGroup().location
   sku: {
      name: this.existingResource().?sku.name ?? 'Standard'
   }
   tags: this.existingResource().?tags ?? {}
}

Version of PSRule

2.9.0

How are you running PSRule

Azure DevOps Microsoft Hosted Agent using the latest version of Linux, running in a PowerShell task using the latest version of bicep (0.46.1)

Additional context

No response

Activity

  1. added theissue type on Aug 7, 2026
  2. added
    Needs: Triage 🔍
    on Aug 7, 2026
  3. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    Thanks for raising your first issue, the team appreciates the time you have taken 😉

  4. added
    bug
    downstream
    and removed
    Needs: Triage 🔍
    on Aug 24, 2026
  5. E-W-B commented on Oct 8, 2026

    @E-W-B

    This is still an issue using Bicep version 0.48.1, in which this.existingResource() became GA.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdownstream

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions