+ Start a Discussion
Kaustubh LabheKaustubh Labhe 

VScode connect to org in a project

Hi devs,

Fairley new to SFDX and Vscode. If I have created a project folder once (remotely) via VSCode and say terminate the session. The next time I open VSCode, how can I easily log in to the same org or authenticate the same org which is saved under the 'Orgs' folder. Without having to reauthenticate it each time. Hope this makes sense. 
Best Answer chosen by Kaustubh Labhe
Ajay K DubediAjay K Dubedi
Hi Kaustubh,

When you created first time a folder in VS code than you have followed these step:
- Create a project with Manifest
- Authorize an Org (on click this you will give access your org to vs code)
- Retrieve Source in Manifest from Org

Then you can get your Org data in your VS code folder and when you will reopen this Without having to re-authenticate it each time.
If you change anything in your org then you can retrieve your data through a manifest(On click on manifest there are a package.xml file,
open package.xml and then on right click you can retrieve your data).

For more information refer: https://www.youtube.com/watch?v=7qR0c8h5cCU

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi

All Answers

Ajay K DubediAjay K Dubedi
Hi Kaustubh,

When you created first time a folder in VS code than you have followed these step:
- Create a project with Manifest
- Authorize an Org (on click this you will give access your org to vs code)
- Retrieve Source in Manifest from Org

Then you can get your Org data in your VS code folder and when you will reopen this Without having to re-authenticate it each time.
If you change anything in your org then you can retrieve your data through a manifest(On click on manifest there are a package.xml file,
open package.xml and then on right click you can retrieve your data).

For more information refer: https://www.youtube.com/watch?v=7qR0c8h5cCU

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
This was selected as the best answer
Alain CabonAlain Cabon
Hi,

Did you launch VS Code where there is a file:  sfdx-project.json ?

c:\projects\Testing2>ls
config  force-app  manifest  README.md  sfdx-project.json     ( good because there is this important json project )

c:\projects\Testing2>code .      ( launch VS Code from there exactly )

User-added image

You should see automatically the connected org (here Testing2) after one minute (reloading of the extensions).
This delay time is the most unsetting of VS Code with Salesforce. Sometimes, the connection seems immediate but that could be quite long the next time. 
That may not be immediate, but nevertheless, that should end up correctly otherwise post the remaining errors (still from the blue status bar).