Bad request error with Download Symbols command on VSCode with a demo cloud Business Central
Describe the bug Hello, I a a noob at Business Central and VSCode. I have a 30 days trial for Business Central online. I've downloaded and installed VSCode on my pc (Windows 10 Familial Edition) and installed AL extension.
I created a new script with >AL:Go and choosed 5.0 version of BC. Then, when I tried Download Symbols command, it showed me the error message "Bad Request" :
[2020-05-12 13:12:56.78] Using reference symbols cache path: c:\Users\Pierre\Documents\AL\ALProject8./.alpackages [2020-05-12 13:12:56.82] Sending request to https://api.businesscentral.dynamics.com/v1.0/sandbox/dev/packages?publisher=Microsoft&appName=System&versionText=16.0.0.0 [2020-05-12 13:12:56.82] Sending request to https://api.businesscentral.dynamics.com/v1.0/sandbox/dev/packages?publisher=Microsoft&appName=System Application&versionText=16.0.0.0 [2020-05-12 13:12:56.82] Sending request to https://api.businesscentral.dynamics.com/v1.0/sandbox/dev/packages?publisher=Microsoft&appName=Base Application&versionText=16.0.0.0 [2020-05-12 13:12:57.31] The request for path /v1.0/sandbox/dev/packages?publisher=Microsoft&appName=System&versionText=16.0.0.0 failed with code BadRequest. Reason: Bad Request [2020-05-12 13:12:57.78] The request for path /v1.0/sandbox/dev/packages?publisher=Microsoft&appName=Base%20Application&versionText=16.0.0.0 failed with code BadRequest. Reason: Bad Request [2020-05-12 13:12:58.37] The request for path /v1.0/sandbox/dev/packages?publisher=Microsoft&appName=System%20Application&versionText=16.0.0.0 failed with code BadRequest. Reason: Bad Request [2020-05-12 13:12:58.37] Could not download reference symbols. Please ensure that:
- The correct server name and instance are specified in the launch.json file.
- The correct application version is specified in the app.json file.
- The dependencies are correctly specified in the app.json file.
To Reproduce
When I click on "Download Symbols" command, I have to connect to my online Microsoft Account through my browser.
I create a script with AL:Go and connect to my online account

Which I do successfully.

My Business Central on Firefox browser :

After that, when I try again to Download Symbols, I have this error message :

Here are my launch.json : { "version": "0.2.0", "configurations": [ { "type": "al", "request": "launch", "name": "Microsoft cloud sandbox", "startupObjectId": 22, "startupObjectType": "Page", "breakOnError": true, "launchBrowser": true, "enableLongRunningSqlStatements": true, "enableSqlInformationDebugger": true } ] }
My app.json : { "id": "7fd0594f-2c0e-4927-8a89-b1d222253cae", "name": "ALProject8", "publisher": "Default publisher", "version": "1.0.0.0", "brief": "", "description": "", "privacyStatement": "", "EULA": "", "help": "", "url": "", "logo": "", "dependencies": [ { "id": "63ca2fa4-4f03-4f2b-a480-172fef340d3f", "publisher": "Microsoft", "name": "System Application", "version": "16.0.0.0" }, { "id": "437dbf0e-84ff-417a-965d-ed2bb9650972", "publisher": "Microsoft", "name": "Base Application", "version": "16.0.0.0" } ], "screenshots": [], "platform": "16.0.0.0", "idRanges": [ { "from": 50100, "to": 50149 } ], "contextSensitiveHelpUrl": "https://ALProject8.com/help/", "showMyCode": true, "runtime": "5.0" }
My settings.json : { "al.defaultLaunchConfigurationName": "Microsoft cloud sandbox" }
How can I download symbols correctly please ?
I've read seveal topics about the same problem, but none of the solutions I've tried have worked. I changed version and and runtime numbers, I added a tenant... but still the same error.
How can I do please ?
Thank you.
Versions:
- AL Language : 5.0.271898
- Business Central : FR Business Central 16.0 (plateforme 16.0.11233.12864 + application 16.0.11240.11946)
I have the same problem.
Can you try:
- Setting "al.useLegacyRuntime" : true in your settings
- Restarting VSCode
- Clearing credentials
- Downloading symbols again ?
It might be that the device login that is causing issues.
Thank you for the answer. I tried that. Changed the way I log in to my account. Before it was on my browser, nom it's on Windows.
But the error message is the same when I try to Download Symbols.

But I see in my AL extension settings that there is twi fields in red :

And :

Is it related to my error ?
Thanks for your time.
I found a solution for my problem.
You have to define the tenant ID and sandboxName:

I tried your technique, and I obtain a new error :

It seems that I can't download symbols from a free trial sandbox. I need to have an active subscription.
Do you have an active one guilliano ?
Your tenant is wrong. Tenant is like a GUID.
You can find your tenant GUID in the Help section: (Question mark right up)

I've changed my tenant, and now I have a new error :

I've changed my tenant to the tenant indicated in my BC :

Try setting "disableHttpRequestTimeout":true in your launch.json for the current configuration.
You can't install the extension via Visual studio on a Production cloud. You have to create an sandbox, go to https://businesscentral.dynamics.com/TENANT GUID\admin
I've tried your url @guilliano with my tenant, and I've this screen on my brower :

Than you have to talk your administrator to do this.
I don't know who is my administrator. I'm alone in my home, it's not an account linked to a company. I just wanted to test C/AL extensions on my own.
I don't know who is my administrator. I'm alone in my home, it's not an account linked to a company. I just wanted to test C/AL extensions on my own.
Maybe this can help: https://thinkaboutit.be/2019/10/create-your-own-microsoft-demos-environment-for-free-and-valid-for-1-year/
@Magicrevette use the link from https://businesscentral.dynamics.com/AAD Tenant Id, where AAD Tenant Id you can take from the "Unauthorized" page you mentioned above. Then you need to create a Sandbox: click "Search" and type Sandbox, open Sandbox Environment -> Create. Then you should be able to download symbols. Please check also the version of the System, Base Application etc: click "Search", then type/choose "Extension Management".
Thank you for reaching out. Your issue seems to be a question about existing functionality. Please reach out to Business Central Community Forum to ask questions: (forum)[https://community.dynamics.com/business/f/758]. Thank you.