Run U-SQL and debug locally in Visual Studio Code
This article describes how to run U-SQL jobs on a local development machine to speed up early coding phases or to debug code locally in Visual Studio Code. For instructions on Azure Data Lake Tool for Visual Studio Code, see Use Azure Data Lake Tools for Visual Studio Code.
Only Windows installations of the Azure Data Lake Tools for Visual Studio support the action to run U-SQL locally and debug U-SQL locally. Installations on macOS and Linux-based operating systems do not support this feature.
Set up the U-SQL local run environment
Select Ctrl+Shift+P to open the command palette, and then enter ADL: Download Local Run Package to download the packages.
Locate the dependency packages from the path shown in the Output pane, and then install BuildTools and Win10SDK 10240. Here is an example path:
2.1 To install BuildTools, click visualcppbuildtools_full.exe in the LocalRunDependency folder, then follow the wizard instructions.
2.2 To install Win10SDK 10240, click sdksetup.exe in the LocalRunDependency/Win10SDK_10.0.10240_2 folder, then follow the wizard instructions.
Set up the environment variable. Set the SCOPE_CPP_SDK environment variable to:
Start the local run service and submit the U-SQL job to a local account
For the first-time user, use ADL: Download Local Run Package to download local run packages, if you have not set up U-SQL local run environment.
Select Ctrl+Shift+P to open the command palette, and then enter ADL: Start Local Run Service.
Select Accept to accept the Microsoft Software License Terms for the first time.
The cmd console opens. For first-time users, you need to enter 3, and then locate the local folder path for your data input and output. If you are unsuccessful defining the path with backslashes, try forward slashes. For other options, you can use the default values.
Select Ctrl+Shift+P to open the command palette, enter ADL: Submit Job, and then select Local to submit the job to your local account.
After you submit the job, you can view the submission details. To view the submission details, select jobUrl in the Output window. You can also view the job submission status from the cmd console. Enter 7 in the cmd console if you want to know more job details.
Start a local debug for the U-SQL job
For the first-time user:
- Use ADL: Download Local Run Package to download local run packages, if you have not set up U-SQL local run environment.
- Install .NET Core SDK 2.0 as suggested in the message box, if not installed.
- Install C# for Visual Studio Code as suggested in the message box if not installed. Click Install to continue, and then restart VSCode.
Follow steps below to perform local debug:
Select Ctrl+Shift+P to open the command palette, and then enter ADL: Start Local Run Service. The cmd console opens. Make sure that the DataRoot is set.
Set a breakpoint in your C# code-behind.
Back to script editor, right-click and select ADL: Local Debug.
- Use the Azure Data Lake Tools for Visual Studio Code
- Develop U-SQL with Python, R, and CSharp for Azure Data Lake Analytics in VSCode
- Get started with Data Lake Analytics using PowerShell
- Get started with Data Lake Analytics using the Azure portal
- Use Data Lake Tools for Visual Studio for developing U-SQL applications
- Use Data Lake Analytics(U-SQL) catalog