Skip to content

fix: 실제 Azure 배포 경로 보완 - #2

Merged
daeungo1 merged 3 commits into
mainfrom
refactor/lifecycle-structure
Aug 17, 2026
Merged

daeungo1 merged 3 commits into
mainfrom
refactor/lifecycle-structure

Conversation

@hellices

Copy link
Copy Markdown
Collaborator

배경

PR #1 병합 이후 실제 Azure 리소스 생성과 Hosted Agent 호출까지 수행하면서 정적 테스트에서 발견되지 않은 배포 결함을 확인했습니다. 이 PR은 실제 환경에서 재현·수정·재검증한 후속 변경만 포함합니다.

주요 변경

영역 실제 실패 변경 내용
인프라 provider microsoft.foundry provider가 deploy/infra 사용자 Bicep을 배포하지 않음 built-in bicep provider 적용, azd 환경값을 Bicep 매개변수에 연결
Search 이름 기존 고정 이름의 전역 중복 구독·리소스 그룹·지역 기반 deterministic suffix 적용
Search 지역 East US 2 신규 Search 용량 제한 Foundry 지역과 AZURE_SEARCH_LOCATION 분리, 기본값 Central US
azd 훅 macOS에서 python 명령 부재로 종료 코드 127 PYTHON → python → uv Python 3.13 → python3 실행기 선택
Knowledge Base Search API에서 미지원 index 속성으로 HTTP 400 중복 semantic 속성 제거, Search 오류 응답 상세 보강
Toolbox 연결 azd 축약 조회 결과를 drift로 오판 ARM connection 속성으로 category·target·authType·audience 검증
Agent RBAC SDK 목록 projection에 instance identity 누락 azd ai agent show 기반 principal ID 조회
Evaluate evaluator ID·dataset·결과 export 형식이 live CLI와 불일치 세 agent별 config, builtin.* ID, 단일 JSONL, eval show --out-file 적용
평가 gate live evaluator error 미반영 per_testing_criteria_results pass rate 계산과 evaluator error 차단

실제 Azure 검증

  • Foundry 계정·프로젝트·gpt-5.4-mini: East US 2
  • Basic AI Search 4개: Central US
  • Knowledge Base 작업 16개 성공
  • RemoteTool 연결 4개 및 Toolbox 3개 생성
  • Hosted Agent 3개 버전 1 활성화
  • smoke 3/3: HTTP 200, response.completed
  • Search Reader RBAC 6개: 누락 0, 금지된 교차 부서 할당 0
  • azd provision·azd deploy 재실행 성공

Evaluate 결과

  • development 샘플 5/5 완료
  • intent resolution: 1.0
  • task adherence: 1.0
  • relevance: 1.0
  • groundedness: 1.0
  • tool-call accuracy: evaluator error 5건
  • gate 결과: 실패
  • Operate 결과: 미실행

Evaluate 실패 후 continuous evaluation과 Agent 365 제어가 실행되지 않아 Build → Evaluate → Operate 차단 순서를 실제로 확인했습니다.

로컬 검증

  • pytest 164개 통과
  • Ruff lint 통과
  • Ruff format 통과
  • Bicep template·parameter build 통과
  • POSIX·PowerShell 훅 구문 검사 통과
  • 별도 코드 리뷰 중요 이슈 없음

운영 주의

  • 실제 테스트 리소스는 비용 발생 상태로 유지 중
  • 첫 실패 시도의 부분 리소스 그룹은 삭제 승인 전까지 유지
  • tool-call evaluator error의 서비스 측 원인 분석 필요

hellices and others added 2 commits August 17, 2026 14:20
Apply fixes verified through a live Foundry deployment: execute the custom Bicep infrastructure, support uv-backed hooks, provision Search and toolboxes idempotently, resolve hosted-agent identities for RBAC, and feed exported Foundry evaluation results into all three deployment gates.

Preserve Build -> Evaluate -> Operate ordering so evaluator errors block continuous evaluation and day-two controls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove system Python directories from the fallback contract PATH so Linux and macOS both exercise the uv launcher branch deterministically.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hellices
hellices requested review from daeungo1 and a balanced review from Copilot August 17, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Improves live Azure deployment reliability while preserving the Build → Evaluate → Operate sequence.

Changes:

  • Corrects Bicep provisioning, Search naming/region, hooks, RBAC, and Toolbox validation.
  • Aligns evaluations with live Foundry CLI formats and blocks evaluator errors.
  • Expands deployment contract tests and documentation.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.github/workflows/deploy-evaluate.yml Runs three agent evaluations and gates results.
azure.yaml Switches infrastructure to Bicep.
deploy/hooks/postdeploy.ps1 Adds Python fallback selection.
deploy/hooks/postdeploy.sh Adds Python fallback selection.
deploy/hooks/postprovision.ps1 Adds Python fallback selection.
deploy/hooks/postprovision.sh Adds Python fallback selection.
deploy/infra/main.bicep Separates Search region and suffixes names.
deploy/infra/main.bicepparam Reads deployment parameters from azd environment.
evals/eval.yaml Adds development live-evaluation configuration.
evals/human-resources.yaml Adds HR live-evaluation configuration.
evals/marketing.yaml Adds marketing live-evaluation configuration.
README.md Updates deployment and evaluation instructions.
src/lifecycle_ops/evaluation/gate.py Parses live evaluator counts and errors.
src/lifecycle_ops/provisioning/knowledge_bases.py Fixes Search payload and error reporting.
src/lifecycle_ops/provisioning/rbac.py Resolves agent identities through azd.
src/lifecycle_ops/provisioning/toolboxes.py Validates connection ARM properties.
tests/ops/test_agent_rbac_matrix.py Tests azd identity extraction.
tests/ops/test_knowledge_manifest.py Tests Search payload and error details.
tests/ops/test_toolbox_ops.py Tests ARM connection validation.
tests/ops/test_validate_eval_results.py Tests evaluator-error gating.
tests/repo/test_documentation.py Updates README command contracts.
tests/repo/test_eval_config_contract.py Validates per-agent evaluation configs.
tests/repo/test_hooks_contract.py Tests Python fallback behavior.
tests/repo/test_infra_static.py Tests Bicep provider and Search settings.
tests/repo/test_workflows.py Tests multi-agent evaluation workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lifecycle_ops/provisioning/toolboxes.py Outdated
Comment thread evals/eval.yaml Outdated
Comment thread evals/human-resources.yaml Outdated
Comment thread evals/marketing.yaml Outdated
Comment thread deploy/infra/main.bicep
Use DefaultAzureCredential for ARM connection reads, restore shared and cross-department cases in each live evaluation dataset, and document safe cleanup of legacy fixed-name Search services after migration verification.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 28 out of 28 changed files in this pull request and generated 2 comments.

Suppressed comments (1)

deploy/infra/main.bicepparam:4

  • AZURE_SEARCH_LOCATION is configurable locally, but the deployment workflow maps and persists only AZURE_LOCATION; on a clean runner this parameter always falls back to centralus. That prevents operators from redirecting Search when Central US has capacity or policy constraints. Map a workflow variable for AZURE_SEARCH_LOCATION and set it in the selected azd environment before provisioning.
param searchLocation = readEnvironmentVariable('AZURE_SEARCH_LOCATION', 'centralus')

Comment thread .github/workflows/deploy-evaluate.yml
Comment thread src/lifecycle_ops/evaluation/gate.py
@daeungo1
daeungo1 merged commit fc1a1d9 into main Aug 17, 2026
3 checks passed
daeungo1 added a commit that referenced this pull request Aug 17, 2026
PR #2 (refactor/lifecycle-structure) and this branch fixed the same live
deployment independently. Both are kept; where they overlap the stronger
implementation wins.

From PR #2:
- azure.yaml switches infra.provider from microsoft.foundry to bicep and
  main.bicepparam reads the azd environment, so deploy/infra is finally deployed.
  This is the root fix for the behaviour this branch had to work around: the
  foundry provider synthesised its own template and silently dropped the Search
  services, role assignments and everything else declared in main.bicep.
- Search services get a deterministic name suffix and their own AZURE_SEARCH_LOCATION,
  defaulting to Central US where capacity is available.
- Hooks resolve an interpreter through PYTHON, python, uv and python3 instead of
  assuming `python` exists.
- Agent principal ids come from `azd ai agent show`, which avoids the
  azure-ai-projects version differences this branch had to work around.
- The gate blocks on live evaluator errors and strips the builtin. prefix when
  matching metric names.
- Per-agent eval configs with single JSONL datasets.

From this branch:
- Application Insights, the Foundry AppInsights connection and per-agent
  OTEL_SERVICE_NAME, so all three agents are traceable in Foundry.
- Case-insensitive azd environment lookups, needed on Linux runners.
- azure/login@v2 in the deploy workflow for the RBAC hook.
- shutil.which resolution so the Azure CLI can be spawned on Windows.

builtin.tool_call_accuracy is removed from all three eval configs. The evaluator
requires a tool_definitions input the CLI cannot supply, so every sample errors,
and PR #2's gate now blocks on evaluator errors — keeping it would make promotion
permanently red for a reason unrelated to agent quality. The rationale and the
re-enable condition are recorded in evals/eval.yaml and docs/operations.md.

The Windows uv-fallback test now installs a batch shim instead of a shebang
script, and the POSIX variant skips on Windows, so the suite is green on both.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
daeungo1 added a commit that referenced this pull request Aug 17, 2026
origin/main gained the merged PR #2 plus a follow-up that moved the live evaluation
datasets to evals/live/ and read ARM connections with DefaultAzureCredential. Those
land here; the live datasets are rewritten in Korean for the fictional enterprise
scenario while keeping the upstream contract of eight rows per department, six allow
cases including one shared-handbook citation, and two cross-department denials.

builtin.tool_call_accuracy stays out of all three configs: the evaluator needs a
tool_definitions input the CLI cannot supply, so every sample errors and the gate,
which blocks on evaluator errors, would never pass.

README now carries three purpose-built SVG views instead of Mermaid: the lifecycle
stages, the three-department scenario, and the Azure resources. A contract test
estimates label widths per character class, since Hangul and Latin advance very
differently, and fails if any label leaves its box or the canvas.

The scenario is described as fictional throughout rather than naming a company.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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