Skip to content

Commit 8ef86d3

Browse files
authored
Merge pull request #122511 from AmyL219/patch-3
Update data-loss-prevention with API changes
2 parents 9ab6ec5 + 96baedb commit 8ef86d3

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

articles/communication-services/how-tos/chat-sdk/data-loss-prevention.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ ms.subservice: chat
1111
ms.custom: template-how-to
1212
---
1313
# How to integrate with Microsoft Teams Data Loss Prevention policies
14+
[!INCLUDE [Public Preview Disclaimer](../../includes/public-preview-include-document.md)]
1415

15-
Microsoft Teams administrator can configure policies for data loss prevention (DLP) to prevent leakage of sensitive information from Teams users in Teams meetings. Developers can integrate chat in Teams meetings with Azure Communication Services for Communication Services users via the Communication Services UI library or custom integration. This article describes how to incorporate data loss prevention without a UI library.
16+
Microsoft Teams administrator can configure policies for data loss prevention (DLP) to prevent leakage of sensitive information from Teams users during Teams meetings. Developers have the option to integrate chat functionality in Teams meetings with Azure Communication Services. This can be done either through the Azure Communication Services UI library or through a custom integration. This article describes how to incorporate data loss prevention without using the UI library.
1617

17-
You need to subscribe to real-time notifications and listen for message updates. If a chat message from a Teams user contains sensitive content, the message content is updated to blank. The Azure Communication Services user interface has to be updated to indicate that the message cannot be displayed, for example, "Message was blocked as it contains sensitive information.". There could be a delay of a couple of seconds before a policy violation is detected and the message content is updated. You can find an example of such code below.
18+
You need to set up your application to listen for real-time updates on message edits. If a Teams user sends a message containing sensitive content, the message will be automatically replaced with a blank message and flagged with a "policyViolation" result. Your application should update its user interface to reflect that the message has been blocked. For example, display a message such as "Message was blocked as it contains sensitive information." Be aware that there may be a brief delay, usually a couple of seconds, between when a message is sent and when a policy violation is detected and applied. You can find an example of such code below.
1819

19-
Data Loss Prevention policies only apply to messages sent by Teams users and aren't meant to protect Azure Communications users from sending out sensitive information.
20+
It's important to note that DLP policies apply only to messages sent by Teams users and do not prevent Azure Communications users from sending out sensitive information.
2021

2122
#### Data Loss Prevention with subscribing to real-time chat notifications
2223
```javascript
@@ -29,8 +30,7 @@ let chatClient = new ChatClient(endpointUrl, new AzureCommunicationTokenCredenti
2930

3031
await chatClient.startRealtimeNotifications();
3132
chatClient.on("chatMessageEdited", (e) => {
32-
if (e.messageBody == "" &&
33-
e.sender.kind == "microsoftTeamsUser") {
33+
if (e.policyViolation?.result == "contentBlocked") {
3434
// Show UI message blocked
3535
}
3636
});
@@ -40,8 +40,7 @@ chatClient.on("chatMessageEdited", (e) => {
4040
```javascript
4141
const messages = chatThreadClient.listMessages();
4242
for await (const message of messages) {
43-
if (message.content?.message == "" &&
44-
message.sender?.kind == "microsoftTeamsUser") {
43+
if (message.policyViolation?.result == "contentBlocked") {
4544
// Show UI message blocked
4645
}
4746
}

0 commit comments

Comments
 (0)