[SalesForce] VSCODE for Salesforce Authorize org using session Id

I'm trying to Authorize my salesforce org to VSCODE using session Id as mentioned in the documentation. But it is not working. Can you please let me know what mistake I'm doing here.

  1. sfdx force:config:set instanceUrl=https://na35.salesforce.com
    (from documentation)
  2. sfdx force:mdapi:deploy --deploydir **md-dir** --targetusername **access-token**

Documentation link :
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_existing_access_token.htm

I'm getting the following error : ERROR running
force:mdapi:deploy:report: Must pass a username and/or OAuth options
when creating an AuthInfo instance.

Below is the error

Best Answer

Please use, proper instance URL and it'll work fine.

if you use - />sfx force:org:display it will show the correct instance name( something like domain .my.salesforce.com ) along with current access token.

I tried the same, and it is working fine.

Screemsjpt - Depicting the sfdx:force:deploy with the help of access token

Related Topic