Can I store the SMTP password in a Vault instead of kong.conf?
Yes. If you have a Vault backend configured, you can reference the SMTP password as a Vault secret using the {vault://...} syntax in kong.conf.
Create an Azure Communication Services resource with an email resource connected, register a Microsoft Entra application with the Communication and Email Service Owner role, and create an SMTP username. Then, configure the SMTP host, port, username, password, and admin_emails_from in your kong.conf file.
You need a running Kong Gateway instance with RBAC and authentication enabled.
SMTP emails are used in Kong Manager for workflows like admin invitations and password resets, which require authentication and RBAC to be turned on.
Make sure you’ve copied and renamed the Kong Gateway kong.conf:
cp /etc/kong/kong.conf.default /etc/kong/kong.conf
You need an Azure Communication Services resource with an Email Communication resource connected and a verified domain.
Follow the Azure SMTP authentication guide to create your SMTP credentials. You’ll need to note the SMTP username and the Microsoft Entra application client secret for the next step.
Add the following SMTP configuration to your kong.conf file.
Replace the placeholder values with the SMTP endpoint, username, and password from the prerequisites:
smtp_mock = off
smtp_host = smtp.azurecomm.net
smtp_port = 587
smtp_starttls = on
smtp_username = YOUR_SMTP_USERNAME
smtp_password = YOUR_ENTRA_CLIENT_SECRET
smtp_auth_type = login
admin_emails_from = YOUR_NAME <verified-sender@example.com>
admin_emails_reply_to = YOUR_NAME <verified-sender@example.com>
lua_ssl_verify_depth = 2
Replace the following values:
smtp_username: The SMTP username you created in the Azure portal.smtp_password: The Microsoft Entra application client secret.admin_emails_from: A connected email address from your Azure Communication Services domain.admin_emails_reply_to: The reply-to email address for outgoing emails.Setting
lua_ssl_verify_depth: Azure Communication Services uses a deeper intermediate certificate chain than the default SSL verification depth allows. Setlua_ssl_verify_depthto 2 to resolve SSL handshake errors.
After updating kong.conf, restart Kong Gateway to apply the changes:
kong restart
To verify that the SMTP configuration is working correctly, do the following:
Can I store the SMTP password in a Vault instead of kong.conf?
Yes. If you have a Vault backend configured, you can reference the SMTP password as a Vault secret using the {vault://...} syntax in kong.conf.