Business Central Debug on different Sandboxes

Business Central Debug on different Sandboxes

Good morning,

Someone asked me for info on how to debug in the sandbox in a SaaS environment, where there are more than one sandbox.

The thing is simple, but sometimes it happens that an error is returned when there are more Sandboxes; in this case, it is necessary to connect to the correct tenant and sandbox, otherwise the VS code connects to the Default sandbox and we may be able to publish an extension but not be able to debug.

Example of Configuration

Two Active Sandboxes in this scenario

#1 – Access to Default “Microsoft Cloud Sandbox”

Launch.json

{

“version”: “0.2.0”,

“configurations”: [

{

“name”: “Microsoft cloud sandbox”,

“type”: “al”,

“request”: “launch”,

“startupObjectId”: 22,

“breakOnError”: true,

“breakOnRecordWrite”: false,

“launchBrowser”:true

}

]

}

#2 – Access to a “Selected Sandbox”

Launch.json

{

“version”: “0.2.0”,

“configurations”: [

{

“name”: “Sandbox14”,

“type”: “al”,

“request”: “launch”,

“startupObjectId”: 22,

“breakOnError”: true,

“breakOnRecordWrite”: true,

“launchBrowser”: true,

“sandboxName”: “Sandbox14”, //SANDBOX NAME

“tenant”: “XXXX-XXXXXXX-XXXXX-XXXXX” //TENANT ID

}

]

}

#3 – CHECK THE DIFFERENCES

{

“version”: “0.2.0”,

“configurations”: [

{

“name”: “Microsoft cloud sandbox”,

“type”: “al”,

“request”: “launch”,

“startupObjectId”: 22,

“breakOnError”: true,

“breakOnRecordWrite”: false,

“launchBrowser”: true

},

{

“name”: “Sandbox”,

“type”: “al”,

“request”: “launch”,

“startupObjectId”: 22,

“breakOnError”: true,

“breakOnRecordWrite”: true,

“launchBrowser”: true,

“sandboxName”: “Sandbox”, //SANDBOX NAME

“tenant”: “xxxxxx-xxxx-xxxxx-xxxxx” //TENANT ID

}

]

}

With this configuration you can Publish and Debug on your selected Sandbox.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: