Skip to content

Commit 1863712

Browse files
update document for code hosting
1 parent c6d2683 commit 1863712

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

docs/LOCAL_DEPLOYMENT.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,16 @@ Review the configuration options below. You can customize any settings that meet
170170
| **Configuration File** | `main.parameters.json` (sandbox) | Copy `main.waf.parameters.json` to `main.parameters.json` |
171171
| **Security Controls** | Minimal (for rapid iteration) | Enhanced (production best practices) |
172172
| **Network Access** | All services publicly accessible | Backend API (Function App) restricted to private network; only frontend publicly accessible |
173-
| **Private Endpoints** | Disabled | Enabled for all backend services (Storage, Key Vault, Cosmos DB/PostgreSQL, OpenAI, Search, Function App) |
173+
| **Private Endpoints** | Disabled | Enabled for backend services (Storage, Key Vault, Cosmos DB/PostgreSQL, OpenAI, Search). Function App private endpoint is included for container hosting; for code hosting, keep API private access without adding a Function App private endpoint. |
174174
| **Cost** | Lower costs | Cost optimized |
175175
| **Use Case** | POCs, development, testing | Production workloads |
176176
| **Framework** | Basic configuration | [Well-Architected Framework](https://learn.microsoft.com/en-us/azure/well-architected/) |
177177
| **Features** | Core functionality | Reliability, security, operational excellence |
178178

179+
> **Note - WAF Deployment (Restrict API to Private Access, Function App on App Service Plan Accelerators):**
180+
> If `AZURE_APP_SERVICE_HOSTING_MODEL` is set to `code`, do **not** implement a private endpoint for the backend API Function App.
181+
> Keep the API restricted through App Service access restrictions/private networking controls applicable to code hosting.
182+
179183
**To use production configuration:**
180184

181185
Copy the contents from the production configuration file to your main parameters file:

docs/best_practices.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ Moreover, optimizing the data in the index also enhances the efficiency, the spe
4747

4848
When deploying with the production/WAF configuration (`enablePrivateNetworking: true`), the following network security measures are automatically applied:
4949

50-
- **Private Endpoints**: All backend services including Azure OpenAI, Azure AI Search, Storage Account, Key Vault, Cosmos DB/PostgreSQL, and the Function App (backend API) are configured with private endpoints, making them accessible only through the VNet.
50+
- **Private Endpoints**: Backend services including Azure OpenAI, Azure AI Search, Storage Account, Key Vault, and Cosmos DB/PostgreSQL are configured with private endpoints. For the Function App (backend API), private endpoint is used in container hosting; in code hosting, follow access restrictions/private networking controls without adding a Function App private endpoint.
5151
- **Function App (Backend API)**: The Function App hosting the backend API is secured with:
52-
- Private endpoint for inbound traffic
52+
- Private endpoint for inbound traffic in container hosting
5353
- VNet integration for outbound traffic
54-
- Public network access disabled
55-
- Communication limited to internal VNet traffic only
54+
- Public inbound access blocked using App Service access restrictions
55+
- Communication limited to approved private paths and network controls
5656
- **Frontend Web Apps**: The App Service (frontend) and Admin App remain publicly accessible to serve user traffic, while communicating with backend services through the private network.
5757
- **Virtual Network**: All resources are integrated into a secure virtual network with properly configured subnets and Network Security Groups (NSGs).
5858
- **Bastion Host**: A jumpbox VM accessible via Azure Bastion is provided for management access to private resources.

infra/main.bicep

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,12 +1438,12 @@ module function 'modules/app/function.bicep' = {
14381438
// WAF: Use IP restrictions to block public API access while allowing SCM for deployments
14391439
// publicNetworkAccess stays Enabled, but ipSecurityRestrictions blocks public traffic to the main site
14401440
publicNetworkAccess: 'Enabled'
1441-
// Block all public access to the main site (API) - traffic must go through private endpoint
1441+
// Block all public access to the main site (API)
14421442
ipSecurityRestrictions: enablePrivateNetworking
14431443
? [
14441444
{
14451445
name: 'DenyAllPublicAccess'
1446-
description: 'Deny public access. Use private endpoint.'
1446+
description: 'Deny public access to API endpoint.'
14471447
action: 'Deny'
14481448
priority: 100
14491449
ipAddress: '0.0.0.0/0'
@@ -1454,7 +1454,7 @@ module function 'modules/app/function.bicep' = {
14541454
scmIpSecurityRestrictions: []
14551455
// Do NOT inherit main site restrictions for SCM - this allows deployments while API is private
14561456
scmIpSecurityRestrictionsUseMain: false
1457-
privateEndpoints: enablePrivateNetworking
1457+
privateEndpoints: (enablePrivateNetworking && hostingModel == 'container')
14581458
? [
14591459
{
14601460
name: 'pep-${hostingModel == 'container' ? '${functionName}-docker' : functionName}'

0 commit comments

Comments
 (0)