You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/managed-grafana/how-to-smtp-settings.md
+33-13Lines changed: 33 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ To follow the steps in this guide, you must have:
25
25
26
26
## Enable and configure SMTP settings
27
27
28
-
To activate SMTP settings, enable email notifications and configure an email contact point in Azure Managed Grafana, follow the steps below.
28
+
Follow these steps to activate SMTP settings, enable email notifications and configure an email contact point in Azure Managed Grafana.
29
29
30
30
### [Portal](#tab/azure-portal)
31
31
@@ -43,7 +43,7 @@ To activate SMTP settings, enable email notifications and configure an email con
43
43
| From Address | [email protected] | Enter the email address used when sending out emails. |
44
44
| From Name | Azure Managed Grafana Notification | Enter the name used when sending out emails. Default is "Azure Managed Grafana Notification" if parameter isn't given or empty. |
45
45
| Skip Verify | Disable |This setting controls whether a client verifies the server's certificate chain and host name. If **Skip Verify** is **Enable**, client accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to machine-in-the-middle attacks unless custom verification is used. Default is **Disable** (toggled off). [More information](https://pkg.go.dev/crypto/tls#Config). |
46
-
| StartTLS Policy | OpportunisticStartTLS | There are 3 options. [More information](https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy).<br><ul><li>**OpportunisticStartTLS** means that SMTP transactions are encrypted if STARTTLS is supported by the SMTP server. Otherwise, messages are sent in the clear. This is the default setting.</li><li>**MandatoryStartTLS** means that SMTP transactions must be encrypted. SMTP transactions are aborted unless STARTTLS is supported by the SMTP server.</li><li>**NoStartTLS** means encryption is disabled and messages are sent in the clear.</li></ul> |
46
+
| StartTLS Policy | OpportunisticStartTLS | There are three options. [More information](https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy).<br><ul><li>**OpportunisticStartTLS** means that SMTP transactions are encrypted if STARTTLS is supported by the SMTP server. Otherwise, messages are sent in the clear. It's the default setting.</li><li>**MandatoryStartTLS** means that SMTP transactions must be encrypted. SMTP transactions are aborted unless STARTTLS is supported by the SMTP server.</li><li>**NoStartTLS** means encryption is disabled and messages are sent in the clear.</li></ul> |
47
47
48
48
1. Select **Save** to save the SMTP settings. Updating may take a couple of minutes.
49
49
@@ -54,7 +54,7 @@ To activate SMTP settings, enable email notifications and configure an email con
54
54
### [Azure CLI](#tab/azure-cli)
55
55
56
56
1. Azure Managed Grafana CLI extension 1.1 or above is required to enable or update SMTP settings. To update your extension, run `az extension update --name amg`.
57
-
1. Run the [az grafana update](/cli/azure/grafana#az-grafana-update) command to configure SMTP settings for a given Azure Managed Grafana instance. When doing this, replace the placeholders below with information from your own instance.
57
+
1. Run the [az grafana update](/cli/azure/grafana#az-grafana-update) command to configure SMTP settings for a given Azure Managed Grafana instance. Replace the placeholders with information from your own instance.
58
58
59
59
```azurecli
60
60
az grafana update --resource-group <resource-group> \
@@ -79,7 +79,7 @@ To activate SMTP settings, enable email notifications and configure an email con
79
79
| `--host` | test.sendgrid.net:587 | Enter the SMTP server hostname with port. |
80
80
| `--user` | admin | Enter the name of the user of the SMTP authentication. |
81
81
| `--password` | password | Enter password of the SMTP authentication. If the password contains "#" or ";" wrap it within triple quotes. |
82
-
| `--start-tls-policy` | OpportunisticStartTLS | The StartTLSPolicy setting of the SMTP configuration. There are 3 options. [More information](https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy).<br><ul><li>**OpportunisticStartTLS** means that SMTP transactions are encrypted if STARTTLS is supported by the SMTP server. Otherwise, messages are sent in the clear. This is the default setting.</li><li>**MandatoryStartTLS** means that SMTP transactions must be encrypted. SMTP transactions are aborted unless STARTTLS is supported by the SMTP server.</li><li>**NoStartTLS** means encryption is disabled and messages are sent in the clear.</li></ul> |
82
+
| `--start-tls-policy` | OpportunisticStartTLS | The StartTLSPolicy setting of the SMTP configuration. There are three options. [More information](https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy).<br><ul><li>**OpportunisticStartTLS** means that SMTP transactions are encrypted if STARTTLS is supported by the SMTP server. Otherwise, messages are sent in the clear. This is the default setting.</li><li>**MandatoryStartTLS** means that SMTP transactions must be encrypted. SMTP transactions are aborted unless STARTTLS is supported by the SMTP server.</li><li>**NoStartTLS** means encryption is disabled and messages are sent in the clear.</li></ul> |
83
83
| `--skip-verify` | false |This setting controls whether a client verifies the server's certificate chain and host name. If **--skip-verify** is **true**, client accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to machine-in-the-middle attacks unless custom verification is used. Default is **false**. [More information](https://pkg.go.dev/crypto/tls#Config). |
84
84
85
85
---
@@ -88,6 +88,30 @@ To activate SMTP settings, enable email notifications and configure an email con
88
88
> Here are some tips for properly configuring SMTP:
89
89
>- When using a business email account such as Office 365, you may need to contact your email administrator to enable SMTP AUTH (for example, [enable-smtp-auth-for-specific-mailboxes](/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission#enable-smtp-auth-for-specific-mailboxes)). You should be able to create an app password afterwards and use it as the SMTP *password* setting.
90
90
>- When using a personal email account such as Outlook or Gmail, you should create an app password and use it as the SMTP *password* setting. Note that your account won't work for email notification if it's configured with multi-factor authentication.
91
+
>- It's recommended that you verify the SMTP configurations to be working as expected before applying them to your Managed Grafana workspace. For example, you can use an open source tool such as [swaks (Swiss Army Knife for SMTP)](https://github.com/jetmore/swaks) to send a test email using the SMTP configurations by running the following command in a terminal window:
92
+
> ```bash
93
+
> # fill in all the empty values for the following parameters
94
+
> host="" # SMTP host name with port separated by a ":", e.g. smtp.office365.com:587
> ehlo="" # grafana endpoint, e.g. team1-ftbghja6ekeybng8.wcus.grafana.azure.com
100
+
>
101
+
> header="Subject:Test"
102
+
> body="Testing!"
103
+
>
104
+
> # test SMTP connection by sending an email
105
+
> swaks --auth -tls \
106
+
> --server $host \
107
+
> --auth-user $user \
108
+
> --auth-password $password \
109
+
> --from $fromAddress \
110
+
> --to $toAddress \
111
+
> --ehlo $ehlo \
112
+
> --header $header \
113
+
> --body $body
114
+
> ```
91
115
92
116
## Configure Grafana contact points and send a test email
93
117
@@ -102,11 +126,11 @@ Configuring Grafana contact points is done in the Grafana portal:
102
126
1. Add or update the **Name**, and **Contact point type**.
103
127
1. Enter a destination email under **Addresses**, and select **Test**.
104
128
1. Select **Send test notification** to send the notification with the predefined test message or select **Custom** to first edit the message.
105
-
1. A notification "Test alert sent" is displayed, meaning that the email setup has been successfully configured. The test email has been sent to the provided email address. In case of misconfiguration, an error message will be displayed instead.
129
+
1. A notification "Test alert sent" is displayed, meaning that the email setup has been successfully configured. The test email has been sent to the provided email address. If there is a misconfiguration, an error message is shown instead.
106
130
107
131
## Disable SMTP settings
108
132
109
-
To disable SMTP settings, follow the steps below.
133
+
To disable SMTP settings, follow these steps.
110
134
111
135
### [Portal](#tab/azure-portal)
112
136
@@ -116,7 +140,7 @@ To disable SMTP settings, follow the steps below.
116
140
### [Azure CLI](#tab/azure-cli)
117
141
118
142
1. Azure Managed Grafana CLI extension 1.1 or above is required to disable SMTP settings. To update your extension, run `az extension update --name amg`.
119
-
1. Run the [az grafana update](/cli/azure/grafana#az-grafana-update) command to configure SMTP settings for a given Azure Managed Grafana instance. Replace the placeholders below with information from your own instance.
143
+
1. Run the [az grafana update](/cli/azure/grafana#az-grafana-update) command to configure SMTP settings for a given Azure Managed Grafana instance. Replace the placeholders with information from your own instance.
120
144
121
145
```azurecli
122
146
az grafana update --resource-group <resource-group> \
@@ -139,14 +163,10 @@ To disable SMTP settings, follow the steps below.
139
163
140
164
Within the Grafana portal, you can find a list of all Grafana alerting error messages that occurred in **Alerting > Notifications**.
141
165
142
-
Below are some common error messages you may encounter:
166
+
The following are some common error messages you may encounter:
143
167
144
168
- "Authentication failed: The provided authorization grant is invalid, expired, or revoked". Grafana couldn't connect to the SMTP server. Check if the password entered in the SMTP settings in the Azure portal is correct.
145
-
- "Failed to sent test alert.: SMTP not configured". SMTP is disabled. Open the Azure Managed Grafana instance in the Azure portal and enable SMTP settings.
146
-
147
-
## Known limitation
148
-
149
-
Due to limitation on alerting high availability configuration in Azure Managed Grafana, there could be duplicate email notifications delivered for a single firing alert.
169
+
- "Failed to sent test alert: SMTP not configured". SMTP is disabled. Open the Azure Managed Grafana instance in the Azure portal and enable SMTP settings.
0 commit comments