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: docs/integrations/azure/landing-zones.md
+76-8Lines changed: 76 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,41 +171,109 @@ In order for meshStack to fetch the right token, it needs to know the unique ID
171
171
172
172
#### Required Platform Configuration
173
173
174
+
Before configuring Azure Function invocation, ensure you have:
175
+
- An Azure Function App deployed and running
176
+
- The meshStack replicator Service Principal already created in your Azure tenant
177
+
- Appropriate permissions to modify Enterprise Applications and API permissions in Azure
178
+
174
179
In order to make an Azure Function only accessible via the replicator's Service Principal, follow these steps:
175
180
176
181
> If these steps are automated via Terraform you end up with a non working Azure Function. Until Terraform solves this problem, please perform the setup steps manually in the Azure panel.
177
182
178
-
1. Create a SAMI or UAMI for your function (this is only required if you need the function to have permissions for Azure based resources like starting VMs, connecting Log Workspaces etc).
183
+
1. Create a SAMI or UAMI for your function. This managed identity is used by the function to authenticate and perform operations on Azure resources.
> **Important:** After creating the managed identity, assign it the necessary Azure RBAC permissions based on what your function needs to do. Common permissions include:
188
+
> -`Contributor` or `Owner` role on the target subscription or resource group (if the function creates or modifies resources)
189
+
> -`User Access Administrator` role (if the function assigns RBAC roles to users or groups)
190
+
> - Specific permissions like `Microsoft.Resources/tags/write` for tagging operations
191
+
> -`Reader` role at minimum for read-only operations
192
+
>
193
+
> You can assign these roles in the Azure Portal under the subscription's or resource group's "Access control (IAM)" section, using the managed identity's Object ID.
194
+
182
195
2. Lock down your function to only allow assigned users in the `Properties` section of the Enterprise Application created for the SAMI or UAMI in step 1.
3. Modify the Manifest of the Enterprise Application from step 2. Create a custom [Application Role](https://docs.microsoft.com/en-us/azure/architecture/multitenant-identity/app-roles). It's only possible to assign real users and unfortunatly no Service Principals directly to the function so this additional steps are required. Edit the Application Roles manifest like in this JSON:
199
+
3. Configure the Function App's Authentication to allow the replicator Service Principal.
200
+
201
+
a. Go to your Function App → **Authentication**
202
+
203
+
b. Click on the Microsoft identity provider to edit it
204
+
205
+
c. Under **Additional checks** section, find **Client application requirement**
206
+
207
+
d. Select **"Allow requests from specific client applications"**
208
+
209
+
e. Click **+ Add allowed client application**
210
+
211
+
f. Enter the **Application (client) ID** of your meshStack replicator Service Principal
212
+
- You can find this in **Microsoft Entra ID** → **App registrations** → your replicator SP → **Overview** → **Application (client) ID**
213
+
214
+
g. Click **Add** and then **Save** the authentication configuration
215
+
216
+
> **Note:** This step is critical. Without adding the replicator's client ID to the allowed applications list, you will receive a 403 Forbidden error when meshStack attempts to invoke the function, even if all other permissions are correctly configured.
217
+
218
+
4. Create a custom Application Role in the Enterprise Application manifest. This role will allow the replicator Service Principal to authenticate and invoke your function.
219
+
220
+
In the Enterprise Application from step 2, navigate to the Manifest and add a new entry to the `appRoles` array. You can choose any name for the `displayName` and `value` fields (we use "SPP-Access" and "Access" as examples here):
187
221
188
222
```json
189
223
{
190
224
"allowedMemberTypes": [
191
225
"Application"
192
226
],
193
-
"description": "Allows an SPP to get a token to a restricted application",
227
+
"description": "Allows the replicator Service Principal to invoke this Azure Function",
194
228
"displayName": "SPP-Access",
195
-
"id": "<RANDOM_UUID>",
229
+
"id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
196
230
"isEnabled": true,
197
-
"lang": null,
198
-
"origin": "Application",
199
231
"value": "Access"
200
232
}
201
233
```
202
234
235
+
> **Note:** Replace the `id` value with a newly generated UUID/GUID. You can generate one using:

204
241
205
-
4. Now modify the API permissions of the **App Registration** belonging to the **replicator Service Principal**. This will allow meshStack's replicator to invoke the Azure Function. Open the `API permissions` screen and add the newly created `SPP-Access` Application Role. Don't forget to grant admin consent again afterwards.
242
+
5. Grant the replicator Service Principal permission to use the Application Role you just created.
243
+
244
+
**What you're doing:** Allowing the meshStack replicator to call your Azure Function by granting it the Application Role you created.
245
+
246
+
**Detailed steps:**
247
+
248
+
a. First, get your Function App's Application ID:
249
+
- Go to **Microsoft Entra ID** → **Enterprise Applications**
250
+
- Search for your Function App name
251
+
- Click on it → **Properties**
252
+
- Copy the **Application ID** (you'll need this in step d)
253
+
254
+
b. Navigate to your replicator's App Registration:
255
+
- Go to **Microsoft Entra ID** → **App registrations**
256
+
- Find and click on your **meshStack replicator Service Principal**
257
+
258
+
c. Add API permissions:
259
+
- Click **API permissions** (left menu)
260
+
- Click **+ Add a permission**
261
+
- Click the **APIs my organization uses** tab
262
+
- **Paste the Application ID** you copied in step (a) into the search box
263
+
- Click on your Function App when it appears
264
+
265
+
d. Select your Application Role:
266
+
- You should now see **Application permissions** section
267
+
- Check the box next to the role you created in step 4 (e.g., "SPP-Access" or whatever name you chose)
268
+
- Click **Add permissions**
269
+
270
+
e. Grant admin consent:
271
+
- Back in the API permissions screen, click **Grant admin consent for [your tenant]**
272
+
- Click **Yes** to confirm
273
+
- Verify the status shows a green checkmark
206
274
207
275

208
276
209
-
5. _Optional_ In case you see an authorization error when the replicator wants to invoke the function try to set `"accessTokenAcceptedVersion" : "2"` in the app registration manifests of the replicator service principal and the app registration manifest of the Azure Function.
277
+
6. _Optional_ In case you see an authorization error when the replicator wants to invoke the function try to set `"accessTokenAcceptedVersion" : "2"` in the app registration manifests of the replicator service principal and the app registration manifest of the Azure Function.
210
278
211
279
After these steps, the meshStack replicator should be able to fetch a token scoped to this Application Role so it can invoke the Azure Function using App Authentication.
0 commit comments