Skip to content

Commit 575eed1

Browse files
committed
secrets refresh
1 parent bbb03b5 commit 575eed1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

articles/machine-learning/service/how-to-train-ml-models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.service: machine-learning
99
ms.subservice: core
1010
ms.topic: conceptual
1111
ms.reviewer: sgilley
12-
ms.date: 04/19/2019
12+
ms.date: 11/08/2019
1313
ms.custom: seodec18
1414

1515
---

articles/machine-learning/service/how-to-use-secrets-in-runs.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@ ms.reviewer: larryfr
99
ms.service: machine-learning
1010
ms.subservice: core
1111
ms.topic: conceptual
12-
ms.date: 08/23/2019
12+
ms.date: 11/08/2019
1313
ms.custom: seodec18
1414

1515
---
1616

1717
# Use secrets in training runs
1818
[!INCLUDE [applies-to-skus](../../../includes/aml-applies-to-basic-enterprise-sku.md)]
1919

20-
In this article, you learn how to use secrets in training runs securely. For example, to connect to an external database to query training data, you would need to pass username and password to the remote run context. Coding such values into training scripts in cleartext is insecure as it would expose the secret.
20+
In this article, you learn how to use secrets in training runs securely. For example, to connect to an external database to query training data, you would need to pass your username and password to the remote run context. Coding such values into training scripts in cleartext is insecure as it would expose the secret.
2121

2222
Instead, your Azure Machine Learning Workspace has [Azure Key Vault](https://docs.microsoft.com/azure/key-vault/key-vault-overview) as associated resource. This Key Vault can be used for passing secrets to remote runs securely through a set of APIs in Azure Machine Learning Python SDK.
2323

2424
The basic flow for using secrets is:
2525
1. On local computer, log in to Azure and connect to your Workspace.
2626
2. On local computer, set a secret in Workspace Key Vault.
2727
3. Submit a remote run.
28-
4. Within remote run, get the secret from Key Value and use it.
28+
4. Within the remote run, get the secret from Key Value and use it.
2929

3030
## Set secrets
3131

32-
In Azure Machine Learning Python SDK, the [Keyvault](https://docs.microsoft.com/python/api/azureml-core/azureml.core.keyvault.keyvault?view=azure-ml-py) class contains methods for setting secrets. In your local Python session, first obtain a reference to Workspace Key Vault, and then use [set_secret](https://docs.microsoft.com/python/api/azureml-core/azureml.core.keyvault.keyvault?view=azure-ml-py#set-secret-name--value-) method to set a secret by name and value.
32+
In the Azure Machine Learning Python SDK, the [Keyvault](https://docs.microsoft.com/python/api/azureml-core/azureml.core.keyvault.keyvault?view=azure-ml-py) class contains methods for setting secrets. In your local Python session, first obtain a reference to Workspace Key Vault, and then use [set_secret](https://docs.microsoft.com/python/api/azureml-core/azureml.core.keyvault.keyvault?view=azure-ml-py#set-secret-name--value-) method to set a secret by name and value.
3333

3434
```python
3535
from azureml.core import Workspace
@@ -41,15 +41,15 @@ keyvault = ws.get_default_keyvault()
4141
keyvault.set_secret(name="mysecret", value = my_secret)
4242
```
4343

44-
Do not put the secret value in Python code as it is insecure to store it in file as cleartext. Instead, obtain the secret value from environment variable, for example Azure DevOps build secret, or from interactive user input.
44+
Do not put the secret value in your Python code as it is insecure to store it in file as cleartext. Instead, obtain the secret value from an environment variable, for example Azure DevOps build secret, or from interactive user input.
4545

46-
You can list secret names using [list_secrets](https://docs.microsoft.com/python/api/azureml-core/azureml.core.keyvault.keyvault?view=azure-ml-py#list-secrets--) method. The __set_secret__ method updates the secret value if the name already exists.
46+
You can list secret names using the [list_secrets](https://docs.microsoft.com/python/api/azureml-core/azureml.core.keyvault.keyvault?view=azure-ml-py#list-secrets--) method. The __set_secret__ method updates the secret value if the name already exists.
4747

4848
## Get secrets
4949

50-
In your local code, you can use [Keyvault.get_secret](https://docs.microsoft.com/python/api/azureml-core/azureml.core.keyvault.keyvault?view=azure-ml-py#get-secret-name-) method to get the secret value by name.
50+
In your local code, you can use the[Keyvault.get_secret](https://docs.microsoft.com/python/api/azureml-core/azureml.core.keyvault.keyvault?view=azure-ml-py#get-secret-name-) method to get the secret value by name.
5151

52-
In runs submitted using [Experiment.submit](https://docs.microsoft.com/python/api/azureml-core/azureml.core.experiment.experiment?view=azure-ml-py#submit-config--tags-none----kwargs-), use [Run.get_secret](https://docs.microsoft.com/python/api/azureml-core/azureml.core.run.run?view=azure-ml-py#get-secret-name-) method. Because a submitted run is aware of its Workspace, this method shortcuts the Workspace instantiation and returns the secret value directly.
52+
In runs submitted using [Experiment.submit](https://docs.microsoft.com/python/api/azureml-core/azureml.core.experiment.experiment?view=azure-ml-py#submit-config--tags-none----kwargs-), use the [Run.get_secret](https://docs.microsoft.com/python/api/azureml-core/azureml.core.run.run?view=azure-ml-py#get-secret-name-) method. Because a submitted run is aware of its Workspace, this method shortcuts the Workspace instantiation and returns the secret value directly.
5353

5454
```python
5555
# Code in submitted run

0 commit comments

Comments
 (0)