Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Resources appearing under both resource groups and "Source resources" nodes triggered ID conflicts in VS Code's tree view, causing expansion errors.

Root Cause

Tree item IDs were inconsistent across contexts:

  • Resource group context: /accounts/{account}/tenants/{tenant}{resourceId}
  • Source resources context: {msiId}/{resourceId}

Additionally, DefaultAzureResourceItem never applied its custom treeItemId to the VS Code TreeItem object.

Changes

  • SourceResourceIdentityItem: Prefix child resource IDs with account/tenant context to match AzureResourceItem format

    // Before
    treeItemId: `${msi.id}/${sourceResource.id}`
    
    // After  
    treeItemId: `${getAccountAndTenantPrefix(this.subscription)}${msi.id}/${sourceResource.id}`
  • DefaultAzureResourceItem: Apply custom treeItemId to TreeItem object

    getTreeItem(): vscode.TreeItem {
      const treeItem = new vscode.TreeItem(/* ... */);
      treeItem.id = this.id;  // Added
      // ...
    }

This ensures resources have consistent, unique IDs regardless of which tree path displays them.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-azureresourcegroups/vscode-azureresourcegroups/node_modules/.bin/vscode-test --grep SourceResourceIdentityItem tests (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>An error occurs when expanding "Source resources" node</issue_title>
<issue_description>OS: Win 11
Build Version: 20250815.1

Repro Steps:

  1. Expand one resource group which has a function app -> Expand identity node -> Expand "Source resources" node.
  2. Check whether succeed to expand "Source resources" node without any error.

Expect:
Succeed to expand "Source resources" node without any error.

Actual:
An error occurs.
Image</issue_description>

<agent_instructions>The issue here is that the tree item ids are conflicting because the same resource can be shown under the source resource node and also under a resource group. Can you investigate and fix this?</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@alexweininger Talked to @MicroFish91 offline about this and we'll investigate this week @v-ruizh This issue has been fixed on extension build 20251011.1. @v-ruizh This issue does not reproduce with the current reproduction steps. However, the same error can still be reproduced using different node expansion orders. Two reproduction scenarios are shown in the GIFs below.

Image

Image</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 29, 2026 15:26
…ccount/tenant prefix

Co-authored-by: alexweininger <12476526+alexweininger@users.noreply.github.com>
Co-authored-by: alexweininger <12476526+alexweininger@users.noreply.github.com>
Co-authored-by: alexweininger <12476526+alexweininger@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error when expanding source resources node Fix tree item ID conflicts when resources appear in multiple tree contexts Jan 29, 2026
Copilot AI requested a review from alexweininger January 29, 2026 15:35
@MicroFish91
Copy link
Contributor

MicroFish91 commented Jan 29, 2026

From what I can tell, this PR fixes the new issue CTI was running into. If Copilot finds any other tree item id conflicts, we should definitely still address those though

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.

An error occurs when expanding "Source resources" node

3 participants