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
200 stars 41 forks source link

PP Import Solution V 2.* #179

Closed tiemar closed 2 years ago

tiemar commented 2 years ago

I changed the import Version to V2. Now after some time receive this error: Around 80 Minutes the import fails, seems it looses the connection while importing?

Processing asynchronous operation... execution time: 01:17:15 and 42.9202249592593% complete Microsoft PowerPlatform CLI Version: 1.17.5+gcbb58e8

Error: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=https://login.microsoftonline.com/975d243a-4e65-46df-b77f-8f73a893ca23/oauth2/authorize, resource_id=https://perigroup-integration.crm4.dynamics.com/'. The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=https://login.microsoftonline.com/975d243a-4e65-46df-b77f-8f73a893ca23/oauth2/authorize, resource_id=https://perigroup-integration.crm4.dynamics.com/'. The remote server returned an error: (401) Unauthorized.

tiemar commented 2 years ago

Just to mention. Setting back to V 0 works. So we need to use this version still even though the warning appears.

davidjenni commented 2 years ago

@tiemar my bug hypothesis is, the accessToken is not being refreshed? Are you using appId/clientSecret authentication for the task? This should have been fixed already, see #139

tiemar commented 2 years ago

@davidjenni No actually we did not have the chance to change the connections. We still use User/PWD.

davidjenni commented 2 years ago

@tiemar thanks for getting back. With username/pw authN, pac CLI should be able to re-acquire a new access token, we're investigating on our side why that is not the case

AB#2894540

tiemar commented 2 years ago

Ok Thank you. I Now managed to switch to CLient/Secret but it is the same issue. After 60 Minutes it loses the Connect: Processing asynchronous operation... execution time: 00:59:31 and 33.0657923472222% complete Microsoft PowerPlatform CLI Version: 1.17.5+gcbb58e8

Error: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=https://login.microsoftonline.com/975d243a-4e65-46df-b77f-8f73a893ca23/oauth2/authorize, resource_id=https://perigroup-integration.crm4.dynamics.com/'. The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=https://login.microsoftonline.com/975d243a-4e65-46df-b77f-8f73a893ca23/oauth2/authorize, resource_id=https://perigroup-integration.crm4.dynamics.com/'. The remote server returned an error: (401) Unauthorized.

I now added Tool V0 and V2 and use only the import Step with V0. I hope that might work using a mixed scenario until it might be fixed.

davidjenni commented 2 years ago

@tiemar the fix has been released as PP-BT v2.0.5 to VS Marketplace; it should shortly propagate to the different AzDevOps orgs. Should this still repro, please do verify that the running task is indeed v 2.0.5