Merge pull request #945 from VasuBhog/master

Parameterization Notebook Sample
This commit is contained in:
Drew Skwiers-Koballa
2021-06-18 14:12:26 -07:00
committed by GitHub
2 changed files with 144 additions and 0 deletions
@@ -0,0 +1,65 @@
<!-- Always leave the MS logo -->
![](./media/solutions-microsoft-logo-small.png)
# Azure Data Studio Notebook Samples
Helpful notebooks for troubleshooting and new features in Azure Data Studio.
### Contents
[About this sample](#about-this-sample)<br/>
[Before you begin](#before-you-begin)<br/>
[Run this sample](#run-this-sample)<br/>
[Sample details](#sample-details)<br/>
[Related links](#related-links)<br/>
<a name=about-this-sample></a>
## About this sample
<!-- Delete the ones that don't apply -->
- **Applies to:** Azure Data Studio
- **Key features:** Notebook Samples
- **Programming Language:** SQL & Python Notebooks
- **Authors:** Vasu Bhog [vabhog]
<a name=before-you-begin></a>
## Before you begin
To run this sample, you need the following prerequisites.
**Software prerequisites:**
<!-- Examples -->
1. Azure Data Studio 1.30.0
2. Python
## Run this sample
<!-- Step by step instructions. Here's a few examples -->
For Parameterization.ipynb Sample:
1. From Azure Data Studio, open the **Notebook** file.
2. Follow docs for paremeteization [here](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/parameterize-papermill).
## Sample details
This Notebook allows users to follow along the docs as well as use a already parameterized notebook.
## Related Links
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
For more information, see these articles:
* [Notebooks Overview](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/notebooks-guidance)
* [SQL Kernel](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/notebooks-sql-kernel)
* [Python Kernel](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/notebooks-python-kernel)
* [Kusto Kernel](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/notebooks-kusto-kernel)
* [KqlMagic](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/notebooks-kqlmagic)
* [Papermill Parameterization](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/parameterize-papermill)
* [URI Parameterization](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/parameterize-uri)
* [Run with Parameters](https://docs.microsoft.com/en-us/sql/azure-data-studio/notebooks/run-with-parameters)
@@ -0,0 +1,79 @@
{
"metadata": {
"kernelspec": {
"name": "python3",
"display_name": "Python 3",
"language": "python"
},
"language_info": {
"name": "python",
"version": "3.6.8",
"mimetype": "text/x-python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"pygments_lexer": "ipython3",
"nbconvert_exporter": "python",
"file_extension": ".py"
}
},
"nbformat_minor": 2,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": [
"# Parameterization in Azure Data Studio"
],
"metadata": {
"azdata_cell_guid": "de96a5d8-105e-403d-a284-134eef3d8533"
}
},
{
"cell_type": "code",
"source": [
"x = 2.0\n",
"y = 5.0"
],
"metadata": {
"azdata_cell_guid": "45afab06-c690-4c94-a67c-47690d93c28d",
"tags": [
"parameters"
]
},
"outputs": [],
"execution_count": 1
},
{
"cell_type": "code",
"source": [
"addition = x + y\n",
"multiply = x * y"
],
"metadata": {
"azdata_cell_guid": "c962b295-06ee-4c1f-93c6-4d53fa347755"
},
"outputs": [],
"execution_count": 2
},
{
"cell_type": "code",
"source": [
"print(\"Addition: \" + str(addition))\n",
"print(\"Multiplication: \" + str(multiply))"
],
"metadata": {
"azdata_cell_guid": "d3c849f6-fd01-467d-9240-1e8831b5d19f"
},
"outputs": [
{
"name": "stdout",
"text": "Addition: 7.0\nMultiplication: 10.0\n",
"output_type": "stream"
}
],
"execution_count": 3
}
]
}