Skip to content

Commit 0907711

Browse files
committed
edits
1 parent e76b28e commit 0907711

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

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

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ First, create a container apps environment using the [az containerapp env create
4949

5050
# [Bash](#tab/bash)
5151
```azurecli-interactive
52+
#!/bin/bash
5253
az containerapp env create --name my-environment --resource-group myResourceGroup \
5354
--location centralus
5455
```
5556

5657
# [PowerShell](#tab/psh)
5758
```azurecli
59+
# PowerShell syntax
5860
az containerapp env create --name my-environment --resource-group myResourceGroup `
5961
--location centralus
6062
```
@@ -73,14 +75,12 @@ First set variables for the **Token** and **Configuration endpoint** values from
7375
# [Bash](#tab/bash)
7476
```azurecli-interactive
7577
#!/bin/bash
76-
7778
endpoint="<API Management configuration endpoint>"
7879
token="<API Management gateway token>"
7980
```
8081
# [PowerShell](#tab/psh)
8182
```azurecli
8283
# PowerShell syntax
83-
8484
$endpoint="<API Management configuration endpoint>"
8585
$token="<API Management gateway token>"
8686
```
@@ -90,6 +90,7 @@ Create the container app using the `az containerapp create` command:
9090

9191
# [Bash](#tab/bash)
9292
```azurecli-interactive
93+
#!/bin/bash
9394
az containerapp create --name my-gateway \
9495
--resource-group myResourceGroup --environment 'my-environment' \
9596
--image "mcr.microsoft.com/azure-api-management/gateway:2.5.0" \
@@ -100,11 +101,12 @@ az containerapp create --name my-gateway \
100101

101102
# [PowerShell](#tab/psh)
102103
```azurecli
103-
az containerapp create --name my-gateway \
104-
--resource-group myResourceGroup --environment 'my-environment' \
105-
--image "mcr.microsoft.com/azure-api-management/gateway:2.5.0" \
106-
--target-port 8080 --ingress external \
107-
--min-replicas 1 --max-replicas 3 \
104+
# PowerShell syntax
105+
az containerapp create --name my-gateway `
106+
--resource-group myResourceGroup --environment 'my-environment' `
107+
--image "mcr.microsoft.com/azure-api-management/gateway:2.5.0" `
108+
--target-port 8080 --ingress external `
109+
--min-replicas 1 --max-replicas 3 `
108110
--env-vars "config.service.endpoint"="$endpoint" "config.service.auth"="$token" "net.server.http.forwarded.proto.enabled"="true"
109111
```
110112
---
@@ -113,7 +115,7 @@ This command creates:
113115
* A container app named `my-gateway` in the `myResourceGroup` resource group. In this example, the container app is created using the `mcr.microsoft.com/azure-api-management/gateway:2.5.0` image. Learn more about the self-hosted gateway [container images](self-hosted-gateway-overview.md#packaging).
114116
* Support for external ingress to the container app on port 8080.
115117
* A minimum of 1 and a maximum of 3 replicas of the container app.
116-
* A connection from the self-hosted gateway to the API Management instance using configuration values passed in environment variables. For details, see [self-hosted gateway container configuration settings](self-hosted-gateway-settings-reference.md.).
118+
* A connection from the self-hosted gateway to the API Management instance using configuration values passed in environment variables. For details, see the self-hosted gateway [container configuration settings](self-hosted-gateway-settings-reference.md).
117119

118120
### Confirm that the container app is running
119121

@@ -136,7 +138,7 @@ This command creates:
136138
1. In the left menu, under **Deployment and infrastructure**, select **Gateways**.
137139
1. Check the **Status** of your gateway. If the gateway is healthy, it reports regular gateway heartbeats.
138140

139-
:::image type="content" source="media/how-to-deploy-self-hosted-gateway-container-apps/gateway-heartbeat.png" alt-text="Screenshot of gateway status in the portal.":::
141+
:::image type="content" source="media/how-to-deploy-self-hosted-gateway-container-apps/gateway-heartbeat.png" alt-text="Screenshot of gateway status in the portal." lightbox="media/how-to-deploy-self-hosted-gateway-container-apps/gateway-heartbeat.png":::
140142

141143
## Example scenario
142144

@@ -146,7 +148,7 @@ The following example shows how you can use the self-hosted gateway to access an
146148

147149
* **Step 1.** Deploy a container app hosting an API in the same environment as the self-hosted gateway
148150
* **Step 2.** Add the API to your API Management instance
149-
* **Step 4.** Call the API through the self-hosted gateway
151+
* **Step 3.** Call the API through the self-hosted gateway
150152

151153
### Step 1. Deploy a container app hosting an API in the same environment as the self-hosted gateway
152154

@@ -198,15 +200,27 @@ The following are example steps to add an API to your API Management instance an
198200
1. **URL**: Select **Get** and enter `/albums` for the endpoint.
199201
1. Select **Save**.
200202

201-
### Step 4. Call the API through the self-hosted gateway
203+
### Step 3. Call the API through the self-hosted gateway
202204

203205
Call the API using the FQDN of the self-hosted gateway running in the container app. Find the FQDN on the container app's **Overview** page in the Azure portal, or run the following `az containerapp show` command.
204206
207+
# [Bash](#tab/bash)
208+
205209
```azurecli-interactive
210+
#!/bin/bash
206211
az containerapp show ----name my-gateway --resource-group myResourceGroup \
207212
--query "properties.configuration.ingress.fqdn" --output tsv
208213
```
209214
215+
# [PowerShell](#tab/psh)
216+
```azurecli
217+
# PowerShell syntax
218+
az containerapp show ----name my-gateway --resource-group myResourceGroup `
219+
--query "properties.configuration.ingress.fqdn" --output tsv
220+
```
221+
---
222+
223+
210224
For example, use the following `curl` command to call the API at the `/albumapi/albums` endpoint. If your API requires a subscription key, pass a valid subscription key for your API Management instance as a header in the request:
211225
212226
```bash
-1.35 KB
Loading

0 commit comments

Comments
 (0)