Skip to content

chore: record ACA API custom-domain DNS after cutover - #306

Merged
patoperpetua merged 3 commits into
mainfrom
chore/303-aca-custom-domain-dns
Sep 10, 2026
Merged

chore: record ACA API custom-domain DNS after cutover#306
patoperpetua merged 3 commits into
mainfrom
chore/303-aca-custom-domain-dns

Conversation

@patoperpetua

@patoperpetua patoperpetua commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Commit live ACA FQDN + customDomainVerificationId into infra/custom-domains.pocpk.json (already applied in Route53).
  • Fix bind-custom-domains.ps1 to pass --environment for managed certs (required by current az).
  • Document App Insights ssd-pocpk-appi-dev-ae as a prerequisite for deploy-aca-api.sh.

Ops already done (this chat)

  • Created missing App Insights ssd-pocpk-appi-dev-ae
  • Deployed ssd-pocpk-aca-api-dev-ae with image pocpk-api:1b94b07…
  • Flipped Route53 api.plattform-kit.poc CNAME → ACA
  • Bound managed cert (SniEnabled)
  • OpenFGA --api-identity containerapp
  • Smoke: https://api.plattform-kit.poc.singletonsd.com/health + /health/db → 200

Test plan

  1. Confirm infra/custom-domains.pocpk.json matches live az containerapp show FQDN + verification id.
  2. Optional: re-apply Route53 is a no-op UPSERT.
  3. curl -sS https://api.plattform-kit.poc.singletonsd.com/health → 200.

Preview scenarios: not-applicable - DNS/config docs only, no API/data model change.

Made with Cursor

Summary by Sourcery

Record the live ACA custom-domain configuration and improve the deployment and cutover guidance for reliable certificate binding.

Bug Fixes:

  • Ensure ACA managed-certificate bindings target the correct Container Apps Environment, including configurations that use alternate environments.
  • Correct the cutover documentation’s step references after adding the Application Insights prerequisite.

Enhancements:

  • Record the deployed ACA API custom-domain FQDN and verification data in the infrastructure configuration.
  • Document the required Application Insights resource for ACA API deployment.

Documentation:

  • Update the ACA API cutover checklist with the Application Insights prerequisite and corrected custom-domain cutover instructions.

Summary by CodeRabbit

  • New Features

    • Updated the API custom domain to point to the production Azure Container Apps endpoint.
    • Added the required domain verification configuration for the API hostname.
  • Bug Fixes

    • Fixed managed certificate binding for custom domains by correctly identifying the Container Apps environment.
  • Documentation

    • Updated the cutover runbook with an additional prerequisite for Application Insights and adjusted subsequent step numbering.

RetriggerConfidence Score: 5/5

The PR appears safe to merge.

Summary

  • Replaces placeholder CNAME and domain-verification values with the deployed ACA values.
  • Resolves the Container Apps Environment dynamically while allowing an explicit configuration override.
  • Updates the cutover runbook’s prerequisites and step references.

Reviews (2) · Last reviewed commit: "fix(infra): resolve ACA env for cert bin..."

Fill Route53 CNAME/TXT for api.plattform-kit.poc, pass --environment on ACA
managed-cert bind, and note App Insights as a production ACA prerequisite.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI lite review requested due to automatic review settings September 10, 2026 06:38
@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR records the live ACA custom-domain identity in configuration, fixes managed-certificate binding by supplying the ACA environment to Azure CLI, and documents the required Application Insights prerequisite for ACA API deployment.

Sequence diagram for ACA managed certificate binding

sequenceDiagram
    participant Script as bind-custom-domains.ps1
    participant Config as custom-domains.pocpk.json
    participant AzureCLI as Azure CLI
    participant ACA as Azure Container Apps

    Script->>Config: Read environmentName
    Config-->>Script: ACA environment name or default
    Script->>AzureCLI: az containerapp hostname bind --environment
    AzureCLI->>ACA: Bind hostname with managed certificate
    ACA-->>AzureCLI: Binding result
    AzureCLI-->>Script: Success or failure
Loading

File-Level Changes

Change Details Files
Record the live ACA custom-domain metadata for reproducible DNS configuration.
  • Update the POC custom-domain configuration with the live ACA FQDN and custom-domain verification ID.
  • Keep Route53 configuration aligned with the already-applied cutover.
infra/custom-domains.pocpk.json
Make managed certificate hostname binding compatible with the current Azure CLI requirements.
  • Resolve the ACA environment name from binding configuration, with a development-environment fallback.
  • Pass --environment when binding managed certificates and retain explicit failure handling.
scripts/bind-custom-domains.ps1
Document the Application Insights dependency required before provisioning the ACA API.
  • Add the existing workspace-based App Insights resource as a prerequisite in the cutover steps.
docs/aca-api-cutover-303.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Human Review Brief — chore: record ACA API custom-domain DNS after cutover

Summary

  • Commit live ACA FQDN + customDomainVerificationId into infra/custom-domains.pocpk.json (already applied in Route53).
  • Fix bind-custom-domains.ps1 to pass --environment for managed certs (required by current az).
  • Document App Insights ssd-pocpk-appi-dev-ae as a prerequisite for deploy-aca-api.sh.

Test evidence

  • Local commands: see PR test plan
  • conflict-on-pr: SKIPPED (log)
  • conflict-on-pr: SKIPPED (log)
  • conflict-on-pr: SKIPPED (log)
  • conflict-on-pr: SKIPPED (log)

Preview URLs

  • None yet (or preview is infra-blocked)

Open review threads

  • None

Infra blockers

  • None

Visual review

  • Chromatic visual-accept is human-only. Agents must not treat visual-change builds as required CI.

Next action

agent fixing comments

@github-actions github-actions Bot added the has-feedback Bugbot or human feedback on the PR label Sep 10, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot removed the has-feedback Bugbot or human feedback on the PR label Sep 10, 2026

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="scripts/bind-custom-domains.ps1" line_range="110-114" />
<code_context>
       if ($wantCert) {
-        Write-Host "==> Managed certificate bind for $hostName (ACA)"
-        az containerapp hostname bind -n $name -g $rg --hostname $hostName --validation-method CNAME
+        $envName = if ($b.PSObject.Properties['environmentName'] -and $b.environmentName) {
+          [string]$b.environmentName
+        } else {
+          'ssd-pocpk-cae-dev-ae'
+        }
+        Write-Host "==> Managed certificate bind for $hostName (ACA env $envName)"
+        # Managed certs require --environment; without it az fails with "specify --certificate and --environment".
</code_context>
<issue_to_address>
**issue (bug_risk):** When the script is run with a custom-domains configuration for a Container App in an environment other than `ssd-pocpk-cae-dev-ae`, the fallback selects this POC-specific environment and `az containerapp hostname bind` targets the wrong environment, causing the bind to fail or applying it to the wrong ACA environment.

**Triggers:** When a containerapp binding omits `environmentName` and uses a different ACA environment.

**Suggested fix:** Require `environmentName` for containerapp bindings or resolve the environment from the target Container App instead of using a POC-specific fallback.

```suggestion
        $envName = if ($b.PSObject.Properties['environmentName'] -and $b.environmentName) {
          [string]$b.environmentName
        } else {
          throw "Container App binding '$name' requires environmentName when managedCert is enabled."
        }
```
</issue_to_address>

Fix all in Cursor

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and if the ACA hostname or verification record is wrong, the public API domain could route requests to the wrong container app or leave the custom-domain certificate binding in an incorrect state. Reverting the files restores the intended configuration, but requests and TLS exposure during the bad DNS window cannot be undone.

Blocking findings: scripts/bind-custom-domains.ps1:114


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread scripts/bind-custom-domains.ps1 Outdated
@github-actions github-actions Bot added the has-feedback Bugbot or human feedback on the PR label Sep 10, 2026
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f527f8ed-5463-4b84-9e0f-31ab2aa29511

📥 Commits

Reviewing files that changed from the base of the PR and between d36311b and be2ee6d.

📒 Files selected for processing (3)
  • docs/aca-api-cutover-303.md
  • infra/custom-domains.schema.json
  • scripts/bind-custom-domains.ps1

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f169d668-c95f-4e7d-a704-f478191aceba

📥 Commits

Reviewing files that changed from the base of the PR and between 1b94b07 and d36311b.

📒 Files selected for processing (3)
  • docs/aca-api-cutover-303.md
  • infra/custom-domains.pocpk.json
  • scripts/bind-custom-domains.ps1

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change fixes ACA managed certificate binding, replaces custom-domain placeholders with production values, and adds an Application Insights prerequisite to the ACA cutover runbook.

Changes

ACA custom-domain cutover

Layer / File(s) Summary
Managed certificate hostname binding
scripts/bind-custom-domains.ps1
The Container Apps binding path resolves the environment name and passes it to az containerapp hostname bind.
Cutover records and prerequisites
docs/aca-api-cutover-303.md, infra/custom-domains.pocpk.json
The runbook adds the required Application Insights resource. The domain configuration now contains the production ACA hostname and verification ID.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to d3631

This change completes ACA custom-domain cutover configuration and documents its deployment prerequisite. The supplied checks and configuration evidence indicate no remaining merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the ACA API custom-domain DNS cutover, which is a central change in the pull request. It does not mention the managed certificate fix or documentation update, but it rem…
Description check ✅ Passed The description includes a summary, completed operational work, preview-scenario exemption, and a practical test plan. It omits the required Linked issue, Feedback focus, and Automated checks sections…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/303-aca-custom-domain-dns

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

🟢 Approval recommended

The changes are low-risk ops/config updates consistent with the PR description, with only a minor non-blocking robustness suggestion noted in review comments.

Pull request overview

This PR captures the post-cutover state for the production API custom domain on Azure Container Apps (ACA) and aligns operational scripts/docs with current Azure CLI and deployment prerequisites.

Changes:

  • Updates scripts/bind-custom-domains.ps1 to pass --environment when binding ACA managed certificates.
  • Records the live ACA FQDN and customDomainVerificationId in infra/custom-domains.pocpk.json.
  • Documents Application Insights (ssd-pocpk-appi-dev-ae) as a prerequisite for ACA API deployment in the cutover runbook.
File summaries
File Description
scripts/bind-custom-domains.ps1 Adds ACA environment support for managed certificate hostname binding via Azure CLI.
infra/custom-domains.pocpk.json Replaces placeholders with the live ACA ingress FQDN and verification TXT value after cutover.
docs/aca-api-cutover-303.md Updates the cutover checklist to include the required App Insights resource prerequisite.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread scripts/bind-custom-domains.ps1 Outdated
Comment thread scripts/bind-custom-domains.ps1 Outdated
Comment thread docs/aca-api-cutover-303.md
@patoperpetua

Copy link
Copy Markdown
Contributor Author

Picking up has-feedback: derive ACA environment from the Container App (schema optional override) and fix cutover doc step reference.

Derive managedEnvironmentId from the Container App instead of a hard-coded
CAE fallback, document optional environmentName in the schema, and point
DNS cutover at step 4 for the FQDN.

Co-authored-by: Cursor <cursoragent@cursor.com>
@patoperpetua patoperpetua removed the has-feedback Bugbot or human feedback on the PR label Sep 10, 2026
@github-actions github-actions Bot added the has-feedback Bugbot or human feedback on the PR label Sep 10, 2026
@patoperpetua
patoperpetua merged commit 01b3ab1 into main Sep 10, 2026
49 of 53 checks passed
@patoperpetua
patoperpetua deleted the chore/303-aca-custom-domain-dns branch September 10, 2026 07:15
@github-actions github-actions Bot removed the has-feedback Bugbot or human feedback on the PR label Sep 10, 2026
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.

2 participants