Skip to content

Commit 5ab0dd3

Browse files
committed
Merge branch 'main' into release-ga-lbcd
2 parents 47a7e80 + bb62c5e commit 5ab0dd3

File tree

6 files changed

+153
-16
lines changed

6 files changed

+153
-16
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: Send email with SMTP and XOAuth2 using .NET
3+
titleSuffix: An Azure Communication Services article
4+
description: This article describes how to use SMTP and OAuth to send emails to Email Communication Services.
5+
author: ddouglas-msft
6+
services: azure-communication-services
7+
ms.author: ddouglas
8+
ms.date: 10/18/2023
9+
ms.topic: quickstart
10+
ms.service: azure-communication-services
11+
ms.custom: devx-track-dotnet
12+
---
13+
# Send email with SMTP and XOAuth2 using .NET
14+
15+
This article describes how to use XOAuth2 for authentication when sending emails using the Simple Mail Transfer Protocol (SMTP) and Azure Communication Services.
16+
17+
## Prerequisites
18+
19+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
20+
- The latest version [.NET Core client library](https://dotnet.microsoft.com/download/dotnet-core) for your operating system.
21+
- An Azure Communication Email Resource created and ready with a provisioned domain [Get started with Creating Email Communication Resource](../create-email-communication-resource.md).
22+
- An active Azure Communication Services Resource connected with Email Domain and a Connection String. [Get started by Connecting Email Resource with a Communication Resource](../connect-email-communication-resource.md).
23+
- SMTP credentials created using a Microsoft Entra ID application with access to the Azure Communication Services Resource. [How to create authentication credentials for sending emails using SMTP](smtp-authentication.md).
24+
25+
Completing this example incurs a small cost of a few USD cents or less in your Azure account.
26+
27+
> [!NOTE]
28+
> You can also send an email from your own verified domain. See [Add custom verified domains to Email Communication Service](../add-azure-managed-domains.md).
29+
30+
This article describes how to send email with Azure Communication Services using SMTP.
31+
32+
### Prerequisite check
33+
34+
- In a terminal or command window, run the `dotnet` command to check that the .NET client library is installed.
35+
- To view the subdomains associated with your Azure Communication Email Resource, sign in to the [Azure portal](https://portal.azure.com/), locate your Azure Communication Email Resource and open the **Provision domains** tab from the left navigation pane.
36+
37+
### Create a new C# application
38+
In a console window (such as cmd, PowerShell, or Bash), use the `dotnet new` command to create a new console app with the name `EmailQuickstart`. This command creates a simple "Hello World" C# project with a single source file: **Program.cs**.
39+
40+
```console
41+
dotnet new console -o EmailSmtpQuickstart
42+
```
43+
44+
Change your directory to the newly created app folder and use the `dotnet build` command to compile your application.
45+
46+
```console
47+
cd EmailSmtpQuickstart
48+
dotnet build
49+
```
50+
51+
Add the MailKit package.
52+
53+
```console
54+
dotnet add package MailKit
55+
```
56+
57+
### Retrieve an Entra token for SMTP OAuth authentication
58+
59+
Complete the following steps to retrieve a Microsoft Entra ID token. Replace the Microsoft Entra ID application details with the values from the Entra application used to create the SMTP Username.
60+
61+
```csharp
62+
using MailKit.Net.Smtp;
63+
using MailKit.Security;
64+
using Microsoft.Identity.Client;
65+
using MimeKit;
66+
using System.Net;
67+
68+
// Microsoft Entra ID (Azure AD) credentials
69+
string smtpUsername = "<SMTP Username of the ACS Resource>";
70+
string entraAppId = "<Entra Application ID>";
71+
string entraAppClientSecret = "<Entra Application Client Secret>";
72+
string tenantId = "<Entra Tenant ID>";
73+
string entraAuthority = "https://login.microsoftonline.com/common/";
74+
75+
// Build the MSAL confidential client application
76+
IConfidentialClientApplication app = ConfidentialClientApplicationBuilder
77+
.Create(entraAppId)
78+
.WithClientSecret(entraAppClientSecret)
79+
.WithAuthority(new Uri(entraAuthority))
80+
.WithTenantId(tenantId)
81+
.Build();
82+
83+
// Define the resource scope
84+
string[] scopes = new string[] { "https://communication.azure.com/.default" };
85+
86+
// Acquire token for the client
87+
AuthenticationResult result = await app.AcquireTokenForClient(scopes)
88+
.ExecuteAsync();
89+
90+
string token = result.AccessToken;
91+
```
92+
93+
### Construct your email message
94+
To construct an email message, you need to:
95+
- Define the Email Subject and Body.
96+
- Define your Sender Address. You get your MailFrom Address from your Verified Domain.
97+
- Define the Recipient Address.
98+
99+
Replace with your domain details and modify the content, recipient details as required
100+
101+
```csharp
102+
string smtpHostUrl = "smtp.azurecomm.net";
103+
string senderAddress = "<Mailfrom Address>";
104+
string recipientAddress = "<Recipient Email Address>";
105+
106+
string subject = "Welcome to Azure Communication Service Email SMTP";
107+
string body = "This email message is sent from Azure Communication Service Email using SMTP.";
108+
```
109+
110+
111+
### Send an email using MailKit.
112+
113+
```csharp
114+
var message = new MimeMessage();
115+
message.From.Add(new MailboxAddress("Sender Name", senderAddress));
116+
message.To.Add(new MailboxAddress("Recipient Name", recipientAddress));
117+
message.Subject = subject;
118+
message.Body = new TextPart("plain")
119+
{
120+
Text = body
121+
};
122+
123+
using (var client = new SmtpClient())
124+
{
125+
client.Connect(smtpHostUrl, 587, SecureSocketOptions.StartTls);
126+
127+
// Use the access token to authenticate
128+
var oauth2 = new SaslMechanismOAuth2(smtpUsername, token);
129+
client.Authenticate(oauth2);
130+
131+
client.Send(message);
132+
client.Disconnect(true);
133+
}
134+
```

articles/communication-services/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ items:
214214
href: quickstarts/email/send-email-smtp/smtp-authentication.md
215215
- name: Send email using SMTP
216216
href: quickstarts/email/send-email-smtp/send-email-smtp.md
217+
- name: Send email using SMTP with XOAuth2
218+
href: quickstarts/email/send-email-smtp/send-email-smtp-oauth.md
217219
- name: Attachments
218220
items:
219221
- name: Inline attachments

articles/network-watcher/vm-network-troubleshooter.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
---
2-
title: VM Network Troubleshooter (Preview) overview
2+
title: VM network troubleshooter (Preview) overview
33
titleSuffix: Azure Network Watcher
4-
description: Learn about VM Network Troubleshooter in Azure Network Watcher and how it can help you detect blocked ports.
4+
description: Learn about VM network troubleshooter in Azure Network Watcher and how it can help you detect blocked ports.
55
author: halkazwini
66
ms.author: halkazwini
77
ms.service: azure-network-watcher
88
ms.topic: concept-article
99
ms.date: 05/07/2025
1010
---
1111

12-
# VM Network Troubleshooter (Preview) overview
12+
# VM network troubleshooter (Preview) overview
1313

1414
> [!IMPORTANT]
15-
> The VM Network Troubleshooter is currently in PREVIEW.
15+
> The VM network troubleshooter is currently in PREVIEW.
1616
> See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
1717
1818
Blocked ports on Virtual Machines (VMs) are one of the most common connectivity issues faced by Azure customers. The VM Network Troubleshooter helps customers quickly check if commonly used ports are blocked on their Azure virtual machine.
1919

2020

21-
## What ports are checked by the VM Network Troubleshooter?
21+
## What ports are checked by the VM network troubleshooter?
2222

23-
The VM Network Troubleshooter checks for the following ports:
23+
The VM network troubleshooter checks for the following ports:
2424
- Port 80 (HTTP)
2525
- Port 443 (HTTPS)
2626
- Port 3389 (RDP)
2727

2828

29-
## How can customers access the VM Network Troubleshooter?
29+
## How can customers access the VM network troubleshooter?
3030

31-
Customers can access the VM Network Troubleshooter from the Monitor tab on the VM Overview blade. With a single click, customers can start the troubleshooter and check if the ports for RDP, HTTP, and HTTPs are blocked.
31+
Customers can access the VM network troubleshooter from the Monitor tab on the VM Overview blade. With a single click, customers can start the troubleshooter and check if the ports for RDP, HTTP, and HTTPs are blocked.
3232

33-
:::image type="content" source="./media/vm-network-troubleshooter/vm-network-troubleshooter.gif" alt-text="Video of customers navigating to the VM Network Troubleshooter from the VM Overview blade in the Azure portal.":::
33+
:::image type="content" source="./media/vm-network-troubleshooter/vm-network-troubleshooter.gif" alt-text="Video of customers navigating to the VM network troubleshooter from the VM Overview blade in the Azure portal.":::
3434

3535

36-
## How does the VM Network Troubleshooter work?
36+
## How does the VM network troubleshooter work?
3737

38-
The VM Network Troubleshooter is built on top of the NSG diagnostics tool. The troubleshooter simulates traffic to the VM for common ports. It returns whether the flow is allowed or denied with detailed information about the security rule allowing or denying the flow.
38+
The VM network troubleshooter is built on top of the NSG diagnostics tool. The troubleshooter simulates traffic to the VM for common ports. It returns whether the flow is allowed or denied with detailed information about the security rule allowing or denying the flow.
3939
Customers can clickthrough from the results to the NSG rules and edit them as needed.
4040

4141
## Next step

articles/operator-nexus/concepts-cluster-upgrade-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: matternst7258
55
ms.author: matthewernst
66
ms.service: azure-operator-nexus
77
ms.topic: conceptual
8-
ms.date: 11/11/2024
8+
ms.date: 05/21/2025
99
ms.custom: template-concept
1010
---
1111

@@ -34,7 +34,7 @@ Patch runtime release is produced monthly in between the minor releases. These r
3434

3535
Starting a runtime upgrade is defined under [Upgrading cluster runtime via Azure CLI](./howto-cluster-runtime-upgrade.md).
3636

37-
The runtime upgrade starts by upgrading the three management servers designated as the control plane nodes. The spare control plane server is the first server to upgrade. The last control plane server deprovisions and transitions to `Available` state. These servers are updated serially and proceed only when each completes. The remaining management servers are upgraded into four different groups and completed one group at a time.
37+
The runtime upgrade starts by upgrading the three management servers designated as the control plane nodes. The spare control plane server is the first server to upgrade. The last control plane server deprovisions and transitions to `Available` state. These servers are updated serially and proceed only when each completes. The remaining management servers are segregated into two groups. The runtime upgrade will now leverage two management groups, instead of a single group. Each group is upgraded in two stages and sequentially with 50% success threshold in each group. Introducing this capability allows for components running on the management servers to ensure resiliency during the runtime upgrade by applying affinity rules. For this release, each CSN will leverage this functionality by placing one instance in each management group. No customer interaction with this functionality. There may be additional labels seen on management nodes to identify the groups.
3838

3939
> [!Note]
4040
> Customers may observe the spare server with a different runtime version. This is expected.

articles/operator-nexus/howto-cluster-runtime-upgrade.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: bpinto
66
ms.service: azure-operator-nexus
77
ms.custom: azure-operator-nexus, devx-track-azurecli
88
ms.topic: how-to
9-
ms.date: 02/25/2025
9+
ms.date: 05/21/2025
1010
# ms.custom: template-include
1111
---
1212

@@ -160,7 +160,8 @@ az networkcloud cluster update-version --cluster-name "<CLUSTER>" \
160160
```
161161

162162
The runtime upgrade is a long process. The upgrade first upgrades the management nodes and then sequentially Rack-by-Rack for the worker nodes.
163-
The upgrade is considered to be finished when 80% of worker nodes per rack and 100% of management nodes are successfully upgraded.
163+
The management servers are segregated into two groups. The runtime upgrade will now leverage two management groups, instead of a single group. Introducing this capability allows for components running on the management servers to ensure resiliency during the runtime upgrade by applying affinity rules. For this release, each CSN will leverage this functionality by placing one instance in each management group. No customer interaction with this functionality. There may be additional labels seen on management nodes to identify the groups.
164+
The upgrade is considered to be finished when 80% of worker nodes per rack and 50% of management nodes in each group are successfully upgraded.
164165
Workloads might be impacted while the worker nodes in a rack are in the process of being upgraded, however workloads in all other racks aren't impacted. Consideration of workload placement in light of this implementation design is encouraged.
165166

166167
Upgrading all the nodes takes multiple hours, depending upon how many racks exist for the Cluster.

articles/service-bus-messaging/includes/service-bus-jms-feature-list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The following table lists the Java Message Service (JMS) features that Azure Ser
2525
| Unshared durable subscriptions | <ul> <li> JMSContext.createDurableConsumer(Topic topic, String name) </li> <li> createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) </li> </ul> <br/> noLocal is currently not supported and should be set to false | **Supported** |
2626
| Shared non-durable subscriptions |<ul> <li> JMSContext.createSharedConsumer(Topic topic, String sharedSubscriptionName) </li> <li> JMSContext.createSharedConsumer(Topic topic, String sharedSubscriptionName, String messageSelector) </li> </ul> | **Supported** |
2727
| Unshared non-durable subscriptions |<ul> <li> JMSContext.createConsumer(Destination destination) </li> <li> JMSContext.createConsumer( Destination destination, String messageSelector) </li> <li> JMSContext.createConsumer( Destination destination, String messageSelector, boolean noLocal) </li> </ul> <br/> noLocal is currently not supported and should be set to false | **Supported** |
28-
| Message selectors | depends on the consumer created | **Supported** |
28+
| Message selectors | Depends on the consumer created. Service Bus selectors don't support "LIKE" and "BETWEEN" SQL keywords. | **Supported** |
2929
| Delivery Delay (scheduled messages) | <ul> <li> JMSProducer.setDeliveryDelay( long deliveryDelay) </li> </ul>|**Supported**|
3030
| Message created |<ul> <li> JMSContext.createMessage() </li> <li> JMSContext.createBytesMessage() </li> <li> JMSContext.createMapMessage() </li> <li> JMSContext.createObjectMessage( Serializable object) </li> <li> JMSContext.createStreamMessage() </li> <li> JMSContext.createTextMessage() </li> <li> JMSContext.createTextMessage( String text) </li> </ul>| **Supported** |
3131
| Cross entity transactions |<ul> <li> Connection.createSession(true, Session.SESSION_TRANSACTED) </li> </ul> | **Supported** |

0 commit comments

Comments
 (0)