This demo shows how-to enable the syncing of agent statuses from Amazon Connect to Office 365 Microsoft Teams.
Follow these steps to create the Office 365 application. If you don’t have an existing office 365 account for testing, you can use the free trial of Office 365 business premium.
Note: To complete setup, you might need to work with your Azure Active Directory administrator.
Log in to the Azure portal https://portal.azure.com/ with your Office365 account credentials. Once logged in, click on Azure Active Directory.
- In the Azure Active Directory console, click on App registrations. In the app registration screen, click on new registration.
- On the new registration screen, enter application name, select your choice of account type and click on Register.
- Make note of the Application (client) ID and Directory (tenant) ID
- Click on View API Permissions
- In the API Permissions page, click on Add a permission
- Select Microsoft Graph and click on Application permissions
- In the Select permissions section, search for Presence.ReadWrite.All, User.Read.All and click on Add permissions
- Click on grant admin consent. In the confirmation pop up, click Yes to grant Admin consent for this app
- In the left navigation, Click on certificates and secrets
- Click on New client secret and select expiration period and click on Add
- Copy the Client Secret Value and store it securely
Note: Make sure you copy values from steps 3 and 11, you will need them to deploy CloudFormation
Click on the launch stack link to deploy the solution, make sure you are using the same region where you deployed your Amazon Connect instance
On the AWS CloudFormation console, enter Application (client) ID , Directory (tenant) ID and Client Secret Value CloudFormation will securely store these values in your account using AWS Secrets Manager. Note: Optionally, the CloudFormation is available for download from the cloudformation folder
- Add o365 Lambda function that was created by CloudFormation to your Amazon Connect instance
- Import contact flows from contact flows folder starting with o365_agent_connect, o365_agent_disconnect and then import o365_main
- Assign the contact flow name o365_main to the phone number
- Login as an agent, place and answer a call, review your office 365 status in MS Teams, disconnect, close the contact in Amazon Connect CCP, and review your office 365 status in MS Teams again
Note: Lambda function is using agent email to look-up user id in office 365, this could be customized based on your needs by updating or changing lambda_function.py o365_get_user_by_email function
This library is licensed under the MIT-0 License. See the LICENSE file.