refactor: environment variable names to follow a consistent naming convention#787
refactor: environment variable names to follow a consistent naming convention#787Roopan-Microsoft merged 16 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.
- Updated workflow files to replace AZURE_ENV_LOG_ANALYTICS_WORKSPACE_RID with AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID and AZURE_ENV_FOUNDRY_PROJECT_RID with AZURE_EXISTING_AIPROJECT_RESOURCE_ID. - Modified validation logic for the new identifiers in job-deploy, job-deploy-linux, and job-deploy-windows workflows. - Adjusted output parameters in Bicep templates to reflect the new naming conventions. - Updated documentation to guide users on setting the new environment variables for existing resources. - Refactored local development scripts to accommodate the new environment variable names.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…docs region example - Fix deploy.sh: use backend/ApiApp.Dockerfile instead of WebApp.Dockerfile - Fix AZD_DEPLOYMENT.md: use eastus2 (allowed region) instead of eastus in example Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…aults - Fix deploy.ps1: use src\backend\ApiApp.Dockerfile instead of src\WebApp.Dockerfile - Remove eastus from checkquota.sh default regions (not in allowed azureAiServiceLocation values) - Add missing allowed regions to checkquota defaults Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Purpose
This pull request standardizes and updates environment variable names across multiple GitHub Actions workflows and the
.env.samplefile to improve consistency, readability, and reduce confusion. The changes primarily affect variables related to Azure AI services, image models, and resource IDs.Environment variable renaming and standardization:
AZURE_OPENAI_GPT_MODEL,AZURE_OPENAI_IMAGE_MODEL, andAZURE_OPENAI_API_VERSIONtoAZURE_ENV_GPT_MODEL_NAME,AZURE_ENV_IMAGE_MODEL_NAME, andAZURE_ENV_OPENAI_API_VERSIONin.env.samplefor greater clarity and consistency. [1] [2]AZURE_EXISTING_AI_PROJECT_RESOURCE_IDtoAZURE_EXISTING_AIPROJECT_RESOURCE_ID, andAZURE_ENV_LOG_ANALYTICS_WORKSPACE_IDtoAZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID, ensuring consistent naming conventions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]AZURE_ENV_OPENAI_LOCATIONtoAZURE_ENV_AI_SERVICE_LOCATIONandIMAGE_TAGtoAZURE_ENV_IMAGE_TAGin all relevant workflow files for improved clarity and to avoid ambiguity. [1] [2] [3] [4] [5] [6]Workflow input and output updates:
deploy-v2.ymlanddeploy-orchestrator.ymlis consistent with the new standards. [1] [2] [3] [4] [5]Validation and assignment logic:
These changes help ensure that environment variables are consistently named and used throughout the codebase, making it easier to configure, maintain, and debug deployments.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation