Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2025-08-17 00:01 | #83 | cancelled |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Clean
|
| 2025-07-09 13:09 | #3 | cancelled |
Clean
|
| 2025-07-08 04:23 | #2 | cancelled |
Biased
|
Get-Module -ListAvailable
Install-Module Microsoft.Entra
Connect-Entra -TenantId <TenantID> -Scopes 'Application.ReadWrite.All'
New-EntraServicePrincipal -AppId eb63d611-525e-4a31-abd7-0cb33f679599 -DisplayName "Operator Connect"
$acgName = "<CommunicationsGatewayName>"
Disconnect-MgGraph
Get-Module -ListAvailable
Install-Module -Name Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Application.Read.All", "AppRoleAssignment.ReadWrite.All" -TenantId "<TenantID>"
# Get the Service Principal ID for Project Synergy (Operator Connect)
$projectSynergyApplicationId = "eb63d611-525e-4a31-abd7-0cb33f679599"
$projectSynergyEnterpriseApplication = Get-MgServicePrincipal -Filter "AppId eq '$projectSynergyApplicationId'" # "Application.Read.All"
# Required Operator Connect - Project Synergy Roles
$trunkManagementRead = "72129ccd-8886-42db-a63c-2647b61635c1"
$trunkManagementWrite = "e907ba07-8ad0-40be-8d72-c18a0b3c156b"
$partnerSettingsRead = "d6b0de4a-aab5-4261-be1b-0e1800746fb2"
$numberManagementRead = "130ecbe2-d1e6-4bbd-9a8d-9a7a909b876e"
$numberManagementWrite = "752b4e79-4b85-4e33-a6ef-5949f0d7d553"
$dataRead = "eb63d611-525e-4a31-abd7-0cb33f679599"
$dataWrite = "98d32f93-eaa7-4657-b443-090c23e69f27"
$requiredRoles = $trunkManagementRead, $trunkManagementWrite, $partnerSettingsRead, $numberManagementRead, $numberManagementWrite, $dataRead, $dataWrite
# Locate the Azure Communications Gateway resource by name
$acgServicePrincipal = Get-MgServicePrincipal -Filter ("displayName eq '$acgName'")
# Assign the required roles to the managed identity of the Azure Communications Gateway resource
$currentAssignments = Get-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $acgServicePrincipal.Id
foreach ($appRoleId in $requiredRoles) {
$assigned = $currentAssignments | Where-Object { $_.AppRoleId -eq $AppRoleId }
if (-not $assigned) {
$params = @{
principalId = $acgServicePrincipal.Id
resourceId = $projectSynergyEnterpriseApplication.Id
appRoleId = $appRoleId
}
New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $acgServicePrincipal.Id -BodyParameter $params
}
}
# Check the assigned roles
Get-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $acgServicePrincipal.Id