Quick Start: Set Up a Custom Domain
Replace the default *.azurecontainerapps.io hostname with your own domain (for example, app.contoso.com) and update the StratoLens settings that depend on it.
What this guide covers
Binding the custom domain and certificate to the Container App is a standard Azure step — we won't repeat it here. Use Microsoft's docs for that part:
- Free managed certificate (recommended) — Azure issues and renews the cert for you.
- Bring your own certificate — if you already have one or need a wildcard / EV cert.
Once Microsoft's steps are complete, the Custom domains blade on your Container App should show your hostname bound with a valid certificate:
With the domain bound, StratoLens needs four updates so authentication and email links use the new hostname:
- Add the new URL to the main App Registration (SPA redirect URIs).
- Add the new email callback URL to the Notifications App Registration (Web redirect URIs).
- Update
WEBSITE_HOSTNAMEon the StratoLens Container App. - Update
WEBSITE_HOSTNAMEon the StratoLens Container App Job.
Keep the original URL during cutover
Don't remove the original *.azurecontainerapps.io redirect URI right away. Leaving it in place gives you a working fallback if anything goes wrong during the switch.
1Add the new URL to the main App Registration
In the Azure Portal, go to Microsoft Entra ID → App registrations. Switch the filter at the top to All applications and search for StratoLens— you should see two app registrations:
- StratoLens — the main app registration (used in this step).
- StratoLens Notifications — the email-sending app registration (used in step 2).
Open the StratoLens app registration. Then:
- Click Authentication in the left sidebar.
- Find the Single-page application row and click Edit.
- In the box that appears, add your custom URL on a new line below the existing
*.azurecontainerapps.ioURI — for examplehttps://app.contoso.com(replace with your domain). - Click Configure at the bottom right of the page to save.
Leave the existing https://ca-{company}-stratolens.{region}.azurecontainerapps.io entry in place for now.
It must be the SPA section, not Web
The main StratoLens app registration uses the Single-page application redirect type.
2Add the email callback URL to the Notifications App Registration
Go back to App registrations and open the StratoLens Notifications app registration. Then:
- Click Authentication in the left sidebar.
- Find the Web row (not Single-page application this time) and click Edit.
- In the box that appears, add your custom email callback URL on a new line below the existing
*.azurecontainerapps.io/auth/email-callbackURI — for examplehttps://app.contoso.com/auth/email-callback(replace with your domain). - Click Configure at the bottom right of the page to save.
/auth/email-callback URL on the new domain below the existing one.Web, not SPA — this one's different
The Notifications app registration uses the Web redirect type.
3Update WEBSITE_HOSTNAME on the Container App
StratoLens reads the WEBSITE_HOSTNAMEenvironment variable to build the auth redirect URI it sends to Microsoft Entra and the "View in StratoLens" deep links in emails. It needs to match your new domain.
In the Azure Portal, open the StratoLens web app — the Container App named ca-{company}-stratolens. Then:
- Click Containers in the left sidebar.
- Click the Environment variables tab.
- Find the
WEBSITE_HOSTNAMErow and replace its value with your custom hostname — for exampleapp.contoso.com(replace with your domain). Hostname only, nohttps://. - Click Save as new revision.
ca-{company}-stratolens → Containers → Environment variables. Replace the value of WEBSITE_HOSTNAME with your custom hostname.The Container App creates a new revision automatically, which picks up the updated value.
4Update WEBSITE_HOSTNAME on the Container App Job
Scheduled reports and background notifications are sent by a separate Container App Job named job-{company}-stratolens. It needs the same update so the deep links in scheduled emails point at the new domain.
Open the Container App Job in the Azure Portal. Then:
- Click Containers in the left sidebar.
- Click the container name Scheduler to open its settings.
- Click the Environment variables tab.
- Find the
WEBSITE_HOSTNAMErow and replace its value with the same hostname you used in step 3 (for example,app.contoso.com). - Click Save.
- Click Apply at the bottom left of the screen to commit the change to the job.
job-{company}-stratolens → Containers → Environment variables. Match the hostname from step 3.Don't skip the job
If you only update the Container App, scheduled report emails will keep linking to the old *.azurecontainerapps.io URL. The job runs on its own revision and reads its own environment variables.
5Verify
Once both revisions are running, confirm the switch worked:
- Sign-in: open
https://app.contoso.comin a new browser session and sign in. You should land in StratoLens without a redirect-URI error. - Email OAuth: go to Settings → Email Notifications, run the OAuth connect flow, and confirm it completes without an
AADSTS50011redirect-mismatch error. - Email links:trigger a test notification or scheduled report and verify the "View in StratoLens" button in the email points at the new hostname.
You're on your custom domain
Sign-in, email OAuth, and email deep links are all using the new hostname. Once you've confirmed everything works, you can remove the original *.azurecontainerapps.io redirect URI from both app registrations.