title: 'Azure Data Lake Tools: U-SQL local run and local debug with Visual Studio Code | Microsoft Docs' description: 'Learn how to use Azure Data Lake Tools for Visual Studio Code to local run and local debug.' Keywords: VScode,Azure Data Lake Tools,Local run,Local debug,Local Debug,preview storage file,upload to storage path services: data-lake-analytics documentationcenter: '' author: jejiang manager: DJ editor: jejiang tags: azure-portal
ms.assetid: dc9b21d8-c5f4-4f77-bcbc-eff458f48de2 ms.service: data-lake-analytics ms.devlang: ms.topic: article ms.tgt_pltfrm: ms.workload: big-data ms.date: 07/14/2017 ms.author: jejiang
In this document, you learn 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.
-
Select Ctrl+Shift+P to open the command palette, and then enter ADL: Download Local Run Dependency 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:
C:\Users\xxx\.vscode\extensions\usqlextpublisher.usql-vscode-ext-x.x.x\LocalRunDependency
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:
C:\Users\xxx\.vscode\extensions\usqlextpublisher.usql-vscode-ext-x.x.x\LocalRunDependency\CppSDK_3rdparty
-
Restart the OS to make sure that the environment variable settings take effect.
For the first-time user, use ADL: Download Local Run Dependency 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. 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.
For the first-time user:
-
Use ADL: Download Local Run Dependency 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.
- For using Azure Data Lake Tools for Visual Studio Code, see Use Azure Data Lake Tools for Visual Studio Code.
- For getting started information on Data Lake Analytics, see Tutorial: Get started with Azure Data Lake Analytics.
- For information about Data Lake Tools for Visual Studio, see Tutorial: Develop U-SQL scripts by using Data Lake Tools for Visual Studio.
- For the information on developing assemblies, see Develop U-SQL assemblies for Azure Data Lake Analytics jobs.