You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- DeploymentGuide.md §5.2 rewritten: describes the automatic flow,
permission requirements, admin-consent failure handling, and the
AZURE_SKIP_AUTH_SETUP escape hatch.
- ConfigureAppAuthentication.md gets a banner making clear the manual
steps are now a fallback (for tenants that block programmatic app
registration or admin consent).
Copy file name to clipboardExpand all lines: docs/ConfigureAppAuthentication.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,16 @@
1
1
# Set up Authentication in Azure Container App
2
2
3
+
> ### ✅ Automatic configuration is now the default
4
+
>
5
+
> As of the latest release, `azd up`**automatically** performs all of the steps below via the `infra/scripts/configure_auth.{sh,ps1}` post-provisioning hook. You should not need to follow this document in most cases.
6
+
>
7
+
> See [DeploymentGuide.md § 5.2](./DeploymentGuide.md#52-configure-authentication-automatic) for details, including how to opt out with `azd env set AZURE_SKIP_AUTH_SETUP true`.
8
+
>
9
+
> Follow the manual steps below **only** if:
10
+
> - You set `AZURE_SKIP_AUTH_SETUP=true` before running `azd up`
11
+
> - The automatic script reported an error (most commonly: your identity lacks permission to grant admin consent — a tenant admin still has to consent, but the rest of the configuration is already complete)
12
+
> - Your tenant policy prohibits programmatic app registration or secret creation
13
+
3
14
This document provides step-by-step instructions to configure Azure App Registrations for the front-end and back-end applications.
4
15
5
16
> **Note:** The solution deploys four container apps. Only the **Web** and **API** container apps require Entra ID authentication provider configuration. The **Content Processor** (app) and **Content Process Workflow** (wkfl) containers are internal services that communicate via Storage Queues using managed identity — they do not expose public endpoints.
2. Wait up to 10 minutes for authentication changes to take effect.
368
+
1. Creates two Entra ID app registrations (`<env>-web-app`, `<env>-api-app`) with the correct redirect URIs, exposed scopes, and required permissions
369
+
2. Grants admin consent (best effort — see note below)
370
+
3. Mints client secrets and stores them in Container Apps secrets
371
+
4. Enables the Microsoft identity provider on both the Web and API container apps
372
+
5. Restricts the API to only accept tokens from the Web app (`allowedApplications`)
373
+
6. Sets the `APP_WEB_CLIENT_ID`, `APP_WEB_SCOPE`, `APP_API_SCOPE`, and `APP_AUTH_ENABLED` environment variables on the Web container
374
+
375
+
You will see an **`🔐 Configuring Entra ID authentication`** section in the `azd up` output, ending with a summary of both client IDs and scopes.
376
+
377
+
>**Note:** EasyAuth can take up to 10 minutes to fully propagate. If the Web app returns 500/401 immediately after deployment, wait a few minutes and retry.
378
+
379
+
#### When automatic configuration is not possible
380
+
381
+
Automatic configuration requires permission to:
382
+
- Create Entra ID app registrations (**Application Administrator** or equivalent)
383
+
- Grant admin consent for delegated permissions (**Cloud Application Administrator** or **Global Administrator**)
384
+
385
+
If your identity cannot grant admin consent, the script prints a clear manual action message like:
386
+
387
+
```
388
+
⚠️ Admin consent failed. Sign-in may fail until a tenant admin runs:
389
+
az ad app permission admin-consent --id <web-client-id>
390
+
Or visit: https://login.microsoftonline.com/<tenant>/adminconsent?client_id=<web-client-id>
391
+
```
392
+
393
+
In that case, share the command/URL with your tenant administrator.
394
+
395
+
#### Skipping automatic auth configuration
396
+
397
+
If your tenant blocks programmatic app registration, or you prefer to configure authentication manually, disable the automation before running `azd up`:
398
+
399
+
```bash
400
+
azd env set AZURE_SKIP_AUTH_SETUP true
401
+
```
402
+
403
+
Then follow the manual instructions: [App Authentication Configuration (manual)](./ConfigureAppAuthentication.md).
404
+
405
+
#### Re-running
406
+
407
+
The automation is idempotent: re-running `azd up` reuses the existing app registrations (IDs are persisted in`AZURE_AUTH_WEB_CLIENT_ID` / `AZURE_AUTH_API_CLIENT_ID`in the azd environment) and does not rotate client secrets.
0 commit comments