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
Copy file name to clipboardExpand all lines: docs/DeploymentGuide.md
+46-59Lines changed: 46 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ You can run this solution using GitHub Codespaces. The button will open a web-ba
97
97
</details>
98
98
99
99
<details>
100
-
<summary><b>Deploy in VS Code</b></summary>
100
+
<summary><b>Deploy in VS Code Dev Containers</b></summary>
101
101
102
102
### VS Code Dev Containers
103
103
@@ -215,43 +215,52 @@ For **production deployments**, the repository also provides [`main.waf.paramete
215
215
216
216
---
217
217
218
+
### 🔁 Safe Redeployment or Environment Update Workflow
219
+
220
+
**[!IMPORTANT]**
221
+
> **Never run `azd init` again after your initial setup.** Doing so can overwrite your configuration and break your deployment.
222
+
223
+
For subsequent deployments or environment changes, use one of the following safe approaches:
224
+
225
+
#### Option 1: Create a New Environment (Recommended for Clean Redeployments)
226
+
227
+
Create a fresh deployment environment with its own settings and resource group:
228
+
```bash
229
+
azd env new <your-new-env-name>
230
+
```
231
+
232
+
#### Option 2: Update Your Current Environment Settings
233
+
234
+
To modify settings (e.g., Azure region, resource suffix), edit the environment file directly:
235
+
```bash
236
+
azd env set AZURE_LOCATION <your-desired-location>
237
+
```
238
+
218
239
### 🔒 Security Considerations for Cosmos DB
219
240
220
-
This solution deploys Cosmos DB with security controls aligned to the **Azure Well-Architected Framework**. Access is **never public by default** — all access is explicitly controlled via **managed identities**, **role-based access control (RBAC)**, and **private networking**.
221
-
222
-
#### 📌 Intended Access Level
223
-
-**Public network access**: **Disabled** (when `enablePrivateNetworking = true`, which is the default for WAF-aligned deployments).
224
-
-**Private access**: Enabled via **Private Endpoints** integrated with your virtual network.
225
-
-**No public write or read access** is allowed from the internet.
226
-
227
-
> 💡 In sandbox mode (`main.parameters.json`), public access may be enabled for rapid testing. **Do not use sandbox settings in production.**
228
-
229
-
#### ✅ Allowed Operations
230
-
| Operation | Allowed? | Details |
231
-
|------------------|----------|--------|
232
-
| Read (data) | ✅ Yes | Via assigned managed identity with **Cosmos DB Built-in Data Reader** or **Contributor** role |
233
-
| Write (data) | ✅ Yes | Via assigned managed identity with **Cosmos DB Built-in Data Contributor** role |
234
-
| Control-plane ops (create/delete DB) | ❌ No (for apps) | Only deployment principal (user or service principal running `azd up`) has control-plane access |
235
-
236
-
#### 👥 Authorized Principals & Network Paths
237
-
-**Identity-based access**:
238
-
- The **application’s user-assigned managed identity** is granted fine-grained data-plane roles:
239
-
-`Cosmos DB Built-in Data Contributor` (for read + write)
240
-
-*Or*`Cosmos DB Built-in Data Reader` (if read-only)
241
-
-**No shared keys or connection strings** are used — all access uses **Azure AD authentication** (token-based).
242
-
-**Network-based access**:
243
-
- Traffic flows exclusively over **private endpoints** within your virtual network.
244
-
-**No public IPs** or internet-facing endpoints are exposed for Cosmos DB.
245
-
- Network Security Groups (NSGs) and Azure Firewall rules (if configured) further restrict lateral movement.
246
-
247
-
#### ⚠️ Important Notes
248
-
- If you **disable private networking** (`enablePrivateNetworking = false`), the Cosmos DB account will allow public access — **not recommended for production**.
249
-
- Always review and **remove unnecessary role assignments** post-deployment.
250
-
- Audit access using **Azure Activity Logs** and **Cosmos DB diagnostic logs** (enabled by default in WAF mode).
251
-
252
-
For more details, see:
253
-
-[Azure Cosmos DB Role-Based Access Control](https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-setup-rbac)
254
-
-[Secure access to Cosmos DB using Private Endpoints](https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-private-endpoints)
241
+
This solution uses Azure AD-based RBAC (not account keys) for Cosmos DB data access. The level of network exposure depends on your deployment mode:
- Network access: Public endpoint enabled — Cosmos DB accepts requests from the internet.
258
+
259
+
- Authentication: Still Azure AD RBAC only (no account keys).
260
+
261
+
- Role assigned: Same Cosmos DB Built-in Data Contributor → full read + write.
262
+
263
+
- Who can access: Only the app’s managed identity — no additional users or groups are granted access.
255
264
256
265
### Deploying with AZD
257
266
@@ -350,36 +359,14 @@ Check all resources in your environment's resource group
350
359
351
360
> 💡 **Please refer:**
352
361
353
-

362
+

354
363
355
364
3. Once the deployment has completed successfully, open the [Azure Portal](https://portal.azure.com/), go to the deployed resource group, find the App Service, and get the app URL from `Default domain`.
356
365
357
366
4. When Deployment is complete, follow steps in [Set Up Authentication in Azure App Service](../docs/azure_app_service_auth_setup.md) to add app authentication to your web app running on Azure App Service
358
367
359
368
5. If you are done trying out the application, you can delete the resources by running `azd down`.
360
369
361
-
### 🔁 Safe Redeployment or Environment Update Workflow
362
-
363
-
> [!IMPORTANT]
364
-
>**Never run `azd init` again after your initial setup.** Doing so can overwrite your configuration and break your deployment.
365
-
366
-
For subsequent deployments or environment changes, use one of the following safe approaches:
367
-
368
-
#### Option 1: Create a New Environment (Recommended for Clean Redeployments)
369
-
370
-
Create a fresh deployment environment with its own settings and resource group:
371
-
```bash
372
-
azd env new <your-new-env-name>
373
-
```
374
-
375
-
#### Option 2: Update Your Current Environment Settings
376
-
377
-
To modify settings (e.g., Azure region, resource suffix), edit the environment file directly:
378
-
```bash
379
-
azd env set AZURE_LOCATION <your-desired-location>
380
-
```
381
-
382
-
383
370
### 🛠️ Troubleshooting
384
371
If you encounter any issues during the deployment process, please refer [troubleshooting](../docs/TroubleShootingSteps.md) document for detailed steps and solutions.
0 commit comments