Native Microsoft Teams Integration
Requirements
Admin-level access to MS Teams PowerShell
Admin-level access to Microsoft Azure CLI.
Imagicle specific Main Application ID and Pair Application ID for your Region, to be requested to Imagicle team
Procedure
MS-Teams Tenant Onboarding
First of all, you need to onboard your MS-Teams Tenant, by performing the procedure highlighted in this KB article.
After having onboarded your Tenant, Imagicle team is going to verify collected data and, if everything is correct, initiates the deployment process of the Cloud UCX Suite instance.
In the meantime, you can proceed with the following configurations, to be applied from PowerShell.
Azure App Installation
Please run PowerShell as Administrator on your Windows workstation and login to Azure. If the command fails, make sure you have installed Azure Command Line Interface (CLI) package. You can install it by running this PS command:
winget install --exact --id Microsoft.AzureCLI
If Azure CLI is installed, you can login to Azure by using this command:
az login
Alternatively, you can also login without a valid Azure subscription:
az login -–allow-no-subscriptions

When asked to choose the subscription, just hit enter.
Enter this command:
az ad sp create --id $ApplicationId
where $ApplicationId
is the MAIN AppID provided by Imagicle.
Now repeat same command, using PAIR AppID:
az ad sp create --id $ApplicationIdPair
Admin Consent
MAIN Admin Consent
Now launch a web browser in private “incognito” mode and enter the following web URL:
https://login.microsoftonline.com/$TenantId/v2.0/adminconsent?client_id=$ApplicationId&scope=https://graph.microsoft.com/.default
$TenantId
is the customer’s Microsoft Tenant ID.$ApplicationId
is the MAIN AppID provided by Imagicle.
You are prompted to login through the same Global Admin account used for Onboarding.
Once logged in, you get the following window where you are requested to authorize Imagicle to access:
Audio streams from an ongoing call
Join a Group Call
Read all users' profiles
Sign in and read user’s profile

URL is redirected to Imagicle web site. Please check that new URL includes the statement admin_consent=True
, meaning the permissions have been granted. See below:

PAIR Admin Consent
Launch again the browser in private “incognito” mode and enter the following web URL:
https://login.microsoftonline.com/$TenantId/v2.0/adminconsent?client_id=$ApplicationIdPair&scope=https://graph.microsoft.com/.default
$TenantId
is the customer’s Microsoft Tenant ID$ApplicationIdPair
is the PAIR AppID provided by Imagicle.
You are prompted to login through the same Global Admin account used for Onboarding.
Once logged in, you get the following window where you are requested to authorize Imagicle to access:
Audio streams from an ongoing call
Join a Group Call
Read all users' profiles
Sign in and read user’s profile

URL is redirected to Imagicle web site. Please check that new URL includes the statement admin_consent=True
, meaning the permissions have been granted. See below:

Application Instance & Policy Recording
Open PowerShell and connect to Microsoft Teams using the command:
Connect-MicrosoftTeams
Configurations for MAIN Imagicle Application
Enter the following PowerShell commands replacing the variables as described below::
$AppInstance = New-CsOnlineApplicationInstance -UserPrincipalName $VirtualUser -ApplicationId $ApplicationId -DisplayName $AppName
$VirtualUser
should be a new unique UPN within your Tenant. As a guideline, Imagicle suggests to enter a username like "imagicle_call_recording@yourdomain.com". You can't use an existing UPN associated to an MS Teams user.$ApplicationId
is the MAIN AppID provided by Imagicle.$AppName
is a name of your choice, like “ImagicleCallRecording”
New-CsOnlineApplicationInstance
command might fail with an error (read here for more details). Please make sure the user is associated to an online MS-Teams Tenant.
Now proceed with next command (no need to replace anything, just copy-paste and run it):
Sync-CsOnlineApplicationInstance -ObjectId $AppInstance.ObjectId -ApplicationId $AppInstance.ApplicationId
If the operation results in a “NoContent” error, just ignore it.
Now it is time to create a new Compliance Recording Policy:
New-CsTeamsComplianceRecordingPolicy -Identity imagicle_rec -Enable $true

Next command creates a Recording Application, coupling recording policy to the Application Instance previously created:
New-CsTeamsComplianceRecordingApplication -Identity ("Tag:imagicle_rec/" + $AppInstance.ObjectId) -RequiredBeforeCallEstablishment $False -RequiredDuringCall $False -RequiredBeforeMeetingJoin $False -RequiredDuringMeeting $False

Configurations for PAIR Imagicle Application
Enter the following PowerShell commands replacing the variables as described below:
$AppInstancePair = New-CsOnlineApplicationInstance -UserPrincipalName $VirtualUserPair -ApplicationId $ApplicationIdPair -DisplayName $AppNamePair
$VirtualUserPair
should be a new unique UPN within your Tenant. As a guideline, Imagicle suggests to enter a username like "imagicle_call_recordingHA@yourdomain.com". You can't use an existing UPN associated to an MS Teams user.$ApplicationIdPair
is the PAIR AppID provided by Imagicle.$AppNamePair
is a name of your choice, like “ImagicleCallRecordingHA”
Now proceed with next command:
Sync-CsOnlineApplicationInstance -ObjectId $AppInstancePair.ObjectId -ApplicationId $AppInstancePair.ApplicationId
Now it is time to create a new Compliance Recording Policy:
New-CsTeamsComplianceRecordingPolicy -Identity imagicle_recHA -Enable $true
Next command creates a Recording Application:
New-CsTeamsComplianceRecordingApplication -Identity ("Tag:imagicle_recHA/" + $AppInstancePair.ObjectId) -RequiredBeforeCallEstablishment $False -RequiredDuringCall $False -RequiredBeforeMeetingJoin $False -RequiredDuringMeeting $False

Application Pairing
Please enter the following command to pair both Recording Applications to Imagicle Application:
Set-CsTeamsComplianceRecordingApplication -Identity ("Tag:imagicle_rec/" + $AppInstance.ObjectId) -ComplianceRecordingPairedApplications @(New-CsTeamsComplianceRecordingPairedApplication -Id $AppInstancePair.ObjectId)

Grant Recording Enablement to MS-Teams users
Now it's time to assign newly defined Recording Policies to a Call Recording user, by executing the following commands as many times as the number of users to enable:
Grant-CsTeamsComplianceRecordingPolicy -Identity $UserUPN -PolicyName imagicle_rec
$UserUPN
is the MS Teams user’s UPN and it is case-sensitive!
If you wish to disable the audio prompt to notify remote party about ongoing audio recording, please execute the following command:
Set-CsTeamsComplianceRecordingPolicy -Identity $UserUPN -DisableComplianceRecordingAudioNotificationForCalls $true
$UserUPN
is the MS Teams user’s UPN
Once done, you can double check proper Recording Policy association to a user by issuing the following command:
Get-CsOnlineUser $UserUPN | ft sipaddress, tenantid, TeamsComplianceRecordingPolicy
Configurations from Imagicle UCX Cloud Platform web portal
Imagicle team creates a local service user account with username=msrecorder
. This account is used to retrieve recording audio streams from MS-Teams cloud.
Please make sure you are not deleting or changing the password for that user without notifying Imagicle
Make sure that the users on the Imagicle UCX Suite web portal have set "PBX username" field with user’s UPN (same as "email" field), in each Imagicle recording-enabled user.
Imagicle App for MS Teams client/web/mobile
Imagicle provide an app for MS-Teams client. Please follow this link for the configuration.