Edit

Share via


Configure lab secrets in Azure DevTest Labs

Lab secrets let platform engineers keep passwords, keys, and tokens in a single, secure location so automation and virtual machines can retrieve values without embedding them in scripts. By using Lab Secrets, you can store and use sensitive values centrally at the lab level in Azure DevTest Labs.

Prerequisites

Why use lab secrets

Using labs secrets provides several benefits:

  • Better security: Store credentials, keys, and tokens securely.
  • Centralized management: Define secrets once at the lab level and reuse them.
  • Easier automation: Use secrets in artifacts and virtual machine (VM) setup without hardcoding values.

Example scenarios

You can use lab secrets in various scenarios, including:

  • Provision multiple Windows and Linux VMs without sharing passwords over chat or email.
  • Deploy artifacts from private repositories using a personal access token stored as a secret.
  • Run automation scripts that retrieve API keys or SSH credentials at runtime.

Configure lab secrets

To create and manage lab secrets, follow these steps:

  1. Go to the Azure portal and open the Overview page for your lab.

  2. Select Configuration and Policies > Settings > Lab Secrets, and then select Add.

    Screenshot of Lab Secrets in Azure DevTest Labs.

  3. In the Create a lab secret pane, enter a name and value, and choose a scope: Formulas and Virtual Machines or Artifacts.

  4. Select Create.

After creation, the secret is available in the selected scope and stored in an Azure Key Vault in the lab's resource group.

Note

DevTest Labs automatically creates an Azure Key Vault in the lab's resource group to store secrets.