web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PAC Code Commands - Pe...
Power Apps
Suggested Answer

PAC Code Commands - Persistent Errors/Adding Data Sources and other key commands

(0) ShareShare
ReportReport
Posted on by
I've successfully downloaded and installed the VS Power Platform Extension allowing me to utilize PAC commands. Running into some errors without a lot of detail provided that are making the tool unusable. I'll attach evidence i've been able to collect throughout troubleshooting. I've even had situations where I run a command on Friday, it succeeds, and then I log in and run the same command the following Monday and it fails (very frustrating to trouble shoot). 
 
PAC CLI Version: 2.2.1+g666525f
 
Successful:
2026-08-28
pac code add-data-source 
pac auth
pac env
pac connection
pac env fetch
pac code run
 
Failing:
2026-09-01 onward
pac code add-data-source (same command in same root folder with same PAC version, failed within 72 hours of succeeding)
pac code list
pac code list-datasets
pac code list-tables
pac code list-connection-references
 
 
 
The visual studio code extension is able to work with and interact with the power platform entirely. I can authenticate, view my environments and solutions, fetch data from dataverse tables, and complete all other functionality. I am unable to add datasources (whether dataverse tables, sharepoint lists, or other connections they all fail) and unable to push the completed code app into my environment using npm run build | pac code push. 
 
 
 
Errors:
Failed to get entity definition for table insert_table_name
TypeError: fetch failed
Cannot read properties of undefined (reading 'environmentName')
Failed to get connection references ... {}
 
Evidence:
- Same command worked 8/28
- Same CLI version
- Same environment
- Same connection
- Dataverse fetch succeeds
- DNS succeeds
- Test-NetConnection succeeds
- HTTPS endpoint returns 404 via Invoke-WebRequest
 
 
Logs from Failed Request: 
 
The logs really don't tell me anything useful. It appears when I run the command it successfully get's my auth profile and successfully acquires a token. It then will end the process and return fetch failed. This looks almost identical to the successful run on 8/28 outside of the fetch failed response at the end. I've removed information related to our specific connection instance to prevent any data security issues but the TenantId and user both appeared to be correct.
 
2026-09-02 13:22:51.5858 | INF | Microsoft.PowerPlatform.Tooling.BatchedTelemetry :: BatchedTransmitter`1.StartUploadProcess Started uploader with process id: 47068
2026-09-02 13:23:31.5790 | INF | bolt.Session :: Product Version: 2.2.1+g666525f; File Version: 2.2.1
2026-09-02 13:23:31.5957 | INF | bolt.Session :: Start new session. nonInteractiveMode: False)
2026-09-02 13:23:31.7461 | INF | bolt.cli.Verb :: Executing verb 'code add-data-source' with arguments --apiId,--connectionId,--table.
2026-09-02 13:23:31.7627 | INF | bolt.cli.CommandLine.VerbExecutor :: PerformAuthenticationAsync - Getting auth profile with following options: { AuthKind = UNIVERSAL, IsRequired = True, ShowProfileMessages = True, VerbDisableAutoOSLogin = False, SkipValidation = False }
2026-09-02 13:23:31.9159 | INF | bolt.cli.CommandLine.VerbExecutor :: PerformAuthenticationAsync - Using auth profile: { Kind = UNIVERSAL, ProfileType = User, AadObjectId = "", CloudInstance = Public, TenantId = "", User = "" }
2026-09-02 13:23:31.9449 | INF | bolt.cli.EnvironmentResolver :: GetImplicitEnvironmentOrDefault: Using the auth profile's active organization.
2026-09-02 13:23:33.1653 | INF | bolt.authentication.store.AuthTokenStore :: Successfully acquired a token using profile of type User for scope 'https://environment.crm.dynamics.com/.default'
2026-09-02 13:23:33.3895 | INF | bolt.Session :: End session. 
  • Suggested answer
    Mohsin Ali Profile Picture
    916 on at
    Hello @JC-02091353-0 - From the errors you shared, this looks more like a PAC CLI / Code Apps connectivity issue. Since authentication is successful and you are able to acquire the token and access Dataverse, I would recommend to try the following:
    • Update Power Platform CLI to the latest version.
    • Clear/recreate the PAC authentication profile and make sure the correct environment is selected.
    • Double-check the environment details in `power.config.json`.
    • If you are behind a corporate network/VPN/proxy, try from another network to rule out any connectivity restrictions.
    If the issue continues after updating/re-authenticating PAC CLI, I would recommend raising a Microsoft support ticket with the CLI debug logs.
     


     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard