Azure Event Grid Scalability and Security Limitations
Short answer
B The solution fails because creating one event subscription per customer is not scalable for thousands of users and does not inherently implement Microsoft Entra ID-based authentication or efficient filtering for hundreds of event types.
Question
You are implementing an application by using Azure Event Grid to push near-real-time information to customers. Requirements: send events to thousands of customers that include hundreds of various event types; filter events by type before processing; handle authentication and authorization by using Microsoft Entra ID; publish events to a single endpoint.
Solution: Publish events to a custom topic. Create an event subscription for each customer.
Does the solution meet the goal?
Key Takeaways
Creating individual event subscriptions per customer in Azure Event Grid is an anti-pattern for large-scale scenarios. This approach fails to efficiently handle hundreds of event types or enforce Microsoft Entra ID authentication at scale, making the solution inadequate for the requirements.
Expert Analysis
Even with a custom topic, creating one event subscription per customer does not by itself satisfy the requirements of filtering hundreds of event types and enforcing per-customer Microsoft Entra authorization at scale; such a design is impractical and incomplete.
The proposed solution fails to meet the architectural requirements for scalability, security, and operational efficiency. While Azure Event Grid supports custom topics and event subscriptions, the specific implementation detail of "creating an event subscription for each customer" creates a linear scaling problem that contradicts the requirement to handle "thousands of customers." In Azure Event Grid, an event subscription is a resource that defines where events are delivered and how they are filtered. Creating thousands of individual subscription resources introduces significant management overhead, exceeds typical resource quotas, and complicates lifecycle management. More critically, this approach does not inherently provide the required filtering or authentication mechanisms without additional, complex configuration that is not described in the solution.
First, consider the filtering requirement: "filter events by type before processing." The scenario specifies "hundreds of various event types." If you create a separate event subscription for each customer, you must configure filters on each subscription. However, the goal is to filter events before processing, implying that different customers should receive different subsets of events based on their interests or roles. A single-event-subscription-per-customer model forces a many-to-many relationship between event types and customers that is inefficiently managed through discrete resources. A more scalable pattern involves using a single endpoint (or a small set of endpoints) with dynamic routing or filtering logic, rather than provisioning a dedicated subscription resource per subscriber. The reference explanation notes that this design is "impractical," which in Azure architecture terms usually means it violates best practices for resource limits and manageability.
Second, and more importantly, the solution fails to address the security requirement: "handle authentication and authorization by using Microsoft Entra ID." Azure Event Grid supports authentication via Managed Identity and Azure AD (Microsoft Entra ID). However, simply creating an event subscription does not automatically enforce per-customer authorization. To achieve per-customer access control using Microsoft Entra ID, you typically need to integrate with API Management or use custom handlers that validate tokens. An event subscription alone is a delivery mechanism, not an identity enforcement boundary. The requirement to "publish events to a single endpoint" further suggests that the filtering and authorization logic should reside at the application level or within a gateway, not be scattered across thousands of event subscription configurations. The proposed solution leaves the critical task of authenticating each customer's request and authorizing their view of event types undefined. It assumes the subscription creation process handles these security constraints, which it does not. Without explicit mention of configuring access policies, Managed Identity assignments, or integrating with an API layer for token validation, the solution is incomplete regarding security.
Furthermore, the constraint "publish events to a single endpoint" is ambiguous but likely refers to the publishing side or a unified ingestion point. Regardless, the receiving side needs to handle thousands of distinct consumers. The standard scalable pattern for this in Azure is to use a single event subscription that routes events to a service bus or webhook, where downstream applications can then apply their own filtering and authentication logic. Alternatively, using Event Grid with a shared access policy and client-side filtering is possible but less secure than centralized Entra ID integration. The proposed solution of one subscription per customer is an anti-pattern for large-scale multi-tenancy because it couples the identity of the subscriber directly to the infrastructure resource (the subscription), making rotation, auditing, and permission management excessively difficult. Therefore, the solution is insufficient because it ignores the complexity of securing thousands of connections and filtering hundreds of event types efficiently.
Option A is incorrect because the solution, as stated, lacks the necessary components for secure, scalable filtering. Option B is correct because the design is fundamentally flawed for the stated scale and security requirements.
Exam Strategy
When evaluating Event Grid architectures for scale, always check if the number of event subscriptions matches the number of subscribers. For thousands of customers, prefer a single subscription routing to a central handler (like Azure Functions or Service Bus) that applies runtime filtering and authentication, rather than provisioning one subscription per user. This reduces resource overhead and simplifies security management via centralized policies.
Related Analysis
Practice All AI-200 Questions
Access 69 questions with complete answers and detailed explanations.
View Full AI-200 Practice Test →