Skip to content

Commit 6221f00

Browse files
DonLeeTejasri-Microsoft
authored andcommitted
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 e3ab219 commit 6221f00

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
@@ -361,12 +361,50 @@ Schema registration process completed.
361361
✅ Schema registration complete.
362362
```
363363

364-
### 5.2 Configure Authentication (Required)
364+
### 5.2 Configure Authentication (Automatic)
365365

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

368-
1. Follow [App Authentication Configuration](./ConfigureAppAuthentication.md).
369-
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.
370408
371409
### 5.3 Verify Deployment
372410

0 commit comments

Comments
 (0)