Sunday, December 10, 2023

Snapshot Debug for debugging in Production Environment in BC SaaS

Hello Friends,

We can use Snapshot Debug for debugging in Production Environment in BC SaaS

Snapshot debugging allows a delegated admin to record AL code that runs on the server, and once it has run, debug the recorded snapshot in Visual Studio Code. For a delegated admin to create and download a snapshot file that exists on the server on behalf of an end-user, the delegated admin must be part of the D365 Snapshot Debug permission group.

From Visual Studio Code, you start a snapshot by creating a snapshot configuration file. There are two template configurations for a snapshot, which are accessed by selecting Add Configuration in Visual Studio Code.

AL: Initialize a snapshot debugging session locally

AL: Initialize a snapshot debugging session on cloud













Below configuration added in launch.json

        {

          "name": "snapshotInitialize: Microsoft production cloud",
          "type": "al",
          "request": "snapshotInitialize",
          "environmentType": "Production",
          "environmentName": "production",
          "tenant": "0cd33610-3443-4d21-a9a1-5b0f3ae1dc84",
          "breakOnNext": "WebClient",
          "userId": "BCADMIN",
          "executionContext": "DebugAndProfile",
          "snapshotVerbosity": "Full"
      }

Useful shortcut for snapshot debug:

F7             Start a snapshot debugging session    //Start   

                 Opne BC Production Env and Process Tran. and Generate Error

Alt+F7     Finish a snapshot debugging session   //Finish  

                 Wait for Few min to system to download zip file in Snapshot folder

Shift+F7   List all available snapshots          

                  //List of downloaded Snapshot - Click on Snapshot to start debug


PS: Status of a snapshot debugging session

  • Initialized – A request is issued and the server is waiting for the next session to be snapshot debugged based on the above rules.
  • Started – You have attached to an end-user session to snapshot debug.
  • Finished – When the snapshot debugging session has finished.
  • Downloaded – When the snapshot file is downloaded.


























Done.

Thank you for reading.
Keep Sharing....Keep Growing...

No comments:

Post a Comment