Skip to content

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

Merged
Roopan-Microsoft merged 16 commits intodevfrom
psl-pk-standparam
Apr 9, 2026
Merged

refactor: environment variable names to follow a consistent naming convention#787
Roopan-Microsoft merged 16 commits intodevfrom
psl-pk-standparam

Conversation

@Pavan-Microsoft
Copy link
Copy Markdown
Collaborator

@Pavan-Microsoft Pavan-Microsoft commented Mar 23, 2026

Purpose

This pull request standardizes and updates environment variable names across multiple GitHub Actions workflows and the .env.sample file 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:

  • Renamed AZURE_OPENAI_GPT_MODEL, AZURE_OPENAI_IMAGE_MODEL, and AZURE_OPENAI_API_VERSION to AZURE_ENV_GPT_MODEL_NAME, AZURE_ENV_IMAGE_MODEL_NAME, and AZURE_ENV_OPENAI_API_VERSION in .env.sample for greater clarity and consistency. [1] [2]
  • Updated resource ID variable names throughout workflows, e.g., AZURE_EXISTING_AI_PROJECT_RESOURCE_ID to AZURE_EXISTING_AIPROJECT_RESOURCE_ID, and AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID to AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID, ensuring consistent naming conventions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Changed AZURE_ENV_OPENAI_LOCATION to AZURE_ENV_AI_SERVICE_LOCATION and IMAGE_TAG to AZURE_ENV_IMAGE_TAG in all relevant workflow files for improved clarity and to avoid ambiguity. [1] [2] [3] [4] [5] [6]

Workflow input and output updates:

  • Updated workflow input parameter names and validation logic to match the new variable names, ensuring that input/output handling in deploy-v2.yml and deploy-orchestrator.yml is consistent with the new standards. [1] [2] [3] [4] [5]

Validation and assignment logic:

  • Refactored validation and assignment blocks in workflow scripts to use the new variable names, reducing the risk of misconfiguration and improving maintainability. [1] [2] [3]

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?

  • 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

- 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.
Copy link
Copy Markdown
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 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>
Copy link
Copy Markdown
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 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>
@Roopan-Microsoft Roopan-Microsoft merged commit b028039 into dev Apr 9, 2026
5 checks passed
@Pavan-Microsoft Pavan-Microsoft deleted the psl-pk-standparam branch April 10, 2026 08:35
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.

4 participants