Send Microsoft Teams Notifications from Autonomous AI Database
Describes how to configure Microsoft Teams so that you can send messages, alerts, or output of a query from Autonomous AI Database to a Microsoft Teams Channel. Also describes the procedures you use to send Microsoft Teams notifications.
- Prepare to Send Microsoft Teams Notifications from Autonomous AI Database
 Get started by configuring a bot in your Microsoft Teams app. Next, create a credential to use with theDBMS_CLOUD_NOTIFICATIONprocedures to send Microsoft Teams notifications from Autonomous AI Database.
- Send Messages to a Microsoft Teams Channel
- Send Query Results to a Microsoft Teams Channel
Parent topic: Send Email and Notifications on Autonomous AI Database
Prepare to Send Microsoft Teams Notifications from Autonomous AI Database
Get started by configuring a bot in your Microsoft Teams app. Next, create a credential to use with the DBMS_CLOUD_NOTIFICATION procedures to send Microsoft Teams notifications from Autonomous AI Database.
                  
To configure Microsoft Teams notifications:
Send Messages to a Microsoft Teams Channel
DBMS_CLOUD_NOTIFICATION.SEND_MESSAGE procedure to send a message to a Microsoft Teams channel.
                     Example:
BEGIN
     DBMS_CLOUD_NOTIFICATION.SEND_MESSAGE(
        provider        => 'msteams',
        credential_name => 'TEAMS_CRED',
        message         => 'text from new teams api',
        params          => json_object('channel' value 'channelID'));
END;
/
 Use the params parameter to specify the channel.
                     
- 
channel: specifies the Channel ID obtained from Step 10 in Prepare to Send Microsoft Teams Notifications from Autonomous AI Database. 
See SEND_MESSAGE Procedure for more information.
Send Query Results to a Microsoft Teams Channel
DBMS_CLOUD_NOTIFICATION.SEND_DATA procedure to send the output of a query to a Microsoft Teams channel.
                     Example:
BEGIN
     DBMS_CLOUD_NOTIFICATION.SEND_DATA(provider => 'msteams',
        credential_name => 'TEAMS_CRED',
        query           => 'SELECT tablespace_name FROM dba_tablespaces',
        params          => json_object('tenant'value '5b743bc******c0286',
                                       'team'value '0ae401*********5d2bd',
                                       'channel'value '19%3a94be023*****%40thread.tacv2',
                                       'title'value 'today',
                                       'type'value 'csv'));
END;
/
 Use the params parameter to specify the tenant, team, channel, title, and data type in string values.
                     
- 
tenant: specifies the tenant ID obtained from Step 8 in Prepare to Send Microsoft Teams Notifications from Autonomous AI Database. 
- 
team: specifies the team ID obtained from Step 8 in Prepare to Send Microsoft Teams Notifications from Autonomous AI Database. 
- 
channel: specifies the channel ID obtained from Step 9 in Prepare to Send Microsoft Teams Notifications from Autonomous AI Database. 
- 
title: specifies the title of the file. The title can only contain alphabets, digits, underscores, and hyphens. The file name that appears in Microsoft Teams will be a concatenation of the title parameter and the timestamp to ensure uniqueness. The maximum title size is 50 characters. For example: 'title'_'timestamp'.'format'
- 
type: This specifies the output format. Valid values are CSV or JSON. 
The maximum file size supported when using
DBMS_CLOUD_NOTIFICATION.SEND_DATA for Microsoft Teams is 4MB. 
                     See SEND_DATA Procedure for more information.