Configuring Email Notifications

Sender Email / Username

Email Service Principal is used only for sending emails. This service principle is different from LHO's Service Principle.
Before configuring the Email Service Principal please open the LHO's environment variables and set the following fields:

  • mail.oauth.tenantId

  • mail.oauth.clientId

  • mail.oauth.clientSecret

mail.oauth.clientSecret is read from the Vault based on the key name email-notification-sp-client-secret. When the Email Service Principal's secret expires, please manually update the secret's value configured in Vault.

How to Configure Email Notifications

Which Solution Should You Choose

Below, we provide two possible solutions to configure your email notifications. Which one you want to use will be based on your company's security policy and email server configuration. OAuth version is better from a security point of view, but not all email providers have support for OAuth.

If in doubt, we suggest contacting your company's IT department and see what they recommend.

What You Will Need

To complete either solution, you will need to be able to ssh into the VM (Virtual Machine) where Lakehouse Optimizer is deployed. This can be done in Azure or AWS, or it can be done through your own computer's console or terminal application. You will need access through password or ssh key. If you don’t know those, again we suggest contacting your IT department, they should be able to provide you with the relevant information to access the VM through ssh.

Once you have ssh access to the VM, you can find the .env file mentioned below in the home directory.

Solution #1: Using OAuth (the only solution supported by Microsoft)

The following environment variables must be set:

  1. In keyvault set email-noification-sp-client-secret to the the client secret of your deployment’s app registration.

  2. In the .env file set:

    1. EMAIL_NOTIFICATION_SP_TENANTID={{ The tenant ID from Azure for the email service that will send notifications }}

    2. EMAIL_NOTIFICATION_SP_CLIENTID={{ The client ID from Azure for the email service that will send notifications }}

    3. SPRING_MAIL_USERNAME={{ The email that notifications will be sent from. e.g. sender@mail.com }}

    4. SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH_MECHANISMS=XOAUTH2

Once these environment variables are set, you will want to run docker-compose up -d in the ssh terminal, then you can go to the app and click the SAVE button.

After OAuth setup is complete, you can click on TEST button, and send a test email.

Solution #2: Using Basic Auth (not supported by Microsoft)

The following environment variables must be set in the .env file:

  1. SPRING_MAIL_USERNAME={{ The email that notifications will be sent from. e.g. sender@mail.com }}

  2. SPRING_MAIL_PASSWORD={{ The password for this email service }}

Once these environment variables are set, you will want to run docker-compose up -d in the ssh terminal, then you can go to the app and click the SAVE button.

After OAuth setup is complete, you can click on TEST button, and send a test email. Â