Skip to content

Commit 5b2a88e

Browse files
committed
chore: adding more infos about azure function integration in landingzones
1 parent 95d4956 commit 5b2a88e

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

docs/integrations/azure/landing-zones.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,38 +171,56 @@ In order for meshStack to fetch the right token, it needs to know the unique ID
171171

172172
#### Required Platform Configuration
173173

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+
174179
In order to make an Azure Function only accessible via the replicator's Service Principal, follow these steps:
175180

176181
> 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.
177182
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.
179184

180185
![System assigned identity](/assets/azure_function/system-assigned-identity.png)
181186

187+
> **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+
182195
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.
183196

184197
![Assigned users only](/assets/azure_function/assigned-users.png)
185198

186-
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. Create a custom Application Role in the Enterprise Application manifest. This role will allow the replicator Service Principal to authenticate and invoke your function.
200+
201+
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):
187202

188203
```json
189204
{
190205
"allowedMemberTypes": [
191206
"Application"
192207
],
193-
"description": "Allows an SPP to get a token to a restricted application",
208+
"description": "Allows the replicator Service Principal to invoke this Azure Function",
194209
"displayName": "SPP-Access",
195-
"id": "<RANDOM_UUID>",
210+
"id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
196211
"isEnabled": true,
197-
"lang": null,
198-
"origin": "Application",
199212
"value": "Access"
200213
}
201214
```
202215

216+
> **Note:** Replace the `id` value with a newly generated UUID/GUID. You can generate one using:
217+
> - PowerShell: `New-Guid`
218+
> - Linux/Mac: `uuidgen`
219+
> - Online UUID generator: https://www.uuidgenerator.net/
220+
203221
![App Role Manifest](/assets/azure_function/app-role-manifest.png)
204222

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.
223+
4. Grant the replicator Service Principal permission to use the Application Role you just created. Open the **App Registration** for your **replicator Service Principal**, navigate to `API permissions`, and add the Application Role you created in step 3 (e.g., `SPP-Access` if you used that name). Don't forget to grant admin consent afterwards.
206224

207225
![Assign the Application Role to SP](/assets/azure_function/sp-role.png)
208226

0 commit comments

Comments
 (0)