Skip to content

Commit 5e30740

Browse files
author
Jill Grant
authored
Merge pull request #236449 from dlepow/dapr
[APIM] Enable Dapr support - SHGW
2 parents 2ac03f9 + 50498f4 commit 5e30740

File tree

6 files changed

+52
-10
lines changed

6 files changed

+52
-10
lines changed

articles/api-management/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@
206206
href: how-to-configure-cloud-metrics-logs.md
207207
- name: Configure local metrics and logs for self-hosted gateway
208208
href: how-to-configure-local-metrics-logs.md
209+
- name: Enable Dapr support on self-hosted gateway
210+
href: self-hosted-gateway-enable-dapr.md
209211
- name: Guidance for running on Kubernetes
210212
href: how-to-self-hosted-gateway-on-kubernetes-in-production.md
211213
- name: Migrate to self-hosted gateway v2

articles/api-management/invoke-dapr-binding-policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.author: danlep
1414

1515
The `invoke-dapr-binding` policy instructs API Management gateway to trigger an outbound Dapr [binding](https://github.com/dapr/docs/blob/master/README.md). The policy accomplishes that by making an HTTP POST request to `http://localhost:3500/v1.0/bindings/{{bind-name}},` replacing the template parameter and adding content specified in the policy statement.
1616

17-
The policy assumes that Dapr runtime is running in a sidecar container in the same pod as the gateway. Dapr runtime is responsible for invoking the external resource represented by the binding. Learn more about [Dapr integration with API Management](api-management-dapr-policies.md).
17+
The policy assumes that Dapr runtime is running in a sidecar container in the same pod as the gateway. Dapr runtime is responsible for invoking the external resource represented by the binding. Learn more about [Dapr integration with API Management](self-hosted-gateway-enable-dapr.md).
1818

1919
[!INCLUDE [api-management-policy-generic-alert](../../includes/api-management-policy-generic-alert.md)]
2020

@@ -58,7 +58,7 @@ The policy assumes that Dapr runtime is running in a sidecar container in the sa
5858

5959
### Usage notes
6060

61-
Dapr support must be [enabled](api-management-dapr-policies.md#enable-dapr-support-in-the-self-hosted-gateway) in the self-hosted gateway.
61+
Dapr support must be [enabled](self-hosted-gateway-enable-dapr.md) in the self-hosted gateway.
6262

6363

6464
## Example

articles/api-management/publish-to-dapr-policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.author: danlep
1414

1515
The `publish-to-dapr` policy instructs API Management gateway to send a message to a Dapr Publish/Subscribe topic. The policy accomplishes that by making an HTTP POST request to `http://localhost:3500/v1.0/publish/{{pubsub-name}}/{{topic}}`, replacing template parameters and adding content specified in the policy statement.
1616

17-
The policy assumes that Dapr runtime is running in a sidecar container in the same pod as the gateway. Dapr runtime implements the Pub/Sub semantics. Learn more about [Dapr integration with API Management](api-management-dapr-policies.md).
17+
The policy assumes that Dapr runtime is running in a sidecar container in the same pod as the gateway. Dapr runtime implements the Pub/Sub semantics. Learn more about [Dapr integration with API Management](self-hosted-gateway-enable-dapr.md).
1818

1919
[!INCLUDE [api-management-policy-generic-alert](../../includes/api-management-policy-generic-alert.md)]
2020

@@ -47,7 +47,7 @@ The policy assumes that Dapr runtime is running in a sidecar container in the sa
4747

4848
### Usage notes
4949

50-
Dapr support must be [enabled](api-management-dapr-policies.md#enable-dapr-support-in-the-self-hosted-gateway) in the self-hosted gateway.
50+
Dapr support must be [enabled](self-hosted-gateway-enable-dapr.md) in the self-hosted gateway.
5151

5252
## Example
5353

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Enable Dapr support in self-hosted gateway | Azure API Management
3+
description: Learn now to enable Dapr support in the self-hosted gateway of Azure API Management to expose and manage Dapr microservices as APIs.
4+
services: api-management
5+
author: dlepow
6+
7+
ms.service: api-management
8+
ms.topic: article
9+
ms.date: 05/01/2023
10+
ms.author: danlep
11+
---
12+
13+
# Enable Dapr support in the self-hosted gateway
14+
15+
Dapr integration in API Management enables operations teams to directly expose Dapr microservices deployed on Kubernetes clusters as APIs, and make those APIs discoverable and easily consumable by developers with proper controls across multiple Dapr deployments—whether in the cloud, on-premises, or on the edge.
16+
17+
## About Dapr
18+
19+
Dapr is a portable runtime for building stateless and stateful microservices-based applications with any language or framework. It codifies the common microservice patterns, like service discovery and invocation with build-in retry logic, publish-and-subscribe with at-least-once delivery semantics, or pluggable binding resources to ease composition using external services. Go to [dapr.io](https://dapr.io) for detailed information and instruction on how to get started with Dapr.
20+
21+
## Enable Dapr support
22+
23+
To turn on Dapr support in the API Management self-hosted gateway, add the following [Dapr annotations](https://docs.dapr.io/reference/arguments-annotations-overview/) to the [Kubernetes deployment template](how-to-deploy-self-hosted-gateway-kubernetes.md), replacing `app-name` with a desired name. A complete walkthrough of setting up and using API Management with Dapr is available [here](https://aka.ms/apim/dapr/walkthru).
24+
25+
```yml
26+
template:
27+
metadata:
28+
labels:
29+
app: app-name
30+
annotations:
31+
dapr.io/enabled: "true"
32+
dapr.io/app-id: "app-name"
33+
```
34+
> [!TIP]
35+
> You can also deploy the [self-hosted gateway with Helm](how-to-deploy-self-hosted-gateway-kubernetes-helm.md) and use the Dapr configuration options.
36+
37+
## Dapr integration policies
38+
39+
API Management provides specific [policies](api-management-policies.md#dapr-integration-policies) to interact with Dapr APIs exposed through the self-hosted gateway.
40+
41+
## Next steps
42+
43+
* Learn more about [Dapr integration in API Management](https://cloudblogs.microsoft.com/opensource/2020/09/22/announcing-dapr-integration-azure-api-management-service-apim/)

articles/api-management/self-hosted-gateway-settings-reference.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,4 @@ helm install azure-api-management-gateway \
104104
- [Deploy self-hosted gateway to Docker](how-to-deploy-self-hosted-gateway-docker.md)
105105
- [Deploy self-hosted gateway to Kubernetes](how-to-deploy-self-hosted-gateway-kubernetes.md)
106106
- [Deploy self-hosted gateway to Azure Arc-enabled Kubernetes cluster](how-to-deploy-self-hosted-gateway-azure-arc.md)
107-
108-
109-
110-
107+
- [Enable Dapr support on self-hosted gateway](self-hosted-gateway-enable-dapr.md)

articles/api-management/set-backend-service-dapr-policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.author: danlep
1414

1515
The `set-backend-service` policy sets the target URL for the current request to `http://localhost:3500/v1.0/invoke/{app-id}[.{ns-name}]/method/{method-name}`, replacing template parameters with values specified in the policy statement.
1616

17-
The policy assumes that Dapr runs in a sidecar container in the same pod as the gateway. Upon receiving the request, Dapr runtime performs service discovery and actual invocation, including possible protocol translation between HTTP and gRPC, retries, distributed tracing, and error handling. Learn more about [Dapr integration with API Management](api-management-dapr-policies.md).
17+
The policy assumes that Dapr runs in a sidecar container in the same pod as the gateway. Upon receiving the request, Dapr runtime performs service discovery and actual invocation, including possible protocol translation between HTTP and gRPC, retries, distributed tracing, and error handling. Learn more about [Dapr integration with API Management](self-hosted-gateway-enable-dapr.md).
1818

1919
[!INCLUDE [api-management-policy-generic-alert](../../includes/api-management-policy-generic-alert.md)]
2020

@@ -41,7 +41,7 @@ The policy assumes that Dapr runs in a sidecar container in the same pod as the
4141

4242
### Usage notes
4343

44-
Dapr support must be [enabled](api-management-dapr-policies.md#enable-dapr-support-in-the-self-hosted-gateway) in the self-hosted gateway.
44+
Dapr support must be [enabled](self-hosted-gateway-enable-dapr.md) in the self-hosted gateway.
4545

4646
## Example
4747

0 commit comments

Comments
 (0)