microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
732 stars 243 forks source link

Unable to download symbols for newly created local docker sandbox environment (2020 wave 2) #6273

Open QaziTanzeel opened 3 years ago

QaziTanzeel commented 3 years ago

Hello folks, I created a local docker container of sandbox for wave 2, 2020. Following are the commands that I used to create the sandbox environment.

$artifactUrl = Get-BCArtifactUrl -select Latest
$credential = New-Object pscredential 'admin', (ConvertTo-SecureString -String 'Alpha_975' -AsPlainText -Force)
New-BcContainer -accept_eula -containerName ax365bc -artifactUrl $artifactUrl -Credential $credential -assignPremiumPlan -updateHosts -imageName mcr.microsoft.com/businesscentral -includeAL  -includeTestToolkit -installCertificateOnHost -memoryLimit 6G  -useSSL 

The container got successfully created and I can browse and everything seems fine. I then created an extension in VS Code using the AL Go, but when I try to download symbols I am getting the following error.

Authorization has failed or the credentials have expired. The credential cache has been cleaned. Any access to reach Business Central would require new authorization.

Following the launch.json and app.json files

Launch.json

{ "version": "0.2.0", "configurations": [ { "name": "Your own server", "request": "launch", "type": "al", "environmentType": "Sandbox", "server": "https://ax365bc", "serverInstance": "BC", "authentication": "UserPassword", "startupObjectId": 22, "startupObjectType": "Page", "breakOnError": true, "launchBrowser": true, "enableLongRunningSqlStatements": true, "enableSqlInformationDebugger": true, "tenant": "default" } ] }

app.json

{ "id": "8d8e0534-bda4-4907-8867-aeb58e05f623", "name": "ALProject3", "publisher": "Default publisher", "version": "1.0.0.0", "brief": "", "description": "", "privacyStatement": "", "EULA": "", "help": "", "url": "", "logo": "", "dependencies": [], "screenshots": [], "platform": "17.0.0.0", "application": "17.0.0.0", "idRanges": [ { "from": 50100, "to": 50149 } ], "contextSensitiveHelpUrl": "https://ALProject3.com/help/", "showMyCode": true, "runtime": "6.0" }

This is the user card, below, I tried the username with and without the domain name, but no luck.

(image)

atoader commented 3 years ago

Can you try clearing your credentials and redownload the symbols?

QaziTanzeel commented 3 years ago

after creating the new docker machine based on runtime 17 (2020 wave 2). I was unable to download even for the first time. I cleared credentials for not less than hundred of times but no luck.

TrippyZ commented 3 years ago

Adding "tenant": "default" to launch.json solved it for me.

https://demiliani.com/2020/08/28/dynamics-365-business-central-sandbox-docker-containers-and-multitenancy/

atoader commented 3 years ago

We will look into improving the experience by introducing a better error message.

jeffreypoen commented 3 years ago

Adding "tenant": "default" to launch.json solved it for me.

https://demiliani.com/2020/08/28/dynamics-365-business-central-sandbox-docker-containers-and-multitenancy/

Thanks, this works for me :-)

KuljitSinghParmar commented 3 years ago

Adding "tenant": "default" to launch.json solved it for me.

https://demiliani.com/2020/08/28/dynamics-365-business-central-sandbox-docker-containers-and-multitenancy/

Worked for me too. Thanks

atoader commented 3 years ago

We will look into changing the default configuration to contain the default tenant.
https://freddysblog.com/tag/multitenancy/

AbsolutelyFreeWeb commented 3 years ago

I'm getting this error message against a real installation. I do have tenant default already (and so did the OP). It doesn't ask for any credentials, and I have not given any. It's a different problem though because it's windows login, and my computers login differs from the login on the server which I connect to using a vpn tunnel. A better error message, or a prompt to enter the credentials of the server is needed.. I had to revert to UserPassword login to be able to debug there. I see you have input-needed tag attached. Let me know what you need to know @atoader

christianbraeunlich commented 2 years ago

Hey @atoader may I ask what's the current status of this https://github.com/microsoft/AL/issues/6273#issuecomment-751746196?

@AbsolutelyFreeWeb I don't think https://github.com/microsoft/AL/issues/6273#issuecomment-782303315 belongs here any longer, so maybe it's time to reference it in a new issue.

This issue can be closed, even tho @QaziTanzeel hasn't answered to this, I think.

Thanks @TrippyZ for the solution!

dzzzb commented 2 years ago

It looks to me like atoader no longer works on this project / for MS.

bdgjope commented 2 years ago

I am getting this error on a newly created sandbox container running the latest build (19.5). Tenant is set to Default, but on the other hand it is also set to default in the supplied launch.json of the original question. Unless I misunderstand something. Does anybody have any other idea what can be done about it?

TrippyZ commented 2 years ago

I suggest that you raise a new issue and refer back to this one.

rehansatti-DI commented 10 months ago

I have the same issue on an Onpremis BC 2017. This is how it resolved https://dynamics-inspire.com/any-access-to-reach-business-central-would-require-new-authorization/