|
| 1 | +--- |
| 2 | +ms.author: dbasantes |
| 3 | +title: Azure Communication Services Call Recording Bring Your Own Storage |
| 4 | +titleSuffix: An Azure Communication Services document |
| 5 | +description: Private Preview quickstart for Bring your own storage |
| 6 | +author: dbasantes |
| 7 | +services: azure-communication-services |
| 8 | +ms.date: 03/17/2023 |
| 9 | +ms.topic: quickstart |
| 10 | +ms.service: azure-communication-services |
| 11 | +ms.subservice: calling |
| 12 | +zone_pivot_groups: acs-csharp-java |
| 13 | +ms.custom: mode-api |
| 14 | +--- |
| 15 | +# Call recording: Bring your own storage quickstart |
| 16 | + |
| 17 | +[!INCLUDE [Private Preview](../../../includes/private-preview-include-section.md)] |
| 18 | + |
| 19 | +This quickstart gets you started with BYOS (Bring your own storage) for Call Recording. To start using BYOS, make sure you're familiar with the [Call Recording APIs](../../voice-video-calling/get-started-call-recording.md). |
| 20 | + |
| 21 | +## Pre-requisite: Setting up Managed Identity and RBAC role assignments |
| 22 | + |
| 23 | +### 1. Enable system assigned managed identity for Azure Communication Services |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +1. Open your Azure Communication Services resource. Navigate to *Identity* on the left. |
| 28 | +2. System Assigned Managed Identity is disabled by default. Enable it and click of *Save* |
| 29 | +3. Once completed, you're able to see the Object principal ID of the newly created identity. |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +4. Now that identity has been successfully created, click on *Azure role assignments* to start adding role assignments. |
| 34 | + |
| 35 | +### 2. Add role assignment |
| 36 | + |
| 37 | +1. Click on *"Add role assignment"* |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +2. On the *"Add role assignment"* panel, select the following values |
| 42 | + 1. Scope: **Storage** |
| 43 | + 2. Subscription: **Choose your subscription** |
| 44 | + 3. Resource: **Choose your storage account** |
| 45 | + 4. Role: **Azure Communication Services needs *"Storage Blob Data Contributor"* to be able to write to your storage account.** |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +3. Click on *"Save"*. |
| 50 | +4. Once completed, you see the newly added role assignment in the *"Azure role assignment"* window. |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +## Start recording session with external storage specified |
| 55 | + |
| 56 | +Use the server call ID received during initiation of the call. |
| 57 | + |
| 58 | +::: zone pivot="programming-language-csharp" |
| 59 | +[!INCLUDE [Test Call Recording BYOS with C#](../includes/recording-byos-private-csharp.md)] |
| 60 | +::: zone-end |
| 61 | + |
| 62 | +::: zone pivot="programming-language-java" |
| 63 | +[!INCLUDE [Test Call Recording BYOS with Java](../includes/recording-byos-private-java.md)] |
| 64 | +::: zone-end |
| 65 | + |
| 66 | +### Notification on successful export |
| 67 | + |
| 68 | +Use an [Azure Event Grid](../../../../event-grid/overview.md) 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. |
| 69 | + |
| 70 | +Refer to this example of the event schema. |
| 71 | + |
| 72 | +```JSON |
| 73 | +{ |
| 74 | + "id": "string", // Unique guid for event |
| 75 | + "topic": "string", // /subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name} |
| 76 | + "subject": "string", // /recording/call/{call-id}/serverCallId/{serverCallId} |
| 77 | + "data": { |
| 78 | + "storageType": "string", // acsstorage, blobstorage etc. |
| 79 | + "recordingId": "string", // unique id for recording |
| 80 | + "recordingStorageInfo": { |
| 81 | + "recordingChunks": [ |
| 82 | + { |
| 83 | + "documentId": "string", // Document id for for the recording chunk |
| 84 | + "contentLocation": "string", //Azure Communication Services URL where the content is located |
| 85 | + "metadataLocation": "string", // Azure Communication Services URL where the metadata for this chunk is located |
| 86 | + "deleteLocation": "string", // Azure Communication Services URL to use to delete all content, including recording and metadata. |
| 87 | + "index": "int", // Index providing ordering for this chunk in the entire recording |
| 88 | + "endReason": "string", // Reason for chunk ending: "SessionEnded", "ChunkMaximumSizeExceeded”, etc. |
| 89 | + } |
| 90 | + ] |
| 91 | + }, |
| 92 | + "recordingStartTime": "string", // ISO 8601 date time for the start of the recording |
| 93 | + "recordingDurationMs": "int", // Duration of recording in milliseconds |
| 94 | + "sessionEndReason": "string" // Reason for call ending: "CallEnded", "InitiatorLeft”, etc. |
| 95 | + }, |
| 96 | + "eventType": "string", // "Microsoft.Communication.RecordingFileStatusUpdated" |
| 97 | + "dataVersion": "string", // "1.0" |
| 98 | + "metadataVersion": "string", // "1" |
| 99 | + "eventTime": "string" // ISO 8601 date time for when the event was created |
| 100 | +} |
| 101 | +``` |
| 102 | + |
| 103 | +## Next steps |
| 104 | + |
| 105 | +For more information, see the following articles: |
| 106 | + |
| 107 | +- Download our [Java](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/ServerRecording) and [.NET](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/ServerRecording) call recording sample apps |
| 108 | +- Learn more about [Call Recording](../../../concepts/voice-video-calling/call-recording.md) |
| 109 | +- Learn more about [Call Automation](../../../concepts/call-automation/call-automation.md) |
| 110 | + |
0 commit comments