I am trying to connect VS Code to a client's OnPrem server and I am running into problems.
The client is OnPrem, currently on version 18.1.
They use AAD authentication.
I have VS Code installed on their app server.
The MS documentation says it doesn't work with OnPrem solutions, so I set the environmentType to "Production" in the launch.json file.
Here's what my launch.json looks like:
"version": "0.2.0",
"configurations": [
{
"name": "XXXXX",
"request": "launch",
"type": "al",
"environmentType": "Production",
"server": "http://SubDomain.MyClient.com",
"serverInstance": "ServerInstance",
"authentication": "AAD",
"startupObjectId": 50022,
"startupObjectType": "Page",
"breakOnError": true,
"launchBrowser": true,
"enableLongRunningSqlStatements": true,
"enableSqlInformationDebugger": true,
"tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"schemaUpdateMode": "Synchronize",
"port": 7059
}
Debugging is enabled in their server. The Web Base URL is populated.
The first time I tried this I got an invitation to microsoft.com/devicelogin and a code to enter. Once I had done that, the connection fails with this message in the terminal:
[2021-09-30 11:44:47.08] Targeting Dynamics 365 Business Central with tenant AAD domain name 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.
[2021-09-30 11:44:47.09] Sending request to
api.businesscentral.dynamics.com/.../metadata[2021-09-30 11:44:47.71]
The request for path /v2.0/production/dev/metadata failed with code NotFound. Reason: Not Found[2021-09-30 11:44:47.71] Sending request to
api.businesscentral.dynamics.com/.../webendpoint[2021-09-30 11:44:47.76]
The request for path /v2.0/production/dev/webendpoint failed with code NotFound. Reason: Not Found
Any suggestions would be greatly appreciated.