Skip to main content

2.3 Subdomain and TLS

Outcome​

The customer's tenant subdomain (e.g. acme.rcm.medsuite.com) resolves and serves the RCM tenant UI over HTTPS.

Prerequisites​

How tenant subdomains work​

If you set up a wildcard *.rcm.medsuite.com in Phase 1.6, no DNS changes are required per tenant — the wildcard handles it automatically. The frontend reads window.location.host, splits the slug from the host, and resolves the tenant via /api/v1/auth/tenant?slug=<slug> on first paint.

If you opted for per-tenant DNS records (e.g. enterprise customers wanting their own host certs), follow the steps below.

Steps (per-tenant DNS path)​

  1. Add a CNAME (in your DNS provider):

    HostnameTypeTarget
    acme.rcm.medsuite.comCNAMEFront Door endpoint
  2. Bind the custom hostname:

    az afd custom-domain create \
    --resource-group rg-rcm-prod-eastus2 \
    --profile-name fd-rcm-prod \
    --custom-domain-name acme-rcm \
    --host-name acme.rcm.medsuite.com \
    --certificate-type ManagedCertificate \
    --minimum-tls-version TLS12
  3. Wait for cert validation (5–30 min):

    az afd custom-domain show \
    --resource-group rg-rcm-prod-eastus2 \
    --profile-name fd-rcm-prod \
    --custom-domain-name acme-rcm \
    --query "{state:provisioningState, status:domainValidationState}"

    Both should be Succeeded / Approved.

Validation​

CheckExpected
dig acme.rcm.medsuite.comResolves
curl -fsSL https://acme.rcm.medsuite.com200 (login page)
Cert validopenssl s_client … shows non-expired chain
Login redirects to tenant contextURL contains ?tenantSlug=acme post-login

Troubleshooting​

SymptomLikely causeFix
Cert never validatesDNS still propagatingAllow up to 4 hours.
404 on subdomainFront Door route not matchingConfirm the wildcard route from Phase 1.6 step 4 is in place.
App loads but says "Tenant not found"Slug mismatchSELECT slug FROM identity.tenant WHERE slug = 'acme';.

Next​

2.4 — First tenant admin