refactor: environment variable names to follow a consistent naming convention#787
refactor: environment variable names to follow a consistent naming convention#787Pavan-Microsoft wants to merge 6 commits intodevfrom
Conversation
- Updated environment variable names to follow a consistent naming convention, replacing `AZURE_OPENAI_*` with `AZURE_ENV_*` for clarity and consistency across the codebase. - Modified GitHub Actions workflow to reflect new environment variable names for Docker image tagging. - Adjusted deployment scripts and local development scripts to utilize the new environment variable names. - Updated documentation to reflect changes in environment variable names for Azure OpenAI configuration. - Ensured backward compatibility by adding aliases for the old variable names where necessary.
There was a problem hiding this comment.
Pull request overview
Standardizes Azure-related environment variable and workflow input names across the repo to improve consistency and readability, while updating backend settings/tests/docs/infra to match.
Changes:
- Renames Azure OpenAI model/API-version env vars to
AZURE_ENV_*variants across code, scripts, docs, infra, and GitHub workflows. - Updates backend settings to accept both new (
AZURE_ENV_*) and legacy (AZURE_OPENAI_*) env var names via Pydantic aliasing. - Updates workflow validation/output plumbing to use the new variable names (including image tag and location naming).
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/tests/test_settings.py |
Updates tests to use AZURE_ENV_IMAGE_MODEL_NAME. |
src/tests/conftest.py |
Updates test env to use AZURE_ENV_OPENAI_API_VERSION. |
src/backend/settings.py |
Adds Pydantic AliasChoices to support new + legacy env var names. |
src/backend/agents/image_content_agent.py |
Updates docstring to reference new image model env var name. |
scripts/sample_image_generation.py |
Updates usage docs to reference new image model env var name. |
scripts/sample_content_generation.py |
Updates usage docs to reference new GPT/image env var names. |
scripts/local_dev.sh |
Renames .env lookup + error message for Foundry project resource id var. |
scripts/local_dev.ps1 |
Renames .env lookup + error message for Foundry project resource id var. |
scripts/deploy.sh |
Renames ACR and image tag env var names used by deployment helper script. |
scripts/deploy.ps1 |
Renames ACR and image tag env var names used by deployment helper script. |
infra/main.waf.parameters.json |
Renames parameter substitution variables to AZURE_ENV_* equivalents. |
infra/main.parameters.json |
Renames parameter substitution variables to AZURE_ENV_* equivalents. |
infra/main.json |
Propagates renamed env vars into generated ARM template outputs/vars; also changes one parameter requiredness. |
infra/main.bicep |
Renames output/env var names emitted by infra to AZURE_ENV_* equivalents. |
docs/TECHNICAL_GUIDE.md |
Updates documented env var names. |
docs/LOCAL_DEPLOYMENT.md |
Updates documented env var names and sample dotenv block. |
docs/IMAGE_GENERATION.md |
Updates image generation docs to reference new env var names. |
docs/DEPLOYMENT.md |
Updates troubleshooting guidance to reference new env var name. |
docs/CustomizingAzdParameters.md |
Updates AZD parameter names and example commands to new naming scheme. |
docs/AZD_DEPLOYMENT.md |
Updates AZD env set examples to new naming scheme. |
azure.yaml |
Updates printed output variable names to match renamed env vars. |
.github/workflows/job-docker-build.yml |
Renames image-tag output to AZURE_ENV_IMAGE_TAG and updates downstream references. |
.github/workflows/job-deploy.yml |
Renames inputs/outputs to new names and updates validation/output wiring. |
.github/workflows/job-deploy-windows.yml |
Renames inputs and validation variables to new names. |
.github/workflows/job-deploy-linux.yml |
Renames inputs and validation variables to new names. |
.github/workflows/job-cleanup-deployment.yml |
Renames inputs/env vars for location and image tag. |
.github/workflows/deploy-v2.yml |
Renames workflow_dispatch inputs/outputs for EXP-related IDs to new names. |
.github/workflows/deploy-orchestrator.yml |
Renames forwarded inputs and docker-build output references to new names. |
.github/workflows/azure-dev.yml |
Renames secret/env var reference for AI service location. |
.env.sample |
Updates sample env var names to the new convention. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…oss workflows and scripts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ntation and scripts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Purpose
This pull request standardizes and clarifies environment variable and input naming conventions across multiple workflow files and the
.env.samplefile, primarily by renaming several Azure-related variables for consistency and readability. These changes affect deployment workflows and environment configuration, ensuring all references to Azure resource IDs, locations, and model names use unified and descriptive names.Key changes include:
Environment Variable and Input Renaming for Consistency:
.env.samplefor clarity, such as changingAZURE_EXISTING_AI_PROJECT_RESOURCE_IDtoAZURE_ENV_FOUNDRY_PROJECT_RIDandAZURE_ENV_LOG_ANALYTICS_WORKSPACE_IDtoAZURE_ENV_LOG_ANALYTICS_WORKSPACE_RID. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]AZURE_ENV_OPENAI_LOCATIONtoAZURE_ENV_AI_SERVICE_LOCATIONandIMAGE_TAGtoAZURE_ENV_IMAGE_TAGacross all relevant workflow files. [1] [2] [3] [4] [5] [6] [7] [8] [9].env.sample Variable Updates:
AZURE_OPENAI_GPT_MODELtoAZURE_ENV_GPT_MODEL_NAME,AZURE_OPENAI_IMAGE_MODELtoAZURE_ENV_IMAGE_MODEL_NAME, andAZURE_OPENAI_API_VERSIONtoAZURE_ENV_OPENAI_API_VERSION. [1] [2]Workflow Logic and Output Adjustments:
These changes improve maintainability and reduce confusion by enforcing a clear and consistent naming scheme for all Azure-related configuration and workflow variables.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation