Skip to content

fix: script changes for feature "psl-TASfeature"#1045

Open
Akhileswara-Microsoft wants to merge 15 commits into
psl-TASfeaturefrom
vkwindowsfix
Open

fix: script changes for feature "psl-TASfeature"#1045
Akhileswara-Microsoft wants to merge 15 commits into
psl-TASfeaturefrom
vkwindowsfix

Conversation

@Akhileswara-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This pull request introduces several improvements and fixes to the deployment workflows and infrastructure scripts, focusing on enhanced automation, better support for non-interactive (CI) deployments, and improved configuration flexibility. The most important changes are summarized below.


Deployment Workflow Enhancements

  • Added new GPT_IMAGE_MIN_CAPACITY environment variable throughout GitHub Actions workflows (deploy.yml, deploy-waf.yml, job-deploy.yml) and ensured it is passed to deployment scripts, enabling configuration of GPT image model capacity during deployments.
    Infrastructure Script Improvements

  • Improved infra/scripts/post_deploy.ps1 to support non-interactive use case selection (-UseCase and -NonInteractive parameters), robust principal ID resolution for CI/service principal scenarios, and enhanced environment variable propagation for downstream scripts.

  • Added logic to resolve and export AI Foundry resource ID and project name, improving reliability for knowledge base connection provisioning in CI/CD pipelines.

Capacity and Region Configuration

  • Changed default GPT image model capacity from 5 to 4 in Bicep templates (main.bicep, main_custom.bicep) and added new allowed Azure region options (polandcentral, uaenorth).
    Shell Script Initialization

  • Added initialization of new variables in infra/scripts/post_deploy.sh to support the enhanced deployment process.

Does this introduce a breaking change?

  • Yes
  • No

Other Information

This pull request introduces several improvements and updates to the deployment workflows and infrastructure scripts, focusing on enhanced automation for non-interactive CI/CD scenarios, improved environment variable management, and expanded support for Azure regions and AI resource configuration. The main themes are improved non-interactive deployment, expanded region and model support, and more robust environment variable handling.

Deployment Workflow and Script Automation

  • Refactored the post-deployment scripts (post_deploy.ps1 and related workflow YAMLs) to fully support non-interactive (CI/CD) execution. This includes adding parameters like -UseCase and -NonInteractive, enforcing their use in non-interactive mode, and improving user principal ID resolution for service principal logins.

  • Updated workflow YAML files to pass required environment variables (like AZURE_CLIENT_ID) and to invoke the correct shell (pwsh for Windows, bash for Linux) for post-deployment scripts.

Azure AI Model and Region Support

  • Added support for the GPT_IMAGE_MIN_CAPACITY environment variable throughout workflows and scripts, ensuring consistent configuration for the GPT image model deployment capacity.

  • Expanded the list of allowed Azure regions for deployment to include polandcentral and uaenorth, increasing flexibility for regional deployments.

  • Updated default values for gptImageModelCapacity parameters in Bicep templates to 4 (from 5), aligning with new deployment requirements.

AI Resource Discovery and Environment Variables

  • Enhanced AI Foundry and project name resolution in post_deploy.ps1, including fallback mechanisms using Azure CLI and deployment outputs, and exporting these as environment variables for downstream scripts.

These changes collectively improve the reliability, automation, and flexibility of the deployment process, especially for CI/CD pipelines and new Azure regions and resources.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates deployment workflows and post-deployment scripts to better support CI/non-interactive executions, adds a new GPT_IMAGE_MIN_CAPACITY configuration knob across workflows/scripts, and expands infra configuration (regions + model capacity defaults) to support the psl-TASfeature deployment scenario.

Changes:

  • Propagates GPT_IMAGE_MIN_CAPACITY through GitHub Actions workflows into quota validation.
  • Enhances post-deploy scripts (post_deploy.sh / post_deploy.ps1) for non-interactive use-case selection and CI principal ID resolution, plus exports AI Foundry/project identifiers for downstream KB connection seeding.
  • Updates Bicep templates to expand allowed regions and change the default gptImageModelCapacity.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
infra/scripts/seed_kb_connections.py Adds env-based project ARM ID construction to avoid brittle data-plane discovery in CI.
infra/scripts/post_deploy.sh Adds non-interactive args, CI principal resolution, and exports AI Foundry/project env vars for KB connection seeding.
infra/scripts/post_deploy.ps1 Adds -UseCase/-NonInteractive, CI principal resolution, and exports AI Foundry/project env vars for KB connection seeding.
infra/scripts/checkquota.sh Adds quota validation for the gpt-image-1.5 model via GPT_IMAGE_MIN_CAPACITY.
infra/main.bicep Expands allowed regions and changes default image model capacity.
infra/main_custom.bicep Changes default image model capacity to match updated deployment needs.
.github/workflows/job-deploy.yml Passes GPT_IMAGE_MIN_CAPACITY into quota validation.
.github/workflows/job-deploy-windows.yml Switches to running unified PowerShell post-deploy non-interactively; exports needed env vars.
.github/workflows/job-deploy-linux.yml Switches to running unified bash post-deploy non-interactively; exports needed env vars.
.github/workflows/deploy.yml Passes GPT_IMAGE_MIN_CAPACITY into quota validation.
.github/workflows/deploy-waf.yml Passes GPT_IMAGE_MIN_CAPACITY into quota validation for WAF deployments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infra/scripts/checkquota.sh Outdated
Comment thread infra/main.bicep Outdated
Comment thread infra/main_custom.bicep Outdated
Comment thread infra/scripts/post_deploy.ps1 Outdated
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