# Issue Encountered during Microsoft 365 integration with Elastic cloud

**URL:** <https://discuss.elastic.co/t/issue-encountered-during-microsoft-365-integration-with-elastic-cloud/380738>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring, elastic-stack-security\
**Created:** [August 4, 2025, 6:42pm UTC](https://discuss.elastic.co/t/issue-encountered-during-microsoft-365-integration-with-elastic-cloud/380738 "2025-08-04T18:42:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shre1](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Shre1](https://discuss.elastic.co/u/Shre1)\
**Post date:** [August 4, 2025, 6:42pm UTC](https://discuss.elastic.co/t/issue-encountered-during-microsoft-365-integration-with-elastic-cloud/380738/1 "2025-08-04T18:42:10Z")

</div>

We are currently working on integrating Elastic Cloud with one of our cloud-hosted Microsoft 365 mailboxes (hosted on Azure).  
We have completed the following steps:  
• Created a new Azure AD App and gathered all required details:  
• Tenant ID  
• Client ID  
• Client Secret  
• Added the target mailbox accounts to the newly created application  
• Configured the Microsoft 365 integration in Elastic Cloud  
• base URL for Microsoft 365 management API..  
• We are attempting to fetch audit log data using an Elastic Agent running on a Logstash server, which is hosted in Azure.  
⸻  
❗ Problem Encountered:  
The integration fails to connect. We see this error in the logs:

error:  
{Post request to M365 API: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

kindly help me to resolve it
