Skip to content

Commit 7193c96

Browse files
author
msebolt
committed
azurecli updates
1 parent b66df4b commit 7193c96

13 files changed

+101
-130
lines changed

articles/machine-learning/data-science-virtual-machine/dsvm-pools.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ author: vijetajo
1111
ms.author: vijetaj
1212
ms.topic: conceptual
1313
ms.date: 12/10/2018
14-
1514
---
1615

1716
# Create a shared pool of Data Science Virtual Machines
@@ -32,11 +31,13 @@ You can find a sample Azure Resource Manager template that creates a scale set w
3231

3332
You can create the scale set from the Azure Resource Manager template by specifying values for the parameter file in the Azure CLI:
3433

35-
```
34+
```azurecli-interactive
3635
az group create --name [[NAME OF RESOURCE GROUP]] --location [[ Data center. For eg: "West US 2"]
3736
az group deployment create --resource-group [[NAME OF RESOURCE GROUP ABOVE]] --template-uri https://raw.githubusercontent.com/Azure/DataScienceVM/master/Scripts/CreateDSVM/Ubuntu/dsvm-vmss-cluster.json --parameters @[[PARAMETER JSON FILE]]
3837
```
38+
3939
The preceding commands assume you have:
40+
4041
* A copy of the parameter file with the values specified for your instance of the scale set.
4142
* The number of VM instances.
4243
* Pointers to the Azure Files share.
@@ -54,18 +55,3 @@ Virtual machine scale sets support autoscaling. You can set rules about when to
5455

5556
* [Set up a common Identity](dsvm-common-identity.md)
5657
* [Securely store credentials to access cloud resources](dsvm-secure-access-keys.md)
57-
58-
59-
60-
61-
62-
63-
64-
65-
66-
67-
68-
69-
70-
71-

articles/machine-learning/data-science-virtual-machine/dsvm-secure-access-keys.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ One way to secure credentials is to use Windows Installer (MSI) in combination w
2323

2424
The documentation about managed identities for Azure resources and Key Vault comprises a comprehensive resource for in-depth information on these services. The rest of this article walks through the basic use of MSI and Key Vault on the Data Science Virtual Machine (DSVM) to access Azure resources.
2525

26-
## Create a managed identity on the DSVM
26+
## Create a managed identity on the DSVM
2727

28-
29-
```
28+
```azurecli-interactive
3029
# Prerequisite: You have already created a Data Science VM in the usual way.
3130
3231
# Create an identity principal for the VM.
@@ -35,9 +34,9 @@ az vm assign-identity -g <Resource Group Name> -n <Name of the VM>
3534
az resource list -n <Name of the VM> --query [*].identity.principalId --out tsv
3635
```
3736

38-
3937
## Assign Key Vault access permissions to a VM principal
40-
```
38+
39+
```azurecli-interactive
4140
# Prerequisite: You have already created an empty Key Vault resource on Azure by using the Azure portal or Azure CLI.
4241
4342
# Assign only get and set permissions but not the capability to list the keys.
@@ -46,7 +45,7 @@ az keyvault set-policy --object-id <Principal ID of the DSVM from previous step>
4645

4746
## Access a secret in the key vault from the DSVM
4847

49-
```
48+
```cmd
5049
# Get the access token for the VM.
5150
x=`curl http://localhost:50342/oauth2/token --data "resource=https://vault.azure.net" -H Metadata:true`
5251
token=`echo $x | python -c "import sys, json; print(json.load(sys.stdin)['access_token'])"`
@@ -57,7 +56,7 @@ curl https://<Vault Name>.vault.azure.net/secrets/SQLPasswd?api-version=2016-10-
5756

5857
## Access storage keys from the DSVM
5958

60-
```
59+
```cmd
6160
# Prerequisite: You have granted your VMs MSI access to use storage account access keys based on instructions at https://docs.microsoft.com/azure/active-directory/managed-service-identity/tutorial-linux-vm-access-storage. This article describes the process in more detail.
6261
6362
y=`curl http://localhost:50342/oauth2/token --data "resource=https://management.azure.com/" -H Metadata:true`
@@ -66,6 +65,7 @@ curl https://management.azure.com/subscriptions/<SubscriptionID>/resourceGroups/
6665
6766
# Now you can access the data in the storage account from the retrieved storage account keys.
6867
```
68+
6969
## Access the key vault from Python
7070

7171
```python
@@ -97,7 +97,7 @@ print("My secret value is {}".format(secret.value))
9797

9898
## Access the key vault from Azure CLI
9999

100-
```
100+
```azurecli-interactive
101101
# With managed identities for Azure resources set up on the DSVM, users on the DSVM can use Azure CLI to perform the authorized functions. The following commands enable access to the key vault from Azure CLI without requiring login to an Azure account.
102102
# Prerequisites: MSI is already set up on the DSVM as indicated earlier. Specific permissions, like accessing storage account keys, reading specific secrets, and writing new secrets, are provided to the MSI.
103103

articles/machine-learning/how-to-configure-environment.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ The following table shows each development environment covered in this article,
2727
| [Azure Databricks](#aml-databricks) | Ideal for running large-scale intensive machine learning workflows on the scalable Apache Spark platform. | Overkill for experimental machine learning, or smaller-scale experiments and workflows. Additional cost incurred for Azure Databricks. See [pricing details](https://azure.microsoft.com/pricing/details/databricks/). |
2828
| [The Data Science Virtual Machine (DSVM)](#dsvm) | Similar to the cloud-based compute instance (Python and the SDK are pre-installed), but with additional popular data science and machine learning tools pre-installed. Easy to scale and combine with other custom tools and workflows. | A slower getting started experience compared to the cloud-based compute instance. |
2929

30-
3130
This article also provides additional usage tips for the following tools:
3231

3332
* [Jupyter Notebooks](#jupyter): If you're already using the Jupyter Notebook, the SDK has some extras that you should install.
@@ -59,7 +58,6 @@ The Azure Machine Learning [compute instance (preview)](concept-compute-instance
5958
6059
There is nothing to install or configure for a compute instance. Create one anytime from within your Azure Machine Learning workspace. Provide just a name and specify an Azure VM type. Try it now with this [Tutorial: Setup environment and workspace](tutorial-1st-experiment-sdk-setup.md).
6160

62-
6361
Learn more about [compute instances](concept-compute-instance.md).
6462

6563
To stop incurring compute charges, [stop the compute instance](tutorial-1st-experiment-sdk-train.md#clean-up-resources).
@@ -95,7 +93,7 @@ To use the DSVM as a development environment:
9593
9694
* To create an Ubuntu Data Science Virtual Machine, use the following command:
9795

98-
```azurecli
96+
```azurecli-interactive
9997
# create a Ubuntu DSVM in your resource group
10098
# note you need to be at least a contributor to the resource group in order to execute this command successfully
10199
# If you need to create a new resource group use: "az group create --name YOUR-RESOURCE-GROUP-NAME --location YOUR-REGION (For example: westus2)"
@@ -104,7 +102,7 @@ To use the DSVM as a development environment:
104102

105103
* To create a Windows Data Science Virtual Machine, use the following command:
106104

107-
```azurecli
105+
```azurecli-interactive
108106
# create a Windows Server 2016 DSVM in your resource group
109107
# note you need to be at least a contributor to the resource group in order to execute this command successfully
110108
az vm create --resource-group YOUR-RESOURCE-GROUP-NAME --name YOUR-VM-NAME --image microsoft-dsvm:dsvm-windows:server-2016:latest --admin-username YOUR-USERNAME --admin-password YOUR-PASSWORD --authentication-type password
@@ -114,13 +112,13 @@ To use the DSVM as a development environment:
114112
115113
* For Ubuntu DSVM:
116114
117-
```shell
115+
```cmd
118116
conda activate py36
119117
```
120118
121119
* For Windows DSVM:
122120
123-
```shell
121+
```cmd
124122
conda activate AzureML
125123
```
126124
@@ -145,35 +143,35 @@ When you're using a local computer (which might also be a remote virtual machine
145143
146144
Run the following command to create the environment.
147145
148-
```shell
146+
```cmd
149147
conda create -n myenv python=3.6.5
150148
```
151149
152150
Then activate the environment.
153151
154-
```shell
152+
```cmd
155153
conda activate myenv
156154
```
157155
158156
This example creates an environment using python 3.6.5, but any specific subversions can be chosen. SDK compatibility may not be guaranteed with certain major versions (3.5+ is recommended), and it's recommended to try a different version/subversion in your Anaconda environment if you run into errors. It will take several minutes to create the environment while components and packages are downloaded.
159157
160158
1. Run the following commands in your new environment to enable environment-specific IPython kernels. This will ensure expected kernel and package import behavior when working with Jupyter Notebooks within Anaconda environments:
161159
162-
```shell
160+
```cmd
163161
conda install notebook ipykernel
164162
```
165163
166164
Then run the following command to create the kernel:
167165
168-
```shell
166+
```cmd
169167
ipython kernel install --user --name myenv --display-name "Python (myenv)"
170168
```
171169
172170
1. Use the following commands to install packages:
173171
174172
This command installs the base Azure Machine Learning SDK with notebook and `automl` extras. The `automl` extra is a large install, and can be removed from the brackets if you don't intend to run automated machine learning experiments. The `automl` extra also includes the Azure Machine Learning Data Prep SDK by default as a dependency.
175173
176-
```shell
174+
```cmd
177175
pip install azureml-sdk[notebooks,automl]
178176
```
179177
@@ -186,20 +184,19 @@ When you're using a local computer (which might also be a remote virtual machine
186184
>
187185
> `pip install --upgrade azureml-sdk\[notebooks,automl\]`
188186
189-
190187
It will take several minutes to install the SDK. For more information on installation options, see the [install guide](https://docs.microsoft.com/python/api/overview/azure/ml/install?view=azure-ml-py).
191188
192189
1. Install other packages for your machine learning experimentation.
193190
194191
Use either of the following commands and replace *\<new package>* with the package you want to install. Installing packages via `conda install` requires that the package is part of the current channels (new channels can be added in Anaconda Cloud).
195192
196-
```shell
193+
```cmd
197194
conda install <new package>
198195
```
199196
200197
Alternatively, you can install packages via `pip`.
201198
202-
```shell
199+
```cmd
203200
pip install <new package>
204201
```
205202
@@ -213,19 +210,19 @@ To enable these components in your Jupyter Notebook environment:
213210
214211
1. Open an Anaconda prompt and activate your environment.
215212
216-
```shell
213+
```cmd
217214
conda activate myenv
218215
```
219216
220217
1. Clone [the GitHub repository](https://aka.ms/aml-notebooks) for a set of sample notebooks.
221218
222-
```CLI
219+
```cmd
223220
git clone https://github.com/Azure/MachineLearningNotebooks.git
224221
```
225222
226223
1. Launch the Jupyter Notebook server with the following command:
227224
228-
```shell
225+
```cmd
229226
jupyter notebook
230227
```
231228
@@ -245,7 +242,6 @@ To enable these components in your Jupyter Notebook environment:
245242
246243
1. To configure the Jupyter Notebook to use your Azure Machine Learning workspace, go to the [Create a workspace configuration file](#workspace) section.
247244
248-
249245
### <a id="vscode"></a>Visual Studio Code
250246
251247
Visual Studio Code is a very popular cross platform code editor that supports an extensive set of programming languages and tools through extensions available in the [Visual Studio marketplace](https://marketplace.visualstudio.com/vscode). The [Azure Machine Learning extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.vscode-ai) installs the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for coding in all types of Python environments (virtual, Anaconda, etc.). In addition, it provides convenience features for working with Azure Machine Learning resources and running Azure Machine Learning experiments all without leaving Visual Studio Code.
@@ -328,7 +324,7 @@ Once the cluster is running, [create a library](https://docs.databricks.com/user
328324
+ In AutoML config, when using Azure Databricks add the following parameters:
329325
1. ```max_concurrent_iterations``` is based on number of worker nodes in your cluster.
330326
2. ```spark_context=sc``` is based on the default spark context.
331-
+ Or, if you have an old SDK version, deselect it from clusters installed libs and move to trash. Install the new SDK version and restart the cluster. If there is an issue after the restart, detach and reattach your cluster.
327+
+ Or, if you have an old SDK version, deselect it from cluster's installed libs and move to trash. Install the new SDK version and restart the cluster. If there is an issue after the restart, detach and reattach your cluster.
332328
333329
If install was successful, the imported library should look like one of these:
334330
@@ -392,7 +388,6 @@ You can create the configuration file in three ways:
392388

393389
This code writes the configuration file to the *.azureml/config.json* file.
394390

395-
396391
## Next steps
397392

398393
- [Train a model](tutorial-train-models-with-aml.md) on Azure Machine Learning with the MNIST dataset

articles/machine-learning/how-to-deploy-fpga-web-service.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.custom: seodec18
1717
# What are field-programmable gate arrays (FPGA) and how to deploy
1818
[!INCLUDE [applies-to-skus](../../includes/aml-applies-to-basic-enterprise-sku.md)]
1919

20-
This article provides an introduction to field-programmable gate arrays (FPGA), and shows you how to deploy your models using Azure Machine Learning to an Azure FPGA.
20+
This article provides an introduction to field-programmable gate arrays (FPGA), and shows you how to deploy your models using Azure Machine Learning to an Azure FPGA.
2121

2222
FPGAs contain an array of programmable logic blocks, and a hierarchy of reconfigurable interconnects. The interconnects allow these blocks to be configured in various ways after manufacturing. Compared to other chips, FPGAs provide a combination of programmability and performance.
2323

@@ -48,7 +48,7 @@ FPGAs on Azure supports:
4848

4949
+ Image classification and recognition scenarios
5050
+ TensorFlow deployment
51-
+ Intel FPGA hardware
51+
+ Intel FPGA hardware
5252

5353
These DNN models are currently available:
5454
- ResNet 50
@@ -77,20 +77,17 @@ The following scenarios use FPGAs:
7777

7878
+ [Land cover mapping](https://blogs.technet.microsoft.com/machinelearning/2018/05/29/how-to-use-fpgas-for-deep-learning-inference-to-perform-land-cover-mapping-on-terabytes-of-aerial-images/)
7979

80-
81-
82-
## Example: Deploy models on FPGAs
80+
## Example: Deploy models on FPGAs
8381

8482
You can deploy a model as a web service on FPGAs with Azure Machine Learning Hardware Accelerated Models. Using FPGAs provides ultra-low latency inference, even with a single batch size. Inference, or model scoring, is the phase where the deployed model is used for prediction, most commonly on production data.
8583

86-
8784
### Prerequisites
8885

8986
- An Azure subscription. If you do not have one, create a free account before you begin. Try the [free or paid version of Azure Machine Learning](https://aka.ms/AMLFree) today.
9087

9188
- FPGA quota. Use the Azure CLI to check whether you have quota:
9289

93-
```shell
90+
```azurecli-interactive
9491
az vm list-usage --location "eastus" -o table --query "[?localName=='Standard PBS Family vCPUs']"
9592
```
9693
@@ -113,7 +110,7 @@ You can deploy a model as a web service on FPGAs with Azure Machine Learning Har
113110
114111
- The Python SDK for hardware-accelerated models:
115112
116-
```shell
113+
```cmd
117114
pip install --upgrade azureml-accel-models
118115
```
119116
@@ -321,7 +318,7 @@ To deploy your model as a high-scale production web service, use Azure Kubernete
321318
```python
322319
from azureml.core.compute import AksCompute, ComputeTarget
323320

324-
# Specify the Standard_PB6s Azure VM and location. Values for location may be "eastus", "southeastasia", "westeurope", or "westus2. If no value is specified, the default is "eastus".
321+
# Specify the Standard_PB6s Azure VM and location. Values for location may be "eastus", "southeastasia", "westeurope", or "westus2". If no value is specified, the default is "eastus".
325322
prov_config = AksCompute.provisioning_configuration(vm_size = "Standard_PB6s",
326323
agent_count = 1,
327324
location = "eastus")

articles/machine-learning/how-to-manage-workspace-cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ In this article, you learn how to create an Azure Machine Learning workspace usi
3232
3333
There are several ways that you can authenticate to your Azure subscription from the CLI. The most basic is to interactively authenticate using a browser. To authenticate interactively, open a command line or terminal and use the following command:
3434

35-
```azurecli
35+
```azurecli-interactive
3636
az login
3737
```
3838

@@ -143,13 +143,13 @@ To create a workspace that uses existing resources, you must provide the ID for
143143

144144
1. Install the application insights extension:
145145

146-
```bash
146+
```azurecli-interactive
147147
az extension add -n application-insights
148148
```
149149
150150
2. Get the ID of your application insight service:
151151
152-
```bash
152+
```azurecli-interactive
153153
az monitor app-insights component show --app <application-insight-name> -g <resource-group-name> --query "id"
154154
```
155155

0 commit comments

Comments
 (0)