-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run-TestsInBCContainer Running 401 (Unauthorized). #3783
Comments
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
|
container log: 2024-12-06 18:10:46 Using artifactUrl https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.5.23489.24156/nl |
So, it looks like the authentication works fine:
But the user you are authenticated as doesn't have access to the environment in which you are running the tests:
|
Can access environment with the same user (as the refresh token), accessing AL test tool and run tests fine. |
That is the end-url of your environment - that should be fine. Have you tried using an older BcContainerHelper version (not that anything should be changed there) |
yes, I have tried it also with version 6.0.28 that has the same effect: CommunicationError : Response status code does not indicate success: 401 (Unauthorized). The user I'm trying to connect with using the RefreshToken has SuperUser rights in BC |
How did you create the refreshtoken? |
$bcauthContext = New-BcAuthContext -includeDeviceLogin Saved $bcauthContext.RefreshTokento keyvaoult, and re-used it in the pipeline Do I need have to have access rights to the Admin Center APIs? (didn't need that before) $authContext = New-BcAuthContext -includeDeviceLogin |
I don't think you need that for running tests |
Ok, that's what I thought.. I didn't need this before either. |
Hi, do you have any other suggestions that I can try? I'm still getting the same error. |
Did you try to give your user access to the admin center API (just to see whether this is the problem)? |
@freddydk $authContext = New-BcAuthContext -includeDeviceLogin
Get-BcEnvironments -bcAuthContext $authContext -environment "development-xyz" |
Describe the issue
When running the DevOps pipeline calling Run-TestsInBCContainer in an action step,
I now get an error: CommunicationError : Response status code does not indicate success: 401 (Unauthorized).
credentials are 100% correct, nothing changed in pipeline or sandbox environment.
ran fine 2 days ago.
File-only container:
Scripts used to create container and cause the issue
Full output of scripts
Screenshots
Additional context
does it happen all the time?
Yes all the time
did it use to work?
Yes, 2dfay ago it ran fine..
The text was updated successfully, but these errors were encountered: