microsoft / powerplatform-build-tools

Power Platform Build Tools automate common build and deployment tasks related to Power Platform. This includes synchronization of solution metadata (a.k.a. solutions) between development environments and source control, generating build artifacts, deploying to downstream environments, provisioning/de-provisioning of environments, and the ability to perform static analysis checks against your solution using the PowerApps checker service.
MIT License
184 stars 38 forks source link

Power Platform Checker 'Unauthorized' #542

Open craig-lund-palm opened 11 months ago

craig-lund-palm commented 11 months ago

Using Azure DevOps Exported Managed Solution using tools. Check solution and get this error. ["Error: Operation returned an invalid status code 'Unauthorized'"] Here is the Input and output before error. Scrubbed of any sensitive data. [ '' ] [ 'Warning: Argument --kind is deprecated and is ignored.' ] [ '' ] [ "The Authentication Result: '' authenticated successfully.,Validating connection...,Authentication profile created, ADMIN https://gov.service.powerapps.us/ : ** UsGov,,Microsoft PowerPlatform CLI,Version: 1.26.5+g670cdf9,Online documentation: https://aka.ms/PowerPlatformCLI,Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions,,Warning: Argument --kind is deprecated and is ignored.," ] [ 'Calling pac cli inputs: solution check --path D:\a\1\a\solutions\PipelineTestSolution_managed.zip --ruleSet 0ad12346-e108-40b8-a956-9a8f95ea18c9 --customEndpoint https://.crm9.dynamics.com/ --outputDirectory D:\a\1\a\PowerAppsChecker\checker-output --saveResults false' ] [ '' ] [ 'Endpoint: https://gov.api.advisor.powerapps.us/' ] [ '' ] [ 'Checking these solution files:' ] [ '' ] [ '- D:\a\1\a\solutions\PipelineTestSolution_managed.zip' ] [ 'Entering InvokePowerAppsChecker - EndProcessing' ] [ 'Executing InvokePowerAppsChecker' ] [ 'Upload started : 1 files' ] [ 'Exiting with Failed InvokePowerAppsChecker - EndProcessing : 00:00:00.1029089' ] [ 'Microsoft PowerPlatform CLI' ] [ 'Version: 1.26.5+g670cdf9' ] [ 'Online documentation: https://aka.ms/PowerPlatformCLI' ] [ 'Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions' ] [ '' ] [ "Error: Operation returned an invalid status code 'Unauthorized'" ] [ '' ] [ '' ]

This is using the same service connection that was used to export the file.

petrochuk commented 11 months ago

Checker uses different end point and this service connection might not be authorized to connect to it

craig-lund-palm commented 11 months ago

Why would the access to the checker site differ from access to the environment. If I can export a solution from a USGovernment endpoint, why can't I check a solution using the USGovernment endpoint.

Since there is no selection to choose what endpoint to use on the solution checker it is auto discovering and not resolving correctly to a usable API.

There is no documentation as to any extra permissions needed.

How is this a question and not a bug? What do I need to do different to allow it to work?

petrochuk commented 11 months ago

Checker endpoints are documented here: https://learn.microsoft.com/en-us/power-platform/alm/checker-api/overview#determine-a-geography

craig-lund-palm commented 11 months ago

Great!

As I can't select the GEO in the task, when will it auto select the correct one?

With the mess of geos, clouds, endpoints that have been created. When will crm9 (US GOV) work with the correct USGovernment checker geo? It works with Unitedstates but the task does not select that geo.

When can that fix be expected to use the tool as expected? @craig-lund @craig-lund-planet