Skip to content

Commit 7caab7a

Browse files
committed
feat: Update documentation for external authentication setup and deployment process
1 parent 0f0d405 commit 7caab7a

8 files changed

Lines changed: 692 additions & 4 deletions

File tree

docs/WikiContentDocumentationUpdatePlan.md

Lines changed: 458 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
api: resources/2024-03-01
2+
location: {{ .Env.AZURE_LOCATION }}
3+
identity:
4+
type: UserAssigned
5+
userAssignedIdentities:
6+
? "{{ .Env.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID }}"
7+
: {}
8+
properties:
9+
configuration:
10+
ingress:
11+
external: true
12+
targetPort: {{ targetPortOrDefault 8080 }}
13+
transport: auto
14+
allowInsecure: false
15+
stickySessionsMode: sticky
16+
registries:
17+
- server: "{{ .Env.AZURE_CONTAINER_REGISTRY_ENDPOINT }}"
18+
identity: "{{ .Env.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID }}"
19+
template:
20+
containers:
21+
- image: {{ .Image }}
22+
name: webapp
23+
env:
24+
- name: AZURE_CLIENT_ID
25+
value: "{{ .Env.MANAGED_IDENTITY_CLIENT_ID }}"

wiki-content/Deployment.md

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,81 @@ You can scale agents horizontally by deploying multiple replicas or multiple Con
165165
- **Default pool**: 2 replicas monitoring the `default` queue
166166
- **Large job pool**: 1 replica monitoring `jobs-large-container` with more CPU/memory allocated
167167

168-
### Upgrade
168+
### Updating a Deployed Instance
169169

170-
After initial deployment, you can upgrade easily using *Visual Studio* by right-clicking on the `AppHost` project and selecting publish and following the wizard.
170+
After the initial deployment with `azd up`, use `azd deploy` for all subsequent updates. This rebuilds and redeploys all services without re-provisioning infrastructure.
171171

172-
![alt text](images/upgrade-using-azure.png)
172+
From the AppHost directory, run:
173+
174+
```bash
175+
azd deploy
176+
```
177+
178+
This command:
179+
1. Builds all projects (Web, Scheduler, Agent)
180+
2. Containerizes the services
181+
3. Pushes updated images to Azure Container Registry
182+
4. Deploys updated containers to Azure Container Apps
183+
184+
**When to use each command:**
185+
186+
| Command | Use When |
187+
|---------|----------|
188+
| `azd up` | First-time deployment (provisions infrastructure + deploys) |
189+
| `azd deploy` | Updating an existing deployment with code or configuration changes |
190+
| `azd provision` | Updating only infrastructure (e.g., adding new Azure resources) |
191+
192+
> **Note:** If you have changed the Aspire AppHost topology (added or removed services/resources in `Program.cs`), run `azd up` instead to ensure infrastructure is updated.
193+
194+
**Deploying a single service:**
195+
196+
To deploy only one service (e.g., after a change to only the web app):
197+
198+
```bash
199+
azd deploy webapp
200+
```
201+
202+
Service names match those defined in the AppHost: `webapp`, `scheduler`, `agent`.
203+
204+
```mermaid
205+
flowchart TD
206+
A["Code changes committed"] --> B{"First deployment?"}
207+
B -- Yes --> C["azd auth login"]
208+
C --> D["azd up"]
209+
D --> E["Infrastructure provisioned and app deployed"]
210+
B -- No --> F{"Infrastructure changes?"}
211+
F -- Yes --> G["azd up"]
212+
G --> E
213+
F -- No --> H["azd deploy"]
214+
H --> I["Updated containers deployed to existing infrastructure"]
215+
216+
style D fill:#0078d4,stroke:#005a9e,color:#fff
217+
style G fill:#0078d4,stroke:#005a9e,color:#fff
218+
style H fill:#107c10,stroke:#0b5e0b,color:#fff
219+
```
220+
221+
> **Alternative: Visual Studio Publish**
222+
>
223+
> You can also publish from Visual Studio by right-clicking the AppHost project and selecting **Publish**. However, `azd deploy` is the recommended approach as it is scriptable, repeatable, and consistent with the initial deployment workflow.
224+
>
225+
> ![alt text](images/upgrade-using-azure.png)
226+
227+
### External Authentication Redirect URIs
228+
229+
When deploying to Azure Container Apps, external authentication redirect URIs must use the Container App's fully qualified domain name (FQDN):
230+
231+
| Provider | Redirect URI Pattern |
232+
|----------|---------------------|
233+
| Microsoft | `https://<container-app-fqdn>/signin-microsoft` |
234+
| Google | `https://<container-app-fqdn>/signin-google` |
235+
236+
The FQDN is assigned by Azure Container Apps after deployment. Retrieve it from the Azure Portal or via:
237+
238+
```bash
239+
az containerapp show --name <webapp-name> --resource-group <rg-name> --query properties.configuration.ingress.fqdn -o tsv
240+
```
241+
242+
If using a custom domain, use that domain in the redirect URIs instead. Update the redirect URIs in your Azure Entra ID app registration and/or Google Cloud Console credentials to match.
173243

174244
### Podman deployment
175245

wiki-content/Features.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ You can enable webhook triggers on a per-job basis. Each webhook-enabled job rec
108108

109109
---
110110

111+
## External Authentication (Microsoft & Google)
112+
113+
Blazor Data Orchestrator supports optional external authentication via **Microsoft** (Azure Entra ID) and **Google** (OAuth 2.0) identity providers. External logins are configured entirely through the Admin UI — no changes to `appsettings.json` are needed.
114+
115+
- **Microsoft authentication** — Register an application in Azure Entra ID, then enter the Client ID and Client Secret in the Administration > Authentication tab.
116+
- **Google authentication** — Create OAuth 2.0 credentials in the Google Cloud Console, then enter the Client ID and Client Secret in the Administration > Authentication tab.
117+
- **Account linking only** — External logins link to existing user accounts. They do not auto-create new accounts.
118+
- **Settings stored in Azure Table Storage** — Authentication configuration is persisted alongside other application settings, not in configuration files.
119+
120+
> **Important:** After enabling or disabling an authentication provider, you must **restart the application** for the change to take effect. See the [Installation](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Installation) guide for details.
121+
122+
---
123+
111124
## Environment-Specific Configuration
112125

113126
Jobs support per-environment configuration files that are loaded at execution time based on the job's `JobEnvironment` setting.
@@ -169,7 +182,15 @@ The repository includes full Azure Developer CLI (`azd`) integration. A single c
169182
azd up
170183
```
171184

172-
This takes you from `git clone` to a fully deployed Azure Container Apps environment with no manual infrastructure setup. See the [Deployment](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Deployment) guide for details.
185+
This takes you from `git clone` to a fully deployed Azure Container Apps environment with no manual infrastructure setup.
186+
187+
For subsequent updates after the initial deployment, use `azd deploy` to rebuild and redeploy all services without re-provisioning infrastructure:
188+
189+
```bash
190+
azd deploy
191+
```
192+
193+
See the [Deployment](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Deployment) guide for details.
173194

174195
---
175196

wiki-content/Frequently-Asked-Questions.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ No. Aspire automatically starts an **Azurite** container (Azure Storage emulator
3434

3535
Run `azd up` from the repository root. This single command provisions all required Azure resources (Azure SQL, Storage Account, Container Registry, Container Apps Environment), builds and containerizes all services, and deploys them to Azure Container Apps. See the [Deployment](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Deployment) guide for details.
3636

37+
### How do I update my deployed instance after making code changes?
38+
39+
Run `azd deploy` from the AppHost directory. This rebuilds all services, pushes updated container images, and deploys them to Azure Container Apps without re-provisioning infrastructure. Use `azd up` only for the initial deployment or when the AppHost topology has changed (e.g., added or removed services/resources in `Program.cs`).
40+
41+
### Can I deploy just one service instead of all three?
42+
43+
Yes. Run `azd deploy <service-name>` where the service name is `webapp`, `scheduler`, or `agent`. This deploys only the specified service.
44+
3745
---
3846

3947
## Installation
@@ -124,6 +132,30 @@ Deploy multiple Agent instances or replicas. Each agent monitors a specific queu
124132

125133
---
126134

135+
## Authentication
136+
137+
### How do I set up Microsoft authentication?
138+
139+
Register an application in Azure Entra ID (formerly Azure AD) with a redirect URI of `https://<your-app-url>/signin-microsoft`, create a client secret, then enter the Client ID and Client Secret in **Administration** > **Authentication** in the web UI. Restart the application after saving. See the [Installation](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Installation) guide for a full walkthrough.
140+
141+
### How do I set up Google authentication?
142+
143+
Create OAuth 2.0 credentials in the Google Cloud Console with a redirect URI of `https://<your-app-url>/signin-google`, then enter the Client ID and Client Secret in **Administration** > **Authentication** in the web UI. Restart the application after saving. See the [Installation](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Installation) guide for a full walkthrough.
144+
145+
### I configured Microsoft/Google authentication but the login buttons do not appear
146+
147+
After changing any authentication settings in the Admin UI, you must **restart the application**. Authentication middleware is initialized at startup, and changes are not picked up at runtime. For local development, stop and re-run `aspire run`. For Azure, restart the Container App or redeploy with `azd deploy`.
148+
149+
### Do external logins create new user accounts automatically?
150+
151+
No. External logins only link to **existing** user accounts. A user must already be created in the system (via the Install Wizard or by an administrator) before they can sign in with Microsoft or Google.
152+
153+
### Where are the authentication settings stored?
154+
155+
Authentication settings (Client ID, Client Secret, Enabled flags) are stored in **Azure Table Storage**, not in `appsettings.json`. They are managed exclusively through the Administration > Authentication tab in the web UI.
156+
157+
---
158+
127159
## Troubleshooting
128160

129161
### Where are job logs stored?

wiki-content/Home.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Go from `git clone` to a fully operational job automation system in minutes:
3636
2. **Clone & restore**`git clone https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator.git && cd BlazorDataOrchestrator && dotnet workload restore`
3737
3. **Run locally**`aspire run` — Aspire starts SQL Server, Azurite, and all application services automatically. Complete the Install Wizard on first launch.
3838
4. **Deploy to Azure**`azd up` — Provisions Azure SQL, Storage, Container Registry, and Container Apps, then builds and deploys all services in a single command.
39+
5. **Update a deployed instance**`azd deploy` — Rebuilds and redeploys all services without re-provisioning infrastructure.
3940

4041
See the [Installation](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Installation) guide for detailed local setup and the [Deployment](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Deployment) guide for Azure deployment.
4142

wiki-content/Installation.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,55 @@ After the Install Wizard completes:
8787

8888
---
8989

90+
## 6. Configure External Authentication (Optional)
91+
92+
Blazor Data Orchestrator supports optional sign-in via **Microsoft** (Azure Entra ID) and **Google** (OAuth 2.0). These providers are configured entirely through the Admin UI — no changes to configuration files are needed.
93+
94+
### Microsoft Authentication
95+
96+
1. Navigate to the [Azure Portal](https://portal.azure.com) and go to **Microsoft Entra ID** > **App registrations** > **New registration**.
97+
2. Set the application name (e.g., `BlazorDataOrchestrator`).
98+
3. Set **Supported account types** to the appropriate scope:
99+
- *Single tenant* — only users in your Azure AD directory
100+
- *Multitenant* — users from any Azure AD directory
101+
- *Multitenant + personal Microsoft accounts* — broadest scope
102+
4. Set the **Redirect URI**:
103+
- Type: **Web**
104+
- URI: `https://<your-app-url>/signin-microsoft`
105+
- For local development: `https://localhost:<port>/signin-microsoft`
106+
5. Go to **Certificates & secrets** > **Client secrets** > **New client secret**. Copy the **Value** immediately (it is only shown once).
107+
6. Go to the app registration **Overview** page and copy the **Application (client) ID**.
108+
7. In Blazor Data Orchestrator, navigate to **Administration** > **Authentication**.
109+
8. Enable **Microsoft Authentication**, paste the **Client ID** and **Client Secret**, and click **Save**.
110+
9. **Restart the application** (see warning below).
111+
112+
### Google Authentication
113+
114+
1. Navigate to [Google Cloud Console](https://console.cloud.google.com/) and create or select a project.
115+
2. Go to **APIs & Services** > **Credentials** > **Create Credentials** > **OAuth client ID**.
116+
3. If prompted, configure the **OAuth consent screen** — set the app name, support email, and add scopes: `openid`, `email`, `profile`.
117+
4. Set **Application type** to **Web application**.
118+
5. Add **Authorized redirect URIs**:
119+
- `https://<your-app-url>/signin-google`
120+
- For local development: `https://localhost:<port>/signin-google`
121+
6. Copy the **Client ID** and **Client Secret** from the credentials page.
122+
7. In Blazor Data Orchestrator, navigate to **Administration** > **Authentication**.
123+
8. Enable **Google Authentication**, paste the **Client ID** and **Client Secret**, and click **Save**.
124+
9. **Restart the application** (see warning below).
125+
126+
> **⚠️ Warning: Application Restart Required**
127+
>
128+
> After enabling, disabling, or changing the Client ID / Client Secret for any external authentication provider (Microsoft or Google), you **must restart the application** for the changes to take effect.
129+
>
130+
> - **Local development:** Stop and re-run `aspire run`
131+
> - **Azure Container Apps:** Restart the Container App via the Azure Portal, Azure CLI, or redeploy using `azd deploy`
132+
>
133+
> The Login page will not show or hide provider buttons until the restart is complete.
134+
135+
> **Note:** External logins only **link to existing user accounts**. They do not auto-create new accounts. The user must already exist in the system before they can sign in with an external provider.
136+
137+
---
138+
90139
## Configuration Files
91140

92141
Blazor Data Orchestrator uses standard .NET configuration files. In development, Aspire injects connection strings automatically, so you typically do not need to edit these files.

wiki-content/Operation.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,38 @@ Navigate to the **Administration** page via the navigation link on the home page
179179
| **API Key** | Enter the API key supplied by the AI provider |
180180
| **Model** | Choose the model to use |
181181

182+
### External Authentication Providers
183+
184+
Blazor Data Orchestrator supports optional external authentication via **Microsoft** (Azure Entra ID) and **Google** (OAuth 2.0). These providers are managed from the **Administration** > **Authentication** tab.
185+
186+
#### Authentication Settings Reference
187+
188+
| Setting | Storage Key | Description |
189+
|---------|-------------|-------------|
190+
| Microsoft Enabled | `Authentication:Microsoft:Enabled` | Toggles the Microsoft login button on the Login page |
191+
| Microsoft Client ID | `Authentication:Microsoft:ClientId` | Application (client) ID from Azure Entra ID |
192+
| Microsoft Client Secret | `Authentication:Microsoft:ClientSecret` | Client secret value from Azure Entra ID |
193+
| Google Enabled | `Authentication:Google:Enabled` | Toggles the Google login button on the Login page |
194+
| Google Client ID | `Authentication:Google:ClientId` | OAuth 2.0 Client ID from Google Cloud Console |
195+
| Google Client Secret | `Authentication:Google:ClientSecret` | OAuth 2.0 Client Secret from Google Cloud Console |
196+
197+
> **Important:** These settings are stored in Azure Table Storage, not in `appsettings.json`. They are managed exclusively through the Admin UI.
198+
199+
#### Account Linking
200+
201+
External logins only **link to existing user accounts**. They do not auto-create new accounts. A user must already exist in the system (created via the Install Wizard or by an administrator) before they can sign in with Microsoft or Google.
202+
203+
> **⚠️ Warning: Application Restart Required**
204+
>
205+
> After enabling, disabling, or changing the Client ID / Client Secret for any external authentication provider, you **must restart the application** for the changes to take effect.
206+
>
207+
> - **Local development:** Stop and re-run `aspire run`
208+
> - **Azure Container Apps:** Restart the Container App via the Azure Portal, Azure CLI, or redeploy using `azd deploy`
209+
>
210+
> Authentication middleware is initialized at application startup. The `ExternalAuthOptionsStore` injects credentials via `IPostConfigureOptions`, but enabling or disabling a provider requires the authentication pipeline to be fully re-initialized — which only happens on restart. The Login page will not show or hide provider buttons until the restart is complete.
211+
212+
For setup instructions including Azure Portal and Google Cloud Console walkthroughs, see the [Installation](https://github.com/Blazor-Data-Orchestrator/BlazorDataOrchestrator/wiki/Installation) guide.
213+
182214
---
183215

184216
## Agent Behavior

0 commit comments

Comments
 (0)