Closed cegekaJG closed 1 year ago
If looks like the user used for the authentication doesn't have access to get environments??? How did you create the authentication context?
I get prompted to enter my credentials with the regular login window. I know the username and password are valid because I can use them to create a container with Windows authentication using BcContainerHelper directly.
Does your Windows Credentials have access to the Business Central Admin Center? Maybe we should setup a Teams call ? It seems like you have some challenges, which we might be able to resolve faster this way. If you invite freddyk at microsoft dot com on Friday 10:00 or 11:00 - then we can maybe get to the bottom of things?
Friday should work, thanks.
I don't have your email, so if you set something up - I will talk to you there.
Oh, my mistake - I've sent you an invite.
I'd like to reopen this issue, as it's still occurring for me. Here is the full log:
_____ _ _ _____ ______
/ ____| | | | | __ \ | ____|
| | | | ___ _ _ __| | | | | | _____ __ |__ _ ____ __
| | | |/ _ \| | | |/ _` | | | | |/ _ \ \ / / __| | '_ \ \ / /
| |____| | (_) | |_| | (_| | | |__| | __/\ V /| |____| | | \ V /
\_____|_|\___/ \__,_|\__,_| |_____/ \___| \_/ |______|_| |_|\_/
This script will create a cloud based development environment (Business Central SaaS Sandbox) for your project.
All apps and test apps will be compiled and published to the environment in the development scope.
The script will also modify launch.json to have a "Cloud Sandbox (<name>)" configuration point to your environment.
Environment name
----------------
Please enter the name of the environment to create (default J******-sandbox) ******-sandbox
******-sandbox selected
What if the environment already exists?
---------------------------------------
a Recreate environment
b Reuse existing environment
Select behavior (default a)
Recreate environment selected
Downloading BcContainerHelper latest version from CDN
Using 7zip
BcContainerHelper version 5.0.1
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Running on PowerShell 7
Checking type
Checking appFolders, testFolders and bcptTestFolders
Application Dependency 18.0.0.0
Updating app- and test Dependencies
Analyzing Test App Dependencies
Checking project dependencies
Checking appDependencyProbingPaths
WARNING: No test apps found in testFolders in .AL-Go\settings.json
WARNING: No apps found in appFolders in .AL-Go\settings.json
Repository is empty
Attempting authentication to https://api.businesscentral.dynamics.com/user_impersonation offline_access using device login...
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ****** to authenticate.
Waiting for authentication.....
Authenticated from 20.234.83.3 as user J****** (J******@cegeka.com)
Authenticated to common, using tenant id 42151053-0193-47aa-9e81-effd81f772cc
Get-BcEnvironments Telemetry Correlation Id: e8b56a86-f691-46ab-a8e3-4031cb298371
Removing BcContainerHelper
Error: Response status code does not indicate success: 403 (Forbidden).
Stacktrace: at Get-BcEnvironments, C:\Users\J******\AppData\Local\Temp\d5541b9b-dd2c-434f-bd89-050cb8f03560\BcContainerHelper\Saas\Get-BcEnvironments.ps1: line 44
at CreateDevEnv, C:\Users\J******\AppData\Local\Temp\tmp772D.tmp.ps1: line 1637
at <ScriptBlock>, C:\Users\J******\Documents\clients\Cilit\CLT.Base\.AL-Go\cloudDevEnv.ps1: line 75
at <ScriptBlock>, <No file>: line 1
If you use the latest BcContainerHelper and run this code locally:
$authContext = New-BcAuthContext -includeDeviceLogin
Get-BcEnvironments -bcAuthContext $authContext
What happens? Do you get a list of your environments?
The problem is likely that you have a secret, where the value is your username. Do you know which secret this is?
What happens? Do you get a list of your environments?
No, I am getting the same error as before. And this repository's only secret is that of the GitHub workflow token.
OK, so you manually replaced your user name with J** ?
The credentials you are using, is that the AAD credentials, which gives you access to The Business Central Admin Center?
Yes, I replaced it manually. Reading the guide again, it says that step #7 has to have been completed. Does that mean it's not possible to create a sandbox using AL Go without an Azure Keyvault?
You don't need a keyvault
Please answer my question, which I also asked 2 weeks ago: Does your credentials give you access to the Business Central Admin Center?
like:
Okay, I don't have permission. I'll try a different account.
Which is likely the reason for this error:
Error: Response status code does not indicate success: 403 (Forbidden).
I am receiving an error when trying to create a new online environment, even though the app authentication is a success. The following is the log from the step
Create Developer Environment
: