This design implements Azure Functions and Event Grid.
Topology: The Function App runs in a Spoke VNet (Premium Plan for VNet Integration).
+--------------+ +--------------------------+ +--------------+
| Event | | HUB VNet | | SPOKE VNet |
| Source | | (Firewall) | | (Function) |
+------+-------+ +------------+-------------+ +------+-------+
| | |
v | (Peering) |
+------+-------+ v v
| Event Grid | +------------+-------------+ +------+-------+
| Topic |---------->| Azure Firewall |<--------->| Function |
+--------------+ | (Egress) | | App |
+--------------------------+ +------+-------+
PRIMARY REGION (East US)
+-----------------------------------------------------------------------+
| HUB VNet: vnet-hub (10.0.0.0/16) |
| +-----------------------+ |
| | Azure Firewall | |
| +-----------|-----------+ |
| | |
| v (Peering) |
+---------------|-------------------------------------------------------+
|
+---------------|-------------------------------------------------------+
| SPOKE VNet: vnet-func-spoke (10.1.0.0/16) |
| +-----------------------+ |
| | Subnet: Integration | |
| | [Function App] | |
| +-----------------------+ |
+-----------------------------------------------------------------------+
SECONDARY REGION (West US)
+-----------------------------------------------------------------------+
| DR STRATEGY |
| +-----------------------+ |
| | Function App (DR) | |
| | (Stopped) | |
| +-----------------------+ |
+-----------------------------------------------------------------------+
1. Event: Blob uploaded.
2. Grid: Event Grid fires event.
3. Trigger: Function triggers.
4. Process: Function processes data.
5. Outbound: Function writes to SQL via VNet Integration.
1. Create Resource Group: rg-design07-func. Region: East US.
2. Create VNet:
* Name: vnet-func-spoke.
* Address space: 10.1.0.0/16.
* Subnet: snet-func-int (10.1.1.0/24).
* *Note: This subnet will be delegated.*
3. Peering: Peer vnet-func-spoke to vnet-hub.
1. Search: "Function App" -> + Create.
2. Resource Group: rg-design07-func.
3. Name: func-corp-events-[uniqueid].
4. Runtime stack: .NET 6 (or your choice).
5. Region: East US.
6. Hosting:
* Plan type: Functions Premium.
* Plan: Create new plan-func-prem.
7. Storage: Create new stfuncstorage.
8. Networking:
* Enable public access: On (for trigger convenience) or Off (for strict security).
* Enable network injection: On.
* Virtual Network: vnet-func-spoke.
* Subnet: snet-func-int.
9. Create.
1. Search: "Event Grid Topics" -> + Create.
2. Resource Group: rg-design07-func.
3. Name: egt-corp-main.
4. Region: East US.
5. Create.
1. Go to Function App -> Functions -> + Create.
2. Template: Azure Event Grid trigger.
3. Name: ProcessEvent.
4. Create.
5. Integration:
* Click Event Grid Trigger (Input).
* Create Event Subscription.
* Name: sub-func-process.
* Topic Type: Event Grid Topic.
* Source Resource: egt-corp-main.
* Create.
1. Go to the Event Grid Topic.
2. Overview -> Copy Topic Endpoint.
3. Use Postman or Curl to send a test event to the Topic Endpoint (requires Access Key).
4. Check Function App Monitor logs to see the event processed.