Skip to content

feat(utilities): add reviewed regional fallback for Discovery - #264

Open
Edwin Zhang (EdwinDigital) wants to merge 1 commit into
microsoft:mainfrom
EdwinDigital:feat/discovery-regional-fallback
Open

Edwin Zhang (EdwinDigital) wants to merge 1 commit into
microsoft:mainfrom
EdwinDigital:feat/discovery-regional-fallback

Conversation

@EdwinDigital

Copy link
Copy Markdown

Summary

Add an opt-in, self-contained Python standard-library / Azure CLI / Bicep utility under utilities/regional-deployment/ for quota/capacity-aware regional planning and explicitly reviewed Discovery deployment.

  • Diagnose verified quota deficits separately from physical allocation/offerings failures; never recommend relocation to bypass access, policy or API-enablement errors.
  • Rank operator-approved neighboring candidates using current, explicitly subscription-scoped ARM location coordinates and same-geography defaults. Check Search tier/count, ACA quota, model offering/TPM units, and required VM/regional/family quota.
  • Generate an isolated new-region stack in a different RG when no source compute has succeeded, or preserve Succeeded compute/node pool/StorageContainer/customer storage and generate workspace-only cross-region networking and platform resources.
  • In reuse mode, create a separate VNet/UAMI/NAT, four workload roles, two global peerings and a link to the original Blob DNS zone. Keep the original VNet, customer storage, Blob PE and A record unchanged; reference the retained compute/store IDs.
  • Require explicit region acceptance, fresh preflight/what-if receipts and --apply for writes. Keep a three-resource workspace-core continuation instead of replaying a completed network.
  • Add offline regression tests and a local four-template compilation/shape-check entry point. Only the utilities index changes outside the new directory.

Problem and boundaries

A default region can advertise a service while actual allocation lacks capacity, or have a genuine quota deficit. A whole-stack retry can duplicate healthy compute/storage or overwrite existing networking. Discovery's control-plane placement and managed dependency placement must also be kept distinct.

This utility offers a reviewed alternative; it does not modify the default five-stage PowerShell flow, silently select/move resources, or invent an independent Search-region/ID field. Search/Foundry/Cosmos move as the Workspace managed unit. Retained-compute quota/AKS errors are not misrepresented as fixable by moving only Workspace. Healthy/in-progress source workspaces and conflicting compute ownership block reuse. New Project creation reuses output storage, not old agents/conversations/Workbench state.

Type of change

  • New agent (under agents/<name>/)
  • Update to an existing agent
  • New starter kit (under starter-kits/<name>/)
  • Update to an existing starter kit
  • Schema change (docs/schemas/**)
  • Workflow / script change (.github/**)
  • Documentation only
  • Other: optional service-deployment utility, Bicep templates, tests and operator documentation.

Related issue / tracking

Complements #262, which fixes the existing PowerShell onboarding region gates. This is an independent feature branch from upstream main; it does not duplicate #262's changes or depend on its new helper. No upstream Issue is linked because GitHub Issues are disabled for this repository.

Per the contribution guide, maintainer feedback on an executable utility's interface, operational boundaries and supported region contract is requested before merge. No prior maintainer agreement is claimed.

Schema impact

  • No existing schema changes
  • Schema changes are backward compatible
  • Schema changes are breaking - add the breaking-change label and link the rollout plan below

The optional utility has its own generated config/parameter pair, not the Stage 1 config format. Existing required fields/defaults and the five-stage PowerShell implementation are unchanged. Bicep uses the published 2026-06-01 Discovery resource contract and managed-region override.

Validation checklist

  • Documentation (README.md, schemas) is updated to match the change.
  • No hand-edits to .auto-registry/** (it is generated post-merge).
  • No OS / editor artefacts committed (.DS_Store, .env, *.swp, .idea/, .vs/, etc.).
  • Model-weight requirements: not applicable; no model weights are added.
  • No secrets, customer data, or internal-only URLs are committed.
  • All Markdown links resolve.

Validation performed

  • 59 self-contained Python tests passed. The test runner blocks external commands during unit execution, so test fixtures cannot accidentally call Azure.
  • Four Bicep templates compiled locally; bounded six-resource Discovery resume, 14-resource workspace initial, and three-resource workspace-core shapes passed.
  • Passed staged git diff --check, added/local README link checks and Bash command-block syntax checks. A full-repository/external-URL crawl was not performed.
  • Live read-only API integration exercised quota/catalog/location adapters and produced an eligible Central US candidate after the default region had no Standard Search offering. These checks exposed native numeric-string quota values and a CLI-context issue; both have explicit regression coverage. No private configuration, identifiers or raw evidence are included in this PR.
  • Read-only recommendation/selection logic and retention boundaries have synthetic regression coverage; no new Azure deployment, role/provider preparation, quota application, inference or scientific job was run for this feature.

Reproduce local validation without Azure credentials:

python3 utilities/regional-deployment/check.py
# Python-only tests if Azure CLI/Bicep is not installed:
python3 utilities/regional-deployment/check.py --skip-bicep

Reviewer notes (optional)

This is opt-in infrastructure tooling, not a claim of end-to-end cloud certification. Actual ARM Provider validation/what-if, region-specific policies, role propagation, all service-selected backing capacity, private client routing/DNS and scientific workloads still require controlled live validation. A prior related mixed-region deployment informed the preservation pattern; it was not a complete new-environment run of this utility.

Recommendations are not capacity reservations. Fresh mode adds a new stack while retaining partial source resources and their potential charges. Workspace reuse currently requires one public-cloud subscription/customer RG, the baseline private Blob endpoint/DNS layout, and a confirmed failed/missing source with releasable compute ownership. Cross-subscription/RG reuse, centralized/multi-IP DNS and healthy-workspace migration need a separate design.

Source association release is a separate, explicit filtered PUT guarded by Failed state and the exact owned link. It can retry old service processing, never runs automatically, and does not delete resources. There are no policy exemptions, public-storage changes, NSP skip tags, or automated cleanup paths.

@EdwinDigital
Edwin Zhang (EdwinDigital) requested a review from a team as a code owner October 24, 2026 12:50
@github-actions github-actions Bot added the pr-validation-failed The pr-review workflow's validator failed; see inline comments. label Oct 24, 2026
@@ -0,0 +1,5 @@
out/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,268 @@
"""Read-only regional evidence; quota, offerings and physical capacity are distinct."""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,47 @@
#!/usr/bin/env python3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,649 @@
#!/usr/bin/env python3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,147 @@
#!/usr/bin/env python3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,90 @@
import argparse

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,169 @@
import copy

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,202 @@
import argparse

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,153 @@
from datetime import datetime, timezone

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@@ -0,0 +1,333 @@
#!/usr/bin/env python3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[POL-021] @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

@github-actions

Copy link
Copy Markdown

Automated Check Results

Source validation run for commit 3ce3adfa7c87e22e6d8e5b7898faed0cd117aa59.

Rule ID Location Details
POL-021 utilities/regional-deployment/.gitignore:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/capacity.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/check.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/deploy.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/inputs.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/regional_deploy.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/templates/discovery.bicep:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/templates/main.bicep:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/templates/modules/storage-private-access.bicep:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/templates/workspace-core.bicep:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/templates/workspace.bicep:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/tests/support.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/tests/test_capacity.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/tests/test_plans.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/tests/test_safety.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.
POL-021 utilities/regional-deployment/workspace.py:1 @EdwinDigital is classified as a contributor with repository permission 'read'. Public contributors may modify catalog content and documentation. Microsoft organization members may contribute to any repository path, subject to correctness validation and normal GitHub review protections. Remove this file from the PR or ask a Microsoft organization member or repository maintainer to author the change.

How to fix: Correct the issue described above, then push the fix to rerun validation.

Push a fix to rerun validation. Required checks, not these diagnostic labels, determine merge eligibility. CODEOWNERS review requirements still apply.

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

Labels

pr-validation-failed The pr-review workflow's validator failed; see inline comments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant