Skip to content

Commit 4b91ec9

Browse files
authored
Merge pull request #19673 from markingmyname/vasu
[Azure Data Studio] Adding a link that open directly to a notebook
2 parents ed3a3fa + 8766605 commit 4b91ec9

3 files changed

Lines changed: 24 additions & 19 deletions

File tree

docs/azure-data-studio/notebooks/parameterize-papermill.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.date: 06/18/2021
1818
This article shows you how to create and run a parameterized notebook in Azure Data Studio using the python kernel.
1919

2020
> [!Note]
21-
> Currently parameterization can be used with Python, PySpark, PowerShell, and .Net Interactive Kernels.
21+
> Currently parameterization can be used with Python, PySpark, PowerShell, and .Net Interactive Kernels.
2222
2323
## Prerequisites
2424

@@ -53,7 +53,7 @@ The steps in this section all run within an Azure Data Studio notebook.
5353

5454
:::image type="content" source="media/notebooks-parameterization/install-list-papermill.png" alt-text="List":::
5555

56-
4. You can test if papermill is loaded properly by checking the version of papermill.
56+
4. You can test if Papermill is loaded properly by checking the version of Papermill.
5757

5858
```python
5959
import papermill
@@ -64,7 +64,7 @@ The steps in this section all run within an Azure Data Studio notebook.
6464

6565
## Set up a parameterized notebook
6666

67-
**To open the below notebook example in Azure Data Studio, click [here](azuredatastudio://microsoft.notebook/open?url=https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/applications/azure-data-studio/parameterization.ipynb) and follow along.**
67+
**To open the below notebook example in Azure Data Studio, visit [GitHub](https://github.com/microsoft/sql-server-samples/blob/master/samples/applications/azure-data-studio/parameterization.ipynb and follow along.**
6868

6969
1. Verify the **Kernel** is set to *Python3*.
7070

@@ -109,25 +109,26 @@ Papermill can be executed two ways:
109109
To execute a notebook using the CLI, enter the papermill command in the terminal with the input notebook, location for output notebook, and options.
110110

111111
> [!Note]
112-
> Papermill Command Line Interface Documentation can be found [here](https://papermill.readthedocs.io/en/latest/usage-execute.html#execute-via-cli).
112+
> Papermill Command Line Interface Documentation can be found [here](https://papermill.readthedocs.io/en/latest/usage-execute.html#execute-via-cli).
113113
114114
1. Execute Input Notebook with new parameters.
115115

116116
```shell
117117
papermill Input.ipynb Output.ipynb -p x 10 -p y 20
118118
```
119119

120-
This will execute the Input Notebook with new values for parameters **x** and **y**.
120+
This executes the Input Notebook with new values for parameters **x** and **y**.
121121

122122
2. After execution view the new output parameterized notebook.
123+
123124
You can note that there's a new cell labeled **# Injected-Parameters** containing the new parameter values passed in via CLI.
124125

125126
:::image type="content" source="media/notebooks-parameterization/output-notebook.png" alt-text="Output Notebook":::
126127

127128
### Parameterized Python API execution
128129

129130
> [!Note]
130-
> Papermill Python API Documentation can be found [here](https://papermill.readthedocs.io/en/latest/usage-execute.html#execute-via-the-python-api).
131+
> Papermill Python API Documentation can be found [here](https://papermill.readthedocs.io/en/latest/usage-execute.html#execute-via-the-python-api).
131132
132133
1. Create a new notebook and change the **Kernel** to *Python 3*.
133134
![New Notebook](media/notebooks-kqlmagic/install-new-notebook.png)

docs/azure-data-studio/notebooks/parameterize-uri.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.date: 06/14/2021
1818
This article shows you how to create and run a parameterized notebook in Azure Data Studio with the python kernel.
1919

2020
> [!Note]
21-
> Currently parameterization can be used with Python, PySpark, PowerShell, and .Net Interactive Kernels.
21+
> Currently parameterization can be used with Python, PySpark, PowerShell, and .Net Interactive Kernels.
2222
2323
## Prerequisites
2424

@@ -29,21 +29,24 @@ This article shows you how to create and run a parameterized notebook in Azure D
2929

3030
URI parameterization programmatically adds parameters to the query of the ADS URI to open the notebook in ADS with new parameters.
3131

32-
Azure Data Studio Notebook URI supports HTTPS/HTTP/FILE URI schema and follows the format:
33-
_azuredatastudio:\/\/microsoft.notebook\/open?url=_
32+
Azure Data Studio Notebook URI supports HTTPS/HTTP/FILE URI schema and follows the format:
3433

35-
The format to pass in parameters with the ADS Notebook URI is as follows:
36-
_azuredatastudio:\/\/microsoft.notebook\/open?url=LinkToNotebook_***?x=1&y=2***
34+
`_azuredatastudio:\/\/microsoft.notebook\/open?url=_`
35+
36+
The format to pass in parameters with the ADS Notebook URI is as follows:
37+
38+
`_azuredatastudio:\/\/microsoft.notebook\/open?url=LinkToNotebook_***?x=1&y=2***`
3739

3840
In the URI query, use **&** to indicate a new parameter to be injected.
3941

4042
## URI Parameterization Example
4143

42-
**To open the below notebook example in Azure Data Studio, click [here](azuredatastudio://microsoft.notebook/open?url=https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/applications/azure-data-studio/parameterization.ipynb) and follow along.**
44+
**To open the below notebook example in Azure Data Studio, visit [GitHub](https://github.com/VasuBhog/sql-server-samples/blob/master/samples/applications/azure-data-studio/parameterization.ipynb) and follow along.**
4345

44-
Below is the contents and structure of the notebook, you must use a notebook that has a cell tagged with parameters.
46+
Below is the contents and structure of the notebook, you must use a notebook that has a cell tagged with parameters.
4547

4648
Tag a code cell in Azure Data Studio as **Parameters Cell**.
49+
4750
:::image type="content" source="media/notebooks-parameterization/make-parameter-cell.png" alt-text="Parameter Cell Notebook":::
4851

4952
Below is the contents of the notebook:
@@ -66,15 +69,16 @@ Below is the contents and structure of the notebook, you must use a notebook tha
6669
1. We can either use the search bar of any browser or a markdown cell to open up the notebook URI link.
6770

6871
Below is the notebook URI for parameterizing the notebook with new x and y values:
69-
[_azuredatastudio://microsoft.notebook/open?url=https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/applications/azure-data-studio/parameterization.ipynb_**?x=10&y=20**](azuredatastudio://microsoft.notebook/open?url=https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/applications/azure-data-studio/parameterization.ipynb?x=10&y=20)
72+
73+
`_azuredatastudio://microsoft.notebook/open?url=https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/applications/azure-data-studio/parameterization.ipynb_**?x=10&y=20**`
7074

7175
:::image type="content" source="media/notebooks-parameterization/search-bar.png" alt-text="URI link in Search bar":::
7276

73-
When opening the link from the web browser, you will be prompted to open the notebook in Azure Data Studio. Select **Open Azure Data Studio**.
77+
When opening the link from the web browser, you're prompted to open the notebook in Azure Data Studio. Select **Open Azure Data Studio**.
7478

7579
:::image type="content" source="media/notebooks-parameterization/donwload-prompt.png" alt-text="Download Prompt":::
7680

77-
2. You will then be prompted to download and open the notebook with new parameters.
81+
2. Then you're prompted to download and open the notebook with new parameters.
7882

7983
Once you select **Yes**, view the new parameterized notebook and **run all cells** to see the new output.
8084

docs/azure-data-studio/notebooks/run-with-parameters.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.date: 06/14/2021
1818
This article shows you how to create and run a parameterized notebook in Azure Data Studio with the python kernel.
1919

2020
> [!Note]
21-
> Currently parameterization can be used with Python, PySpark, PowerShell, and .Net Interactive Kernels.
21+
> Currently parameterization can be used with Python, PySpark, PowerShell, and .Net Interactive Kernels.
2222
2323
## Prerequisites
2424

@@ -30,11 +30,11 @@ This article shows you how to create and run a parameterized notebook in Azure D
3030
The `Run with Parameters` notebook action enables users to quickly set new parameters for their notebook by allowing the user to input new parameters from the UI.
3131

3232
> [!Note]
33-
> The parameter cell has to be formatted with each new parameter on a new line.
33+
> The parameter cell has to be formatted with each new parameter on a new line.
3434
3535
## Set up a notebook for parameterization in Azure Data Studio
3636

37-
**To open the below notebook example in Azure Data Studio, click [here](azuredatastudio://microsoft.notebook/open?url=https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/applications/azure-data-studio/parameterization.ipynb) and follow along.**
37+
**To open the below notebook example in Azure Data Studio, visit [GitHub](https://github.com/microsoft/sql-server-samples/blob/master/samples/applications/azure-data-studio/parameterization.ipynb and follow along.**
3838

3939
The steps in this section all run within an Azure Data Studio notebook.
4040

0 commit comments

Comments
 (0)