Skip to content

Commit 114924d

Browse files
authored
Merge pull request #311760 from dlepow/shgwauth
[APIM] Workload identity auth for SHGW
2 parents 4af2a10 + d86f123 commit 114924d

16 files changed

Lines changed: 723 additions & 137 deletions

articles/api-management/TOC.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,20 @@
403403
href: how-to-configure-local-metrics-logs.md
404404
- name: Enable Dapr support on self-hosted gateway
405405
href: self-hosted-gateway-enable-dapr.md
406-
- name: Use Microsoft Entra authentication on self-hosted gateway
407-
href: self-hosted-gateway-enable-azure-ad.md
408-
- name: Run self-hosted gateway in production
409-
href: how-to-self-hosted-gateway-on-kubernetes-in-production.md
410-
- name: Self-hosted gateway support policy
411-
href: self-hosted-gateway-support-policies.md
406+
- name: Configure authentication to cloud instance
407+
items:
408+
- name: Self-hosted gateway authentication options
409+
href: self-hosted-gateway-authentication-options.md
410+
- name: Authenticate with Microsoft Entra ID - workload identity
411+
href: self-hosted-gateway-enable-workload-identity.md
412+
- name: Authenticate with Microsoft Entra ID - client secret
413+
href: self-hosted-gateway-enable-azure-ad.md
414+
- name: Authenticate with an access token
415+
href: self-hosted-gateway-default-authentication.md
416+
- name: Run self-hosted gateway in production
417+
href: how-to-self-hosted-gateway-on-kubernetes-in-production.md
418+
- name: Self-hosted gateway support policy
419+
href: self-hosted-gateway-support-policies.md
412420
- name: Developer portal and publishing
413421
items:
414422
- name: Manage users, groups, and subscriptions

articles/api-management/how-to-deploy-self-hosted-gateway-azure-arc.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ description: Enable Azure Arc to deploy your self-hosted Azure API Management ga
44
author: dlepow
55
ms.author: danlep
66
ms.service: azure-api-management
7-
ms.custom: devx-track-azurecli
7+
ms.custom:
8+
- devx-track-azurecli
9+
- references_regions
810
ms.topic: how-to
911
ms.date: 10/06/2025
1012
---
@@ -42,6 +44,8 @@ Deploying the API Management gateway on an Azure Arc-enabled Kubernetes cluster
4244
4345
## Deploy the API Management gateway extension using Azure CLI
4446
47+
[!INCLUDE [api-management-self-hosted-gateway-authentication](../../includes/api-management-self-hosted-gateway-authentication.md)]
48+
4549
1. In the Azure portal, navigate to your API Management instance.
4650
1. Select **Deployment + infrastructure** > **Gateways** from the side navigation menu.
4751
1. Select and open your provisioned gateway resource from the list.
@@ -125,3 +129,4 @@ To enable monitoring of the self-hosted gateway, configure the following Log Ana
125129
* Learn more about [Azure Arc-enabled Kubernetes](/azure/azure-arc/kubernetes/overview).
126130
* Learn more about guidance to [run the self-hosted gateway on Kubernetes in production](how-to-self-hosted-gateway-on-kubernetes-in-production.md).
127131
* For configuration options, see the [self-hosted gateway extension reference](self-hosted-gateway-arc-reference.md).
132+
`

articles/api-management/how-to-deploy-self-hosted-gateway-azure-kubernetes-service.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ This article provides the steps for deploying self-hosted gateway component of A
2525

2626
## Deploy the self-hosted gateway to AKS
2727

28+
[!INCLUDE [api-management-self-hosted-gateway-authentication](../../includes/api-management-self-hosted-gateway-authentication.md)]
29+
2830
1. Select **Gateways** from under **Deployment and infrastructure**.
2931
1. Select the self-hosted gateway resource you intend to deploy.
3032
1. Select **Deployment**.

articles/api-management/how-to-deploy-self-hosted-gateway-kubernetes-helm.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ This article provides the steps for deploying self-hosted gateway component of A
4848
```console
4949
$ helm search repo azure-apim-gateway
5050
NAME CHART VERSION APP VERSION DESCRIPTION
51-
azure-apim-gateway/azure-api-management-gateway 1.0.0 2.0.0 A Helm chart to deploy an Azure API Management ...
51+
azure-apim-gateway/azure-api-management-gateway 1.15.0 2.11.0 A Helm chart to deploy an Azure API Management ...
5252
```
5353

5454
## Deploy the self-hosted gateway to Kubernetes
5555

56+
[!INCLUDE [api-management-self-hosted-gateway-authentication](../../includes/api-management-self-hosted-gateway-authentication.md)]
57+
5658
1. Select **Gateways** from under **Deployment and infrastructure**.
5759
2. Select the self-hosted gateway resource you intend to deploy.
5860
3. Select **Deployment**.
@@ -77,26 +79,6 @@ This article provides the steps for deploying self-hosted gateway component of A
7779
>
7880
> For example, you can expose it through a load balancer by adding `--set service.type=LoadBalancer`
7981
80-
8. Run the following command to check the gateway pod is running. Your pod name will be different.
81-
82-
```console
83-
kubectl get pods
84-
NAME READY STATUS RESTARTS AGE
85-
azure-api-management-gateway-59f5fb94c-s9stz 1/1 Running 0 1m
86-
```
87-
88-
9. Run the following command to check the gateway service is running. Your service name and IP addresses will be different.
89-
90-
```console
91-
kubectl get services
92-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
93-
azure-api-management-gateway ClusterIP 10.0.229.55 <none> 8080/TCP,8081/TCP 1m
94-
```
95-
96-
10. Return to the Azure portal and confirm that gateway node you deployed is reporting healthy status.
97-
98-
> [!TIP]
99-
> Use `kubectl logs <gateway-pod-name>` command to view a snapshot of self-hosted gateway log.
10082

10183
## Related content
10284

articles/api-management/how-to-deploy-self-hosted-gateway-kubernetes-opentelemetry.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ With our OpenTelemetry Collector installed, we can now deploy the self-hosted ga
147147

148148
In this section, we will deploy the self-hosted gateway to our cluster with Helm and configure it to send OpenTelemetry metrics to the OpenTelemetry Collector.
149149

150+
[!INCLUDE [api-management-self-hosted-gateway-authentication](../../includes/api-management-self-hosted-gateway-authentication.md)]
151+
150152
1. Install the Helm chart and configure it to use OpenTelemetry metrics:
151153

152154
```console

articles/api-management/how-to-deploy-self-hosted-gateway-kubernetes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ This article describes the steps for deploying the self-hosted gateway component
3030

3131
## Deploy to Kubernetes
3232

33-
> [!TIP]
34-
> The following steps deploy the self-hosted gateway to Kubernetes and enable authentication to the API Management instance by using a gateway access token (authentication key). You can also deploy the self-hosted gateway to Kubernetes and enable authentication to the API Management instance by using [Microsoft Entra ID](self-hosted-gateway-enable-azure-ad.md).
33+
[!INCLUDE [api-management-self-hosted-gateway-authentication](../../includes/api-management-self-hosted-gateway-authentication.md)]
3534

3635
1. Select **Gateways** under **Deployment and infrastructure**.
3736
1. Select the self-hosted gateway resource that you want to deploy.

articles/api-management/how-to-self-hosted-gateway-on-kubernetes-in-production.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ In order to run the self-hosted gateway in production, there are various aspects
1919

2020
This article provides guidance on how to run [self-hosted gateway](./self-hosted-gateway-overview.md) on Kubernetes for production workloads to ensure that it will run smoothly and reliably.
2121

22-
## Access token
22+
## Authentication
23+
24+
By default, an access token (also called an authentication key) is used by the self-hosted gateway to authenticate with the API Management instance.
25+
2326
Without a valid access token, a self-hosted gateway can't access and download configuration data from the endpoint of the associated API Management service. The access token can be valid for a maximum of 30 days. It must be regenerated, and the cluster configured with a fresh token, either manually or via automation before it expires.
2427

2528
When you're automating token refresh, use [this management API operation](/rest/api/apimanagement/current-ga/gateway/generate-token) to generate a new token. For information on managing Kubernetes secrets, see the [Kubernetes website](https://kubernetes.io/docs/concepts/configuration/secret).
2629

27-
> [!TIP]
28-
> You can also deploy the self-hosted gateway to Kubernetes and enable authentication to the API Management instance by using [Microsoft Entra ID](self-hosted-gateway-enable-azure-ad.md).
30+
You can also deploy the self-hosted gateway to Kubernetes and enable authentication to the API Management instance by using Microsoft Entra ID. For more information and considerations, see [Self-hosted gateway authentication options](self-hosted-gateway-authentication-options.md).
2931

3032
## Autoscaling
3133

@@ -48,7 +50,7 @@ Kubernetes allows you to autoscale the self-hosted gateway based on resource usa
4850
An alternative is to use Kubernetes Event-driven Autoscaling (KEDA) allowing you to scale workloads based on a [variety of scalers](https://keda.sh/docs/latest/scalers/), including CPU and memory.
4951

5052
> [!TIP]
51-
> If you are already using KEDA to scale other workloads, we recommend using KEDA as a unified app autoscaler. If that is not the case, then we strongly suggest to rely on the native Kubernetes functionality through Horizontal Pod Autoscaler.
53+
> If you are already using KEDA to scale other workloads, we recommend using KEDA as a unified app autoscaler. If that is not the case, then we strongly suggest relying on the native Kubernetes functionality through Horizontal Pod Autoscaler.
5254
5355
### Traffic-based autoscaling
5456

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Authentication Options for Self-hosted Gateway - Azure API Management
3+
description: Options for the Azure API Management self-hosted gateway to authenticate to the cloud-based API Management instance.
4+
services: api-management
5+
author: dlepow
6+
7+
ms.service: azure-api-management
8+
ms.topic: concept-article
9+
ms.date: 02/19/2026
10+
ms.author: danlep
11+
---
12+
13+
# Self-hosted gateway authentication options
14+
15+
The gateway container's [configuration settings](self-hosted-gateway-settings-reference.md) provide options for authenticating the connection between the self-hosted gateway and the cloud-based API Management instance's configuration endpoint.
16+
17+
## Options and considerations
18+
19+
The following table lists authentication options for the self-hosted gateway and considerations for each option. The linked articles provide step-by-step instructions for how to configure each authentication method.
20+
21+
|Option |Considerations |
22+
|---------|---------|
23+
| [Microsoft Entra ID workload identity authentication](self-hosted-gateway-enable-workload-identity.md) | No secrets or certificates to manage - uses federated identity credentials.<br/><br/>Automatic token rotation with short-lived tokens.<br/><br/>Native integration with Azure Kubernetes Service. |
24+
| [Microsoft Entra ID authentication with client secret](self-hosted-gateway-enable-azure-ad.md) | Configure Microsoft Entra apps with client secrets or certificates.<br/><br/>Manage access per app with custom role assignments.<br/><br/>Configure secret expiration times per your organization's policies.<br/><br/>Use standard Microsoft Entra procedures to rotate secrets. |
25+
| [Access token](self-hosted-gateway-default-authentication.md) (also called *gateway token* or an *authentication key*) | Token expires at least every 30 days and must be renewed.<br/><br/>Backed by a gateway key that you can rotate independently.<br/><br/>Regenerating the gateway key invalidates all access tokens.<br/><br/>System events are generated when a self-hosted gateway access token is near expiration or expires. |
26+
27+
## Related content
28+
29+
- Learn more about the API Management [self-hosted gateway](self-hosted-gateway-overview.md).
30+
- Learn more about [Microsoft Entra workload identity for AKS](/azure/aks/workload-identity-overview).
31+
- Learn more about guidance for [running the self-hosted gateway on Kubernetes in production](how-to-self-hosted-gateway-on-kubernetes-in-production.md).

0 commit comments

Comments
 (0)