Skip to content

pac code list-connection-references returns null for logical name, causing pac code add-data-source -cr to fail with "Failed to resolve connection ID" #241

Description

Describe the bug
Running pac code list-connection-references against any solution returns the display name correctly but returns null for the logical name field of all connection references. This affects all solutions and all connection references in the environment — not isolated to a single solution or component.

As a direct result, running pac code add-data-source with the -cr flag fails with the following error even when the correct logical name is supplied manually (verified via the maker portal and Dataverse connection reference table):
Error during CLI execution: Error: Failed to resolve connection ID for reference '' in solution ''

To Reproduce

  • Create a solution in Power Apps maker portal with a publisher prefix
  • Add one or more connection references to the solution (e.g. Office 365 Outlook, SharePoint Online) and attach a live connection to each
  • Initialize a Code App project via pac code init
  • Run pac code list-connection-references -env -s
  • Observe that the Name field returns null for all connection references despite them existing correctly in the solution
  • Attempt to add a data source using the connection reference logical name obtained from the maker portal:
  • run pac code add-data-source -a "shared_office365" -cr "" -s ""
  • Observe the error: Failed to resolve connection ID for reference '' in solution ''

Expected behavior
pac code list-connection-references should return the correct logical name for each connection reference in the solution (e.g. idadm_OutlookConnection). The pac code add-data-source -cr command should successfully resolve the connection reference and generate the typed TypeScript model and service files in the Code App project.

Desktop
OS: Windows 11
PAC CLI Version: 2.2.1+g666525f (.NET Framework 4.8.9221.0) — installed via Power Platform Tools VS Code extension

Additional Context

  • The logical names are confirmed correct — verified via the maker portal UI, the Dataverse connection reference table, and the solution's Customizations.xml file (e.g. idadm_OutlookConnection, idadm_SPConnection)
  • Connections are fully configured and attached to the connection references in the portal
  • The issue is reproducible across all solutions and all connection references in the environment — not isolated to one solution
  • pac connection list works correctly and returns connection IDs and API names without issue
  • pac code list-connection-references returns the display name correctly but Name: null for all entries
  • PAC CLI was installed via the Power Platform Tools VS Code extension, not as a standalone dotnet global tool
  • The -cr flag was introduced in PAC CLI version 1.51.1 per official documentation — current version 2.2.1 appears to have introduced a regression in connection reference name resolution
  • Workaround attempted: manually supplying the correct logical name from the portal to -cr — still fails, confirming the resolution failure is server/CLI-side not a naming error on the user's part

Metadata

Metadata

Assignees

Labels

Fix rolling outWe start the rollout with the fix for this issue.bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions