Skip to content

fix: remove hardcoded code deploy region restriction, use dynamic hosted-agent regions#8422

Merged
trangevi merged 2 commits into
mainfrom
jw/code-deploy-all-regions
May 28, 2026
Merged

fix: remove hardcoded code deploy region restriction, use dynamic hosted-agent regions#8422
trangevi merged 2 commits into
mainfrom
jw/code-deploy-all-regions

Conversation

@v1212
Copy link
Copy Markdown
Collaborator

@v1212 v1212 commented May 28, 2026

Fixes #8427

Summary

Code deploy is now supported in all hosted-agent regions (confirmed by service team). This PR removes the hardcoded 3-region allowlist and unifies code deploy region handling with the existing dynamic hosted-agent region mechanism.

Background

  • Previously, code deploy was gated to only westus2, canadacentral, northcentralus via a hardcoded CodeDeployRegions variable in config.go
  • Service team (Pranav/Santhosh) confirmed: code deploy is enabled in all regions of hosted agent
  • PR Add hosted agent regions #8398 (antrikshjain/add-region) already added canadaeast and germanywestcentral to the hosted-agent fallback manifest -- but code deploy was still blocked by its own hardcoded list

Changes

File Change
internal/project/config.go Remove CodeDeployRegions variable
internal/cmd/init_foundry_resources_helpers.go Replace project.CodeDeployRegions with supportedRegionsForInit(ctx) (dynamic fetch with embedded fallback); propagate context cancellation instead of treating as recoverable
internal/project/service_target_agent.go Remove client-side region validation at deploy time (server handles rejection for truly unsupported regions)

Behavior After This Change

  1. During azd ai agent init (code deploy mode): Foundry projects are filtered using the same dynamic region list as container deploy
  2. During azd deploy: No client-side region gate -- if a region is somehow unsupported, the server returns a clear error
  3. New regions: Automatically picked up when https://aka.ms/azd-ai-agents/regions is updated (or when the embedded fallback JSON is refreshed)
  4. Context cancellation: Properly propagated instead of being swallowed as a fetch warning

Testing

  • go build ./... -- PASS
  • go test ./internal/project/ ./internal/cmd/ -- PASS (all tests, no regressions)

…ted-agent regions

Code deploy is now supported in all hosted-agent regions. Remove the
hardcoded CodeDeployRegions allowlist (westus2, canadacentral, northcentralus)
and use the dynamically-fetched hosted-agent region list during init.

At deploy time, remove the client-side region gate entirely — the server
will reject unsupported regions with a clear error message.

Resolves the request to support Canada East and Germany West Central for
code deploy without requiring further client changes.
@v1212 v1212 force-pushed the jw/code-deploy-all-regions branch from 24912eb to 8288e71 Compare May 28, 2026 03:59
@github-actions github-actions Bot added the ext-agents azure.ai.{agents,connections,inspector,projects,routines,skills,toolboxes} extensions label May 28, 2026
@v1212 v1212 marked this pull request as ready for review May 28, 2026 05:22
Copilot AI review requested due to automatic review settings May 28, 2026 05:22
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

This PR removes the hardcoded code-deploy region allowlist for Azure AI Agents and aligns init-time project filtering with the hosted-agent dynamic region mechanism.

Changes:

  • Removed CodeDeployRegions from project configuration.
  • Updated Foundry project selection for code deploy to use supportedRegionsForInit(ctx).
  • Removed deploy-time client-side region allowlist validation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
cli/azd/extensions/azure.ai.agents/internal/project/config.go Removes the obsolete hardcoded code-deploy region list.
cli/azd/extensions/azure.ai.agents/internal/cmd/init_foundry_resources_helpers.go Switches code-deploy project filtering to dynamic hosted-agent regions.
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go Removes deploy-time region allowlist enforcement while retaining the location presence check.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Review may take a bit longer — reach out to @rajeshkamal5050 or @kristenwomack if you'd like to discuss prioritization.

Propagate context.Canceled/DeadlineExceeded instead of treating as
recoverable fetch failure in code-deploy region filtering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@v1212 v1212 force-pushed the jw/code-deploy-all-regions branch from 863429f to 8d2dd28 Compare May 28, 2026 08:42
@trangevi
Copy link
Copy Markdown
Member

/check-enforcer override

@trangevi trangevi enabled auto-merge (squash) May 28, 2026 17:09
@trangevi trangevi merged commit ec9e893 into main May 28, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.{agents,connections,inspector,projects,routines,skills,toolboxes} extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code deploy region restriction should use dynamic hosted-agent regions instead of hardcoded allowlist

4 participants