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: documentation/api-management.md
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# Gateway using API Management
2
2
3
-
-[Next steps](#next-steps)
3
+
-[Gateway using API Management](#gateway-using-api-management)
4
+
-[Next steps](#next-steps)
4
5
5
6
There are many benefits to using an API manager. In the case the Rideshare solution, there are really four major benefits:
6
7
@@ -112,7 +113,7 @@ public static async Task<IActionResult> GetDrivers([HttpTrigger(AuthorizationLev
112
113
113
114
4.**Rate Limiting**: the API manager can be configured to rate limit APIs based on IP origin, access, etc. This can be useful to prevent DOD attacks or provide different tiers of access based on users.
114
115
115
-
**Please note** that, in the case of Azure Functions, while the APIs are front-ended with an API manager (and hence shielded, protected, and rate limited), the APIs are still publicly available. This means that a DDOS attack or other attacks can still happen against the bare APIs if someone discovers them in the wild.
116
+
**Please note** that, in the case of Azure Functions, while the APIs are front-ended with an API manager (and hence shielded, protected, and rate limited), the APIs are still publicly available. This means that a DDOS attack or other attacks can still happen against the bare APIs if someone discovers them in the wild. However, you can restrict access to your Function Apps by [only allowing access to your API Management's static IP](https://docs.microsoft.com/azure/app-service/app-service-ip-restrictions) address. When you do this, only traffic that flows through API Management will be able to access your functions.
| RideShare Web App | Vue.js SPA | A multi-purpose, single-page application web app that allows users to sign up and sign in against a B2C Active Directory instance. Users have different levels and permissions. For example, passenger users can request rides and receive real-time notifications of ride status. Executive users, on the other hand, can view top-level reports that reveal rides and system performance |
18
-
| API Manager |[Azure API Manager](https://docs.microsoft.com/azure/api-management/)| An API gateway that acts as a front-end to the solution APIs. Among many other benefits, the API management service provides RideShare APIs with security verification, usage telemetry, documentation and rate limiting. |
19
-
| RideShare APIs | C# [Azure Functions](https://azure.microsoft.com/services/functions/)| Three Function Apps are deployed to serve RideShare's APIs: Drivers, Trips and Passengers. These APIs are exposed to the Web App applications via the API manager and provide CRUD operations for each of RideShare entities |
20
-
| Durable Orchestrators | C# [Durable Functions](https://docs.microsoft.com/azure/azure-functions/durable-functions-overview)| Trip Manager, Monitor and Demo orchestrators are deployed to manage the trip and provide real-time status updates. The orchestrators are launched for the duration of the trip and they perform management and monitoring functions as will be explained in more [details](#durable-orchestrators) later. In essence, these orchestrators make up the heart of the solution. |
21
-
| Event Emitter |[Event Grid Topic](https://docs.microsoft.com/azure/event-grid/overview)| A custom topic used to externalize trips as they go through the different stages. |
22
-
| Event Subscribers | Functions & Logic Apps | Several Event Grid topic subscribers listen to the Event Grid topic events to provide multi-process capability of an externalized trip |
| RideShare Web App | Vue.js SPA | A multi-purpose, single-page application web app that allows users to sign up and sign in against a B2C Active Directory instance. Users have different levels and permissions. For example, passenger users can request rides and receive real-time notifications of ride status. Executive users, on the other hand, can view top-level reports that reveal rides and system performance. |
19
+
| API Manager |[Azure API Manager](https://docs.microsoft.com/azure/api-management/)| An API gateway that acts as a front-end to the solution APIs. Among many other benefits, the API management service provides RideShare APIs with security verification, usage telemetry, documentation and rate limiting. |
20
+
| RideShare APIs | C# [Azure Functions](https://azure.microsoft.com/services/functions/)| Three Function Apps are deployed to serve RideShare's APIs: Drivers, Trips and Passengers. These APIs are exposed to the Web App applications via the API manager and provide CRUD operations for each of RideShare entities. |
21
+
| Durable Orchestrators | C# [Durable Functions](https://docs.microsoft.com/azure/azure-functions/durable-functions-overview)| Trip Manager, Monitor and Demo orchestrators are deployed to manage the trip and provide real-time status updates. The orchestrators are launched for the duration of the trip and they perform management and monitoring functions as will be explained in more [details](#durable-orchestrators) later. In essence, these orchestrators make up the heart of the solution. |
22
+
| Event Emitter |[Event Grid Topic](https://docs.microsoft.com/azure/event-grid/overview)| A custom topic used to externalize trips as they go through the different stages. |
23
+
| Event Subscribers | Functions & Logic Apps | Several Event Grid topic subscribers listen to the Event Grid topic events to provide multi-process capability of an externalized trip. |
24
+
| Key Vault |[Azure Key Vault](https://docs.microsoft.com/azure/key-vault/key-vault-overview)| All secrets, such as database connection strings and keys are securely stored in Azure Key Vault. This prevents accidental leakage of sensitive values and the same keys can be easily shared by multiple services. |
@@ -164,7 +167,7 @@ public static async Task ProcessTripExternalizations2SignalR([EventGridTrigger]
164
167
165
168
**Please note** that, in the reference implementation, `EVGH_` is added to the function name that handles an Event Grid event i.e. `EVGH_TripExternalizations2SignalR`.
166
169
167
-
When an Event Grid Topic event arrives at the SignalR processor, it extracts the `TripItem` from the event data and calls different client methods based on the event subject to notify SignalR clients, in real-time, of trip state changes.
170
+
When an Event Grid Topic event arrives at the SignalR processor, it extracts the `TripItem` from the event data and calls different client methods based on the event subject to notify SignalR clients, in real-time, of trip state changes. The `UserId` value tells the SignalR Service which client should receive the message so it will not be sent to every connected user.
168
171
169
172
In this reference implementation, the SignalR client is the Web App SPA. But a Xamarin Mobile App or .NET client can also receive SignalR messages. When a client receives a SignalR message, they change the trip state so passengers and drivers become aware of the latest trip status.
170
173
@@ -235,12 +238,12 @@ Console.WriteLine("SignalR client started....waiting for messages from server. T
235
238
Console.ReadLine();
236
239
```
237
240
238
-
Where `GetSignalRInfo` retrieves via a `Get` operation the `SignalR Info` from a Function also defined in the `Trips Function App`:
241
+
Where `GetSignalRInfo` retrieves via a `Get` operation the `SignalR Info` from a Function also defined in the `Trips Function App`. Notice that the `SignalRConnectionInfo` binding contains a `HubName` parameter to define the SignalR hub, and a `UserId` parameter that defines the request header value used to retrieve the requestor's User ID value. When you pass a User ID to this method, then you are able to target messages just to that user so it doesn't appear for all users. This is useful when sending trip-related messages, as you would not want those to display on every user's screen.
0 commit comments