Skip to content

Add script to assign Managed Identity to Maestro app#5427

Merged
premun merged 5 commits intomainfrom
premun-patch-1
Nov 4, 2025
Merged

Add script to assign Managed Identity to Maestro app#5427
premun merged 5 commits intomainfrom
premun-patch-1

Conversation

@premun
Copy link
Copy Markdown
Member

@premun premun commented Nov 4, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 4, 2025 13:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new PowerShell script for assigning managed identities to the Maestro application with specific roles. The script automates the process of granting user or admin roles to Azure Managed Identities by creating app role assignments via the Microsoft Graph API.

  • Adds a script to assign managed identities user or admin roles in the Maestro application
  • Uses Azure CLI and PowerShell Az modules to interact with Azure and Microsoft Graph
  • Supports both user and admin role assignments with hardcoded role IDs

Comment thread eng/assign-managed-identity-to-maestro-app.ps1 Outdated
Comment thread eng/assign-managed-identity-to-maestro-app.ps1
Comment thread eng/assign-managed-identity-to-maestro-app.ps1
Comment thread eng/assign-managed-identity-to-maestro-app.ps1 Outdated
Comment thread eng/assign-managed-identity-to-maestro-app.ps1
[string]$ManagedIdentityName,

[Parameter(Mandatory = $false)]
[string]$AppServicePrincipal = "caf36d9b-2940-4270-9a1d-c494eda6ea18", # Maestro application object ID
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the prod one? Maybe we should say that in the comment and also provide the staging one, so we don't have to look for it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess then we'd have a different user and admin role ID too tho

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probs just fetch role ID same way we fetch principal ID

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how often would assigning MI to staging app be used though

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't have the permissions for that - we need to do that manually from the manifest

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the comments about INT because there the app role IDs would not work anyway

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People can adjust this when using the script, I think

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, it's easy enough to find

Comment thread eng/assign-managed-identity-to-maestro-app.ps1 Outdated
Comment thread eng/assign-managed-identity-to-maestro-app.ps1 Outdated
Comment thread eng/assign-managed-identity-to-maestro-app.ps1 Outdated
@premun premun merged commit 77b45e1 into main Nov 4, 2025
3 of 9 checks passed
@premun premun deleted the premun-patch-1 branch November 4, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants