Skip to content

Commit b164e6b

Browse files
committed
docs: reflect automatic auth configuration
- 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).
1 parent 833da3b commit b164e6b

2 files changed

Lines changed: 53 additions & 4 deletions

File tree

docs/ConfigureAppAuthentication.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Set up Authentication in Azure Container App
22

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+
314
This document provides step-by-step instructions to configure Azure App Registrations for the front-end and back-end applications.
415

516
> **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.

docs/DeploymentGuide.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,50 @@ Schema registration process completed.
360360
✅ Schema registration complete.
361361
```
362362

363-
### 5.2 Configure Authentication (Required)
363+
### 5.2 Configure Authentication (Automatic)
364364

365-
**This step is mandatory for application access:**
365+
Starting with this release, authentication is configured **automatically** as part of the `azd up` post-provisioning hook. The hook:
366366

367-
1. Follow [App Authentication Configuration](./ConfigureAppAuthentication.md).
368-
2. Wait up to 10 minutes for authentication changes to take effect.
367+
1. Creates two Entra ID app registrations (`<env>-web-app`, `<env>-api-app`) with the correct redirect URIs, exposed scopes, and required permissions
368+
2. Grants admin consent (best effort — see note below)
369+
3. Mints client secrets and stores them in Container Apps secrets
370+
4. Enables the Microsoft identity provider on both the Web and API container apps
371+
5. Restricts the API to only accept tokens from the Web app (`allowedApplications`)
372+
6. Sets the `APP_WEB_CLIENT_ID`, `APP_WEB_SCOPE`, `APP_API_SCOPE`, and `APP_AUTH_ENABLED` environment variables on the Web container
373+
374+
You will see an **`🔐 Configuring Entra ID authentication`** section in the `azd up` output, ending with a summary of both client IDs and scopes.
375+
376+
> **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.
377+
378+
#### When automatic configuration is not possible
379+
380+
Automatic configuration requires permission to:
381+
- Create Entra ID app registrations (**Application Administrator** or equivalent)
382+
- Grant admin consent for delegated permissions (**Cloud Application Administrator** or **Global Administrator**)
383+
384+
If your identity cannot grant admin consent, the script prints a clear manual action message like:
385+
386+
```
387+
⚠️ Admin consent failed. Sign-in may fail until a tenant admin runs:
388+
az ad app permission admin-consent --id <web-client-id>
389+
Or visit: https://login.microsoftonline.com/<tenant>/adminconsent?client_id=<web-client-id>
390+
```
391+
392+
In that case, share the command/URL with your tenant administrator.
393+
394+
#### Skipping automatic auth configuration
395+
396+
If your tenant blocks programmatic app registration, or you prefer to configure authentication manually, disable the automation before running `azd up`:
397+
398+
```bash
399+
azd env set AZURE_SKIP_AUTH_SETUP true
400+
```
401+
402+
Then follow the manual instructions: [App Authentication Configuration (manual)](./ConfigureAppAuthentication.md).
403+
404+
#### Re-running
405+
406+
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.
369407
370408
### 5.3 Verify Deployment
371409

0 commit comments

Comments
 (0)