Troubleshooting the automation of email conversation filing
Who is this article for?
Administrators troubleshooting issues with email conversation filing services.
Administrator permissions are required for some steps.
Email conversation filing allows users to select an email conversation and then have every email in that thread filed to the same Microsoft 365 location. It's a complex service that relies on several moving parts and Microsoft services.
This article explains how to troubleshoot the email tracking service when something is not working.
1. Validating automation in Azure Cosmos DB
If email automation fails, we can check the Azure Cosmos DB for the automation record to determine if Saffron failed to create it or if the Event Grid failed to notify Saffron to perform auto-saving.
To validate automation:
- Go to the Azure portal.
- Open Settings.
- Select Networking.
- Click Add your current IP.
- Click Save.
It might take a few minutes to complete the firewall setting. You can check the status on the Azure Portal notification center.
Query Automation container.
”WHERE c.automationType = 1” for SaveFolder automation
”WHERE c.automationType = 0” for Conversation automation
-
Validate if the specific email automation is created with status success.
Validate by created time:
Validate by user profile, whether it is the user that created the automation:
Validate by save location:
-
Validate the automationStatus:
0 = Pending
1 = Active (Successfully created)
2 = FailedToCreate
Other useful information is available, such as totalSaved indicates how many emails are being automatically saved by this specific automation.
1.2. Automation created but doesn’t save emails
This applies to both scenarios:
Conversation - The email automation checkbox is ticked in Cinnamon for the conversation, but the replies to the conversation are not being auto saved.
Save folder - The save folder is created, but the emails moved into the folder are not being auto saved.
There are 2 possible issues might cause the described symptom:
The Graph Subscription has expired, and it is not getting renewed.
The Event Grid is pointing to a legacy service bus namespace.
If the the automations can be created, but the auto saving is not working, it is important to investigate both of the 2 issues.
1.2.1. Graph subscription has expired
To validate it, compare the graph subscription’s expiryDateTime to the current time (the expiryDateTime is in UTC).
The issue is confirmed if there is any expired subscription. Under normal circumstances, all graph subscriptions shall be automatically renewed. If there is any expired subscription, there are 2 possibilities:
The Event Grid is pointing to a legacy service bus namespace (refers to 12.7.2)
The FunctionApp was shut down for a period of time before.
For a specific email address:
First query the automations container in the cosmos database.
WHERE c.mailboxProfile.emailAddress = "<the email address>"- Take the graphSubscriptionId and query the subscriptions container.
If no specific user email is provided, query the subscriptions container and sort by expiryDateTime to check if the oldest subscription has expired.
ORDER BY c.expiryDateTime ASCQuery the subscriptions container.
you will be able to tell whether a subscription is expired by the expiryDateTime:
To resolve the issue, there is a HTTPS API to manually renew all the expired graph subscriptions. This API is also being automatically triggered at 12:00am UTC everyday as a backup measurement to the automatically renewal flow depended on the Event Grid lifecycle notification.
To manually trigger this HTTPS API:
Go to the Azure portal.
Access API settings.
Select CORS.
Paste https://portal.azure.com as an Allowed Origin.
Trigger the HttpPostReenqueueExpiredSubscriptions function from the Overview tab.
It should show 200 OK in the Output view. Wait for a few minutes, then re-validate by querying again in the cosmos database, to check whether the graph subscription is being renewed.
It is possible to authenticate with any of the keys, but it is generally better practice and recommended to use the default key.
During renewal, a new Subscription ID may be generated and updated in the automations container. If you query the subscriptions container by Subscription ID, you'll need to retrieve the new ID from the automations container using the user's email address.
8.2 Event Grid is pointing to a non-existence Service Bus namespace
To validate it:
Locate and navigate to your Event Grid Partner Topic from the resource group.
You are able to tell whether there are excessive Delivery Failed Events from the monitoring portal.
Open Entities.
Select Event Subscriptions.
Select the EmailAutomationEventSubscription.
Click emailautomationnotifications in the bottom-right corner.
If you see the Resource not found page, that proves the Event Grid is pointing to a non-existence Service Bus namespace.
To resolve it:
Select the blue clickable (change) besides the problematic Service Bus namespace to manually select the correct resource.
Select emailautomationnotifications.
Click Confirm selection.