@@ -6,7 +6,7 @@ author: greg-lindsay
6
6
ms.service : application-gateway
7
7
ms.custom : devx-track-arm-template, linux-related-content, devx-track-azurecli
8
8
ms.topic : how-to
9
- ms.date : 02/02 /2024
9
+ ms.date : 02/07 /2024
10
10
ms.author : greglin
11
11
---
12
12
@@ -99,8 +99,10 @@ for the AGIC pod to make HTTP requests to [ARM](../azure-resource-manager/manage
99
99
100
100
1. For the role assignment, run the following command to identify the ` principalId` for the newly created identity:
101
101
102
- ` ` ` azurecli
103
- az identity show -g < resourcegroup> -n < identity-name>
102
+ ` ` ` powershell-interactive
103
+ $resourceGroup =" resource-group-name"
104
+ $identityName =" identity-name"
105
+ az identity list -g $resourceGroup --query " [?name == '$identityName '].principalId | [0]" -o tsv
104
106
` ` `
105
107
106
108
1. Grant the identity ** Contributor** access to your Application Gateway. You need the ID of the Application Gateway, which
@@ -112,21 +114,32 @@ looks like: `/subscriptions/A/resourceGroups/B/providers/Microsoft.Network/appli
112
114
113
115
To assign the identity ** Contributor** access, run the following command:
114
116
115
- ` ` ` azurecli
116
- az role assignment create \
117
- --role Contributor \
118
- --assignee < principalId> \
119
- --scope < App-Gateway-ID>
117
+ ` ` ` powershell-interactive
118
+ $resourceGroup =" resource-group-name"
119
+ $identityName =" identity-Name"
120
+ # Get the Application Gateway ID
121
+ $AppGatewayID =$( az network application-gateway list --query ' [].id' -o tsv)
122
+ $role =" contributor"
123
+ # Get the principal ID for the User assigned identity
124
+ $principalId =$( az identity list -g $resourceGroup --query " [?name == '$identityName '].principalId | [0]" -o tsv)
125
+ az role assignment create --assignee $principalId --role $role --scope $AppGatewayID
120
126
` ` `
121
127
122
128
1. Grant the identity ** Reader** access to the Application Gateway resource group. The resource group ID looks like:
123
129
` /subscriptions/A/resourceGroups/B` . You can get all resource groups with: ` az group list --query ' [].id' `
124
130
125
- ` ` ` azurecli
126
- az role assignment create \
127
- --role Reader \
128
- --assignee < principalId> \
129
- --scope < App-Gateway-Resource-Group-ID>
131
+ ` ` ` powershell-interactive
132
+ $resourceGroup =" resource-group-name"
133
+ $identityName =" identity-Name"
134
+ # Get the Application Gateway resource group
135
+ $AppGatewayResourceGroup =$( az network application-gateway list --query ' [].resourceGroup' -o tsv)
136
+ # Get the Application Gateway resource group ID
137
+ $AppGatewayResourceGroupID =$( az group show --name $AppGatewayResourceGroup --query id -o tsv)
138
+ $role =" Reader"
139
+ # Get the principal ID for the User assigned identity
140
+ $principalId =$( az identity list -g $resourceGroup --query " [?name == '$identityName '].principalId | [0]" -o tsv)
141
+ # Assign the Reader role to the User assigned identity at the resource group scope
142
+ az role assignment create --role $role --assignee $principalId --scope $AppGatewayResourceGroupID
130
143
` ` `
131
144
132
145
> [! NOTE]
@@ -152,6 +165,53 @@ next section.
152
165
secretJSON: <Base64-Encoded-Credentials>
153
166
```
154
167
168
+ ## Deploy the Azure Application Gateway Ingress Controller Add-on
169
+ ### Create an Ingress Controller deployment manifest
170
+ ```yaml
171
+ ---
172
+ # file: pet-supplies-ingress.yaml
173
+ apiVersion: networking.k8s.io/v1
174
+ kind: Ingress
175
+ metadata:
176
+ name: pet-supplies-ingress
177
+ annotations:
178
+ kubernetes.io/ingress.class: azure/application-gateway
179
+
180
+ spec:
181
+ rules:
182
+ - http:
183
+ paths:
184
+ - path: /
185
+ pathType: Prefix
186
+ backend:
187
+ service:
188
+ name: store-front
189
+ port:
190
+ number: 80
191
+ - path: /order-service
192
+ pathType: Prefix
193
+ backend:
194
+ service:
195
+ name: order-service
196
+ port:
197
+ number: 3000
198
+ - path: /product-service
199
+ pathType: Prefix
200
+ backend:
201
+ service:
202
+ name: product-service
203
+ port:
204
+ number: 3002
205
+
206
+ ```
207
+ ### Deploy Ingress Controller
208
+
209
+ ```powershell-interactive
210
+ $namespace="namespace"
211
+ $file="pet-supplies-ingress.yaml"
212
+ kubectl apply -f $file -n $namespace
213
+ ```
214
+
155
215
## Install Ingress Controller as a Helm Chart
156
216
157
217
In the first few steps, we install Helm' s Tiller on your Kubernetes cluster. Use [Cloud Shell](https://shell.azure.com/) to install the AGIC Helm package:
0 commit comments