Skip to content

refactor: environment variable names to follow a consistent naming convention#787

Draft
Pavan-Microsoft wants to merge 6 commits intodevfrom
psl-pk-standparam
Draft

refactor: environment variable names to follow a consistent naming convention#787
Pavan-Microsoft wants to merge 6 commits intodevfrom
psl-pk-standparam

Conversation

@Pavan-Microsoft
Copy link
Collaborator

Purpose

This pull request standardizes and clarifies environment variable and input naming conventions across multiple workflow files and the .env.sample file, 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:

  • Renamed Azure resource ID variables throughout workflows and .env.sample for clarity, such as changing AZURE_EXISTING_AI_PROJECT_RESOURCE_ID to AZURE_ENV_FOUNDRY_PROJECT_RID and AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID to AZURE_ENV_LOG_ANALYTICS_WORKSPACE_RID. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • Updated Azure location and image tag variable names for clarity, e.g., AZURE_ENV_OPENAI_LOCATION to AZURE_ENV_AI_SERVICE_LOCATION and IMAGE_TAG to AZURE_ENV_IMAGE_TAG across all relevant workflow files. [1] [2] [3] [4] [5] [6] [7] [8] [9]

.env.sample Variable Updates:

  • Changed model and API version variable names to be more descriptive and environment-specific, such as AZURE_OPENAI_GPT_MODEL to AZURE_ENV_GPT_MODEL_NAME, AZURE_OPENAI_IMAGE_MODEL to AZURE_ENV_IMAGE_MODEL_NAME, and AZURE_OPENAI_API_VERSION to AZURE_ENV_OPENAI_API_VERSION. [1] [2]

Workflow Logic and Output Adjustments:

  • Updated workflow scripts and validation logic to use the new variable names, ensuring all validation, output, and referencing logic matches the standardized naming. [1] [2] [3] [4]

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?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

- 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.
@Pavan-Microsoft Pavan-Microsoft requested a review from Copilot March 23, 2026 15:49
@Pavan-Microsoft Pavan-Microsoft changed the title Refactor environment variable names for Azure OpenAI settings refactor: environment variable names to follow a consistent naming convention Mar 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants