Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Troubleshoot adding a data source when the Power Apps CLI pa app add data-source command fails. Follow these steps to identify configuration, authentication, or network issues and add the data source successfully.
Symptoms
Failures can happen because of configuration, authentication, network connectivity, or your organization's connector policy.
| Symptom | Example message |
|---|---|
| Fetch failed | Fetch Failed (no additional stack) |
| Timeout or network errors | ETIMEDOUT, ENOTFOUND, or ECONNRESET |
| Environment mismatch | Data source not found or unexpected schema |
| Connector or actions blocked by policy | Exit code 2 when the connector or all actions are blocked |
| Expected generated method is missing | Notice that actions were skipped because of your organization's connector policy |
Prerequisites
Verify that you have the latest Power Apps CLI installed. Update it if you're not sure.
Use
pa auth loginto sign in andpa auth statusto verify the active account:pa auth login pa auth statusVerify that your network allows outbound HTTPS calls to Power Platform endpoints.
Steps to troubleshoot data source errors
To diagnose the root cause, follow these steps.
Check connector policy messages
If the CLI reports that your organization's policy blocks the connector or all its actions, contact your Power Platform administrator. Retrying authentication or changing network settings doesn't resolve a policy block. The command stops before creating a connection or data source files.
If the command succeeds but reports skipped actions, the generated service doesn't include those actions. Use an allowed action or ask your administrator to review the policy.
If the CLI warns that it can't check policy because the tenant couldn't be identified or the policy service is unavailable, the command continues without that check. Don't treat this warning as confirmation that the connector is allowed. Invalid policy responses and canceled authentication fail the command. See pa app add data-source remarks.
Step 1: Validate configuration
Open the power.config.json file and confirm:
environmentIdmatches the environment you want to target.regionis set toprod, unless you want to target another region. Add it if it's missing.
Step 2: Cross-check environment context
Use pa auth status to confirm that the correct account is active:
pa auth status
Compare the environmentId in power.config.json with the environment ID shown in the Power Apps environment URL.
Example power.config.json snippet:
{
"environmentId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"region": "prod"
}
Step 3: Rerun the add data source command
Run pa app add data-source again. For example:
pa app add data-source --connector dataverse --table account
Check the output for HTTP status codes or error messages.
Step 4: Validate network and security settings
If the command still fails:
- Confirm that no corporate proxy or firewall blocks CLI processes or other nonbrowser traffic.
- Approve the required Power Platform endpoints. See Power Platform connectivity requirements.
Verify browser connectivity
This step helps confirm that your user account has the correct permissions and that the data source is reachable from your computer.
- Open a web browser on the same computer where you're using the Power Apps CLI.
- Go directly to the data source you're trying to add, such as the SharePoint site or Dataverse environment URL.
- Sign in with the same account shown by
pa auth status. - If you can't access the resource, a permissions issue with your user account is the likely root cause.
- If you can access it, continue to Analyze network traffic.
Analyze network traffic
Use a network-monitoring tool to inspect communication between the Power Apps CLI and the data source endpoint.
Download and install Fiddler Classic.
Start Fiddler and ensure that it's capturing traffic. Go to File > Capture Traffic.
In a command prompt, run the failing
pa app add data-sourcecommand.In the Fiddler session list, look for requests made to your data source endpoint, such as
yourorg.crm.dynamics.comoryourtenant.sharepoint.com.Analyze the response:
- A
200status code indicates success. - A
401(Unauthorized) or403(Forbidden) status code points to an authentication or permission issue. - Other error codes or a complete lack of response can indicate that a firewall or proxy is blocking the request.
- A
Step 5: Clear or reset the auth context
If the wrong account is active, use pa auth switch:
pa auth switch
If the account isn't listed, use pa auth login:
pa auth login
To clear all saved authentication information and sign in again, use pa auth logout, and then use pa auth login:
pa auth logout
pa auth login
Escalation data for technical support
Before you contact technical support to file an issue, provide:
- CLI version from
pa --version - Operating system and shell, such as Windows Command Prompt, PowerShell, or WSL
- The full command used
- Sanitized debug output
power.config.jsonafter you redact sensitive values