Call recording: Bring your own Azure storage quickstart
Important
Functionality described on this section is currently in private preview. Private preview includes access to SDKs and documentation for testing purposes that are not yet available publicly. Apply to become an early adopter by filling out the form for preview access to Azure Communication Services.
This quickstart gets you started with Bring your own Azure storage for Call Recording. To start using Bring your own Azure Storage functionality, make sure you're familiar with the Call Recording APIs.
You need to be part of the Azure Communication Services TAP program. It's likely that you’re already part of this program, and if you aren't, sign-up using https://aka.ms/acs-tap-invite. Bring your own Azure Storage uses Managed Identities, to access to this functionality for Call Recording, submit your Azure Communication Services Resource IDs by filling this - Registration form. You need to fill the form every time you need a new resource ID allow-listed.
Pre-requisite: Setting up Managed Identity and RBAC role assignments
1. Enable system assigned managed identity for Azure Communication Services
- Open your Azure Communication Services resource. Navigate to Identity on the left.
- System Assigned Managed Identity is disabled by default. Enable it and click on Save
- Once completed, you're able to see the Object principal ID of the newly created identity.
- Now that identity has been successfully created, click on Azure role assignments to start adding role assignments.
2. Add role assignment
- Click on "Add role assignment"
- On the "Add role assignment" panel, select the following values
- Scope: Storage
- Subscription: Choose your subscription
- Resource: Choose your storage account
- Role: Azure Communication Services needs "Storage Blob Data Contributor" to be able to write to your storage account.
- Click on "Save".
- Once completed, you see the newly added role assignment in the "Azure role assignment" window.
Start recording session with external storage specified
Use the server call ID received during initiation of the call.
Using Azure blob storage for external storage
StartRecordingOptions recordingOptions = new StartRecordingOptions(new ServerCallLocator("<serverCallId>"))
{
//...
ExternalStorage = new BlobStorage(new Uri("<Insert Container / Blob Uri>"))
};
Response<RecordingStateResult> startRecordingWithResponse = await callAutomationClient.GetCallRecording()
.StartRecordingAsync(options: recordingOptions);
Using Azure blob storage for external storage
StartRecordingOptions recordingOptions = new StartRecordingOptions(new ServerCallLocator("<serverCallId>"))
.setExternalStorage(new BlobStorage("<Insert Container / Blob Uri>"));
Response<StartCallRecordingResult> response = callAutomationClient.getCallRecording()
.startRecordingWithResponse(recordingOptions, null);
Notification on successful export
Use an Azure Event Grid web hook, or other triggered action, to notify your services when the recorded media is ready and have been exported to the external storage location.
Refer to this example of the event schema.
{
"id": "string", // Unique guid for event
"topic": "string", // /subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}
"subject": "string", // /recording/call/{call-id}/serverCallId/{serverCallId}
"data": {
"storageType": "string", // acsstorage, blobstorage etc.
"recordingId": "string", // unique id for recording
"recordingStorageInfo": {
"recordingChunks": [
{
"documentId": "string", // Document id for for the recording chunk
"contentLocation": "string", //Azure Communication Services URL where the content is located
"metadataLocation": "string", // Azure Communication Services URL where the metadata for this chunk is located
"deleteLocation": "string", // Azure Communication Services URL to use to delete all content, including recording and metadata.
"index": "int", // Index providing ordering for this chunk in the entire recording
"endReason": "string", // Reason for chunk ending: "SessionEnded", "ChunkMaximumSizeExceeded”, etc.
}
]
},
"recordingStartTime": "string", // ISO 8601 date time for the start of the recording
"recordingDurationMs": "int", // Duration of recording in milliseconds
"sessionEndReason": "string" // Reason for call ending: "CallEnded", "InitiatorLeft”, etc.
},
"eventType": "string", // "Microsoft.Communication.RecordingFileStatusUpdated"
"dataVersion": "string", // "1.0"
"metadataVersion": "string", // "1"
"eventTime": "string" // ISO 8601 date time for when the event was created
}
Next steps
For more information, see the following articles:
- Download our Java call recording sample app
- Learn more about Call Recording
- Learn more about Call Automation
Feedback
Submit and view feedback for