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
195 stars 39 forks source link

Solution Checker Task using wrong URL #742

Closed craig-lund-palm closed 8 months ago

craig-lund-palm commented 9 months ago

Before Version: 2.0.51 I was able to work around the "Use default Power Apps Checker endpoint" not working in a GCC tenant by just using "https://unitedstates.api.advisor.powerapps.com".

Since the update that work around is no longer working. It seems like it is ignoring the custom URL.

I have compared log files (in Azure DevOps) before and after the update. I see a few differences.

`============================================================================== Task : Power Platform Checker Description : Analyze solutions using Power Apps Checker endpoint Version : 2.0.49 Author : Microsoft Help : https://aka.ms/buildtoolsdoc Ideas, feedback: https://github.com/microsoft/powerplatform-build-tools/discussions

[ 'authN to admin API: authType=UserPass; cloudInstance: UsGov' ]

[ "'***' authenticated successfully." ] [ 'Validating connection...' ]

[ 'Authentication profile created' ] [ ' * ADMIN https://gov.service.powerapps.us/ : UsGov' ] [ '' ] [ 'Microsoft PowerPlatform CLI' ] [ 'Version: 1.29.11+g9e2b163' ] [ 'Online documentation: https://aka.ms/PowerPlatformCLI' ] [ 'Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions' ] [ '' ] [ 'Warning: Argument --kind is deprecated and will be removed in a future release.' ] [ '' ] [ "The Authentication Result:[] ] [ 'Calling pac cli inputs: solution check --path D:\a\1\a\solutions\[***]_managed.zip --ruleSet 0ad12346-e108-40b8-a956-9a8f95ea18c9 --customEndpoint https://unitedstates.api.advisor.powerapps.com --outputDirectory D:\a\1\a\PowerAppsChecker\checker-output --saveResults false' ]

[ '' ] [ 'Endpoint: https://unitedstates.api.advisor.powerapps.com/' ] [ '' ] [ 'Checking these solution files:' ] [ '' ] [ '- D:\a\1\a\solutions\[***]_managed.zip' ]`

`============================================================================== Task : Power Platform Checker Description : Analyze solutions using Power Apps Checker endpoint Version : 2.0.51 Author : Microsoft Help : https://aka.ms/buildtoolsdoc Ideas, feedback: https://github.com/microsoft/powerplatform-build-tools/discussions

[ 'authN to admin API: authType=UserPass; cloudInstance: UsGov' ] [ 'The argument --kind is now ignored. Creating a UNIVERSAL profile instead.' ] [ "'' authenticated successfully." ] [ 'Validating connection...' ] [ 'Connected to... [] All User Access (default)' ] [ 'Default organization: [] All User Access (default)' ] [ 'Authentication profile created' ] [ ' UNIVERSAL : ** UsGov https://[].crm9.dynamics.com/ ' ] [ '' ] [ 'Microsoft PowerPlatform CLI' ] [ 'Version: 1.30.5+g0bf9504' ] [ 'Online documentation: https://aka.ms/PowerPlatformCLI' ] [ 'Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions' ] [ '' ] [ 'Warning: Argument --kind is deprecated and will be removed in a future release.' ] [ '' ] [ "The Authentication Result:[] ] [ 'Calling pac cli inputs: solution check --path D:\a\1\a\solutions\[]_managed.zip --ruleSet 0ad12346-e108-40b8-a956-9a8f95ea18c9 --customEndpoint https://unitedstates.api.advisor.powerapps.com --outputDirectory D:\a\1\a\PowerAppsChecker\checker-output --saveResults false' ] [ 'Connected as ' ] [ '' ] [ 'Endpoint: https://unitedstates.api.advisor.powerapps.com/' ] [ '' ] [ 'Checking these solution files:' ] [ '' ] [ '- D:\a\1\a\solutions\[]_managed.zip' ]`

This error, above, was getting before I added the work around. Now since the PAC CLI and Azure DevOps update it no longer works.

I have added gov.api.advisor.powerapps.us into the custom URL and fails with the same error.

`[ 'Microsoft PowerPlatform CLI' ] [ 'Version: 1.30.5+g0bf9504' ] [ 'Online documentation: https://aka.ms/PowerPlatformCLI' ] [ 'Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions' ] [ '' ] [ 'Error: AADSTS500011: The resource principal named https://gov.api.advisor.powerapps.com/ was not found in the tenant named [***]. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: 6191cf81-4710-4e6d-b657-acb069218200 Correlation ID: bcd26a3a-268d-4d57-8c2a-6984393fd8ff Timestamp: 2024-02-08 17:35:29Z' ] [ '' ]

[error]error: 1

[error]failed: Connected as ***

Endpoint: https://unitedstates.api.advisor.powerapps.com/

Checking these solution files:

Error: AADSTS500011: The resource principal named https://gov.api.advisor.powerapps.com/ was not found in the tenant named [***]. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: 6191cf81-4710-4e6d-b657-acb069218200 Correlation ID: bcd26a3a-268d-4d57-8c2a-6984393fd8ff Timestamp: 2024-02-08 17:35:29Z`

tehcrashxor commented 8 months ago

Duplicate of #691

Mapping was corrected in PAC v1.30.7, and in the just-released PPBT v2.0.52