Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

problem connect Business Central with visual studio code credential type UserPassword UserName

(0) ShareShare
ReportReport
Posted on by 99

Hi to all,

we have a big problem connecting with visual studio code to Business Central Spring 2019 CU 15.

We have a server #1 BC with credential type login UserName (mandatory for us) and also we have server #2 BC web instance perfectly connected with ssl.

The web client is working. The RTC client is working.

We can't download the symbols and do not debugging with visual studio code. Port 7049 and other ports are open. We always get the error when debugging

[2020-08-05 16:05:30.86] Error: Impossibile stabilire la connessione. Risposta non corretta della parte connessa dopo l'intervallo di tempo oppure mancata risposta dall'host collegato.
Impossibile stabilire la connessione. Risposta non corretta della parte connessa dopo l'intervallo di tempo oppure mancata risposta dall'host collegato.
[2020-08-05 16: 05: 30.86] Error: The connection could not be established. Incorrect response of the connected party after the time interval or no response from the connected host.
Could not establish connection. Incorrect response of the connected party after the time interval or no response from the connected host.
In launch.json have this setup:
{
    "version""0.2.0",
    "configurations": [
        {
            "type""al",
            "request""launch",
            "name""server1",
            "port"7049,
            "server""https://bc.domain.icom/BC140",
            "serverInstance""BC140",
            "authentication":"UserPassword",
            "startupObjectId"22,
            "startupObjectType""Page",
            "breakOnError"true,
            "launchBrowser"true,
            "enableLongRunningSqlStatements"true,
            "enableSqlInformationDebugger"true,
            "tenant""default"
        }
    ]
}

In app.json:

{
  "id""1f58b07a-16a4-44d1-b604-b5b02d670477",
  "name""TestConnBC140",
  "publisher""Default publisher",
  "version""1.0.0.0",
  "brief""",
  "description""",
  "privacyStatement""",
  "EULA""",
  "help""",
  "url""",
  "logo""",
  "dependencies": [],
  "screenshots": [],
  "platform""14.0.0.0",
  "application""14.0.0.0",
  "idRanges": [
    {
      "from"50100,
      "to"50149
    }
  ],
  "showMyCode"true,
  "runtime""3.0",
  "features": ["TranslationFile"]
}
 
Any suggestions?
Thanks in advance.
  • JeppeBylov Profile Picture
    5 on at
    RE: problem connect Business Central with visual studio code credential type UserPassword UserName

    Hi Marco,

    Can you explain how authentication would work in such a scenario and wouldn't it require 2 service instances? One for AccessControlService(AAD) and one for NavUserPassword?

    With NavUserPassword as soon as you hit the webclient, you'll be asked for NavUserPassword credentials and wouldn't get redirected to login.microsoftonline.com.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: problem connect Business Central with visual studio code credential type UserPassword UserName

    Hello,

    Best is to use AAD authentication for your users by using NavUserPassword on the NST. NavUserPassword will support both NavUserPassword and AAD authentication. For development purposes, you can use NavUserPassword in visual studio code. Your users can use modern authentication / AAD authentication.

    Thanks.

  • Ramon C. Profile Picture
    99 on at
    RE: problem connect Business Central with visual studio code credential type UserPassword UserName

    Hello,

    I use UserName in server instance, because, as described from microsoft we have user not in LAN Domain that have to connect to the BC server. These users are from other customer or from the same domain of the server but in a WAN environment and they can't have a windows profile setup with the user of the same domain of the BC server.

    In this situation Microsft say to use UserNamen credential type.

    In the visual studio code the difference between windows and userpassword mode are the request of digit user and password. In the windows mode the visual studio get the user of the windows profile, in user pasword ask for a user and a password. I use the userpassword in the visual studio because we have our pc setting up with windows profile  of our office 365 user but we have to connect with our domain\user in the BC server.

    But our question is: "if I have to connect to a BC of my customer what kind of user and what kind of instance BC credential type I have to use???"

    Thansk in advance.

    Best Regards

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: problem connect Business Central with visual studio code credential type UserPassword UserName

    Hello,

    In launch.json you did select UserPassword which is expecting authentication type in NST instanc to be configuered with NavUserPassword. Here the authentication type is UserName. In Visual Studio code / AL Designer, you have option of AAD, UserPassword and Windows. Best match would be Windows when using UserName, but I did not test myself if that would work. There is no specific authentication type that does support a similar one as UserName.

    AAD authentication type is not supported in this setup. 

    More information here:
    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-json-files

    Hope it does help.

    Thanks.

  • Ramon C. Profile Picture
    99 on at
    RE: problem connect Business Central with visual studio code credential type UserPassword UserName

    Yes.

    It' configured with UserName, not NavUserPassword. Is it the problem? I can't connect with visual studio code with credential type DOMAIN\user and password but I have to connect with navuserpassword?

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: problem connect Business Central with visual studio code credential type UserPassword UserName

    Hello,

    The NST instance is configured with UserName authentication and not NavUserPassword?

    Thanks.

  • Ramon C. Profile Picture
    99 on at
    RE: problem connect Business Central with visual studio code credential type UserPassword UserName

    Thank for reply first of all.

    I modified in this way:

    {

       "version": "0.2.0",

       "configurations": [

           {

               "type": "al",

               "request": "launch",

               "name": "server1",

               "port": 7049,

               "server": "https://bc.domain.com",

               "serverInstance": "BC140",

               "authentication":"UserPassword",

               "startupObjectId": 22,

               "startupObjectType": "Page",

               "breakOnError": true,

               "launchBrowser": true,

               "enableLongRunningSqlStatements": true,

               "enableSqlInformationDebugger": true,

               "tenant": "default"

           }

       ]

    }

    But I receive the same error.

    [2020-08-05 18:02:18.28] Error: An error occured while processing the request.

    Request ID: 1b869515-a449-494f-b9c2-3fea57b29abe

    Session ID: c76645e8-f865-4ce0-83d1-5fa3965bf249

    If you are targeting a cloud instance, supply these IDs if contacting Microsoft support.

    Microsoft (R) AL Compiler version 5.0.4.50830

    Copyright (C) Microsoft Corporation. All rights reserved

    Compilation started for project 'TestConnessioneBC365' containing '1' files at '18:2:18.301'.

    error AL1045: The package cache c:\Users\RamonC\Documents\AL\TestConnBC365\./.alpackages could not be found.

    Compilation ended at '18:2:18.303'.

    Error: The package could not be created.

    Now I have linked the orignal sql db Demo Database BC (14-0) in the BC instance e try to connect to web server local instance but nothing to do. The result is the same error.

    I begin to think I don't have any symbols installed on the server, but in the folder "C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\140\AL Development Environment" I have the right files of the install DVD...

    Also I tried to connect in the browser the link

    bc.domain.com:7249/.../packages

    but nothing to do. I didn't get the page.

    Thanks in advance to all.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: problem connect Business Central with visual studio code credential type UserPassword UserName

    Your launch.json seems not correct. "server" should be https://bc.domain.icom" (server name without the instance name) and "serverInstance""BC140",

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,190 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,968 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans