A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/azure/developer/azure-developer-cli/environments-overview below:

Azure Developer CLI Environments Overview

The Azure Developer CLI (azd) lets you manage multiple deployment environments for your projects, to keep configurations separate for development, testing, and production. This article explains essential concepts about how you can use environments to manage your development and deployment process.

What are environments?

An environment in the Azure Developer CLI (azd) is a named set of configurations for a deployment of your app, such as dev, test, or prod. Different environments can be configured with different values. Environments serve several important purposes:

Each environment has its own Azure resource group and configuration settings. This environment isolation helps prevent changes in one environment from affecting others.

Environment structure and configuration

Azure Developer CLI (azd) environments live in a directory structure within your project:

├── .azure                          [Created when you run azd init or azd up]
│   ├── <environment-name-1>        [Directory for environment-specific configurations]
│   │   ├── .env                    [Environment variables for this environment]
│   │   └── config.json             [Additional configuration parameters for this environment]
│   ├── <environment-name-2>        [Another environment]
│   │   ├── .env                    
│   │   └── config.json
│   └── config.json                 [Global azd configuration]

The key components of this structure are:

Environment names

Environment naming typically follows these patterns:

These naming conventions aren't enforced by azd and are configurable by the user.

Environment variables

Azure Developer CLI Environment variables provide a way to store configuration settings that influence and might vary between environments. When you run Azure Developer CLI commands, these variables are used to:

The .env file contains these variables in a standard format:

AZURE_ENV_NAME=dev
AZURE_LOCATION=eastus
AZURE_SUBSCRIPTION_ID=00000000-0000-0000-0000-000000000000
AZURE_RESOURCE_GROUP=rg-dev-12345
SERVICE_WEB_HOSTNAME=web-dev-12345.azurewebsites.net
SERVICE_API_HOSTNAME=api-dev-12345.azurewebsites.net

Common environment variables include:

Variable Description AZURE_ENV_NAME Name of the current environment AZURE_LOCATION Azure region where resources are deployed AZURE_SUBSCRIPTION_ID ID of the Azure subscription used for this environment AZURE_RESOURCE_GROUP Name of the resource group for this environment

Tip

For other common environment variables and service-specific examples, visit the Environment variables documentation.

When working with environment variables:

Warning

Never store secrets in an Azure Developer CLI .env file. These files can easily be shared or copied into unauthorized locations, or checked into source control. Use services such as Azure Key Vault or Azure Role Based Access Control (RBAC) for protected or secretless solutions.

Compare other framework environments

Many programming frameworks and tools such as Node.js, Django, or React use .env files for configuration. While Azure Developer CLI (azd) also uses .env files, there are important differences:

Concept Azure Developer CLI .env Framework .env Files Location Stored in .azure/<environment-name>/.env Typically stored in project root directory Environment Support Support for multiple user-defined environments (dev, test, prod) Often require manual file switching or naming conventions (.env.development, .env.production) Loading Mechanism Automatically loaded by azd commands Usually require explicit loading in application code or build scripts Integration Deeply integrated with Azure services and resource provisioning General purpose configuration, not Azure-specific Variable Management Managed via azd env commands Typically edited manually or via custom scripts

While both serve similar purposes, Azure Developer CLI's .env approach adds structure and tooling designed for managing multiple deployment environments and Azure resources.

Note

If your project already uses framework-specific .env files, you can keep both configuration systems without conflicts. azd environment variables override system environment variables of the same name for some operations.

Next steps

Work with environments

Manage environment variables in Azure Developer CLI


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4