Skip to content

Commit 555d304

Browse files
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into finalautoscale
2 parents 6a01897 + e71e6bd commit 555d304

File tree

5 files changed

+177
-20
lines changed

5 files changed

+177
-20
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/container-apps/java-dynamic-log-level.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,36 @@ author: craigshoemaker
66
ms.service: azure-container-apps
77
ms.custom: devx-track-extended-java
88
ms.topic: how-to
9-
ms.date: 05/10/2024
9+
ms.date: 05/29/2025
1010
ms.author: cshoe
1111
---
1212

1313
# Set dynamic logger level to troubleshoot Java applications in Azure Container Apps (preview)
1414

1515
Azure Container Apps platform offers a built-in diagnostics tool exclusively for Java developers to help them debug and troubleshoot their Java applications running on Azure Container Apps more easily and efficiently. One of the key features is a dynamic logger level change, which allows you to access log details that are hidden by default. When enabled, log information is collected without code modifications or forcing you to restart your app when changing log levels.
1616

17-
Before getting started, you need to upgrade Azure Container Apps extension in your Azure CLI to version **0.3.51** or newer.
17+
Before getting started, you need to check for Azure Container Apps extension in your Azure CLI:
18+
19+
```azurecli
20+
az extension show --name containerapp
21+
```
22+
23+
If the extension isn't installed, install it first. If the Azure Container Apps extension is installed, it should be version **0.3.51** or newer.
24+
25+
# [install](#tab/install)
26+
27+
```azurecli
28+
az extension add -n containerapp
29+
```
30+
31+
# [update](#tab/update)
1832

1933
```azurecli
2034
az extension update --name containerapp
2135
```
2236

37+
---
38+
2339
> [!NOTE]
2440
> This feature is compatible with applications running on Java 8 or newer versions.
2541
@@ -57,7 +73,7 @@ Use the following command to adjust log levels for a specific logger:
5773
```azurecli
5874
az containerapp java logger set \
5975
--logger-name "org.springframework.boot" \
60-
--logger-level "info"
76+
--logger-level "info" \
6177
--resource-group <RESOURCE_GROUP> \
6278
--name <CONTAINER_APP_NAME>
6379
```
@@ -100,4 +116,4 @@ For example, if you set log level to `INFO`, your app prints logs with level `FA
100116
## Related content
101117

102118
> [!div class="nextstepaction"]
103-
> [Log steaming](./log-streaming.md)
119+
> [Log streaming](./log-streaming.md)

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/virtual-wan/virtual-wan-connectivity.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
---
2-
title: Virtual WAN to Virtual WAN connectivity
2+
title: Virtual WAN to Virtual WAN Connectivity
33
description: Learn about the different available options for connecting your Azure Virtual WAN to another Virtual WAN.
44
author: halkazwini
55
ms.author: halkazwini
66
ms.service: azure-virtual-wan
7-
ms.topic: how-to
8-
ms.date: 05/08/2025
7+
ms.topic: concept-article
8+
ms.date: 05/29/2025
99
---
1010

1111
# Virtual WAN to Virtual WAN connectivity options
1212

13-
In this article, you learn about the various connection options available to connect multiple Virtual WAN environments.
13+
In some enterprise environments, there might be a need to connect one Azure Virtual WAN to another. Common scenarios include:
14+
15+
- Mergers and acquisitions
16+
- Decentralized business units requiring interconnectivity
17+
18+
In this article, you learn about the various connection options available to link multiple Virtual WAN environments.
1419

1520
## IPsec tunnels using virtual network gateways
1621

@@ -44,7 +49,7 @@ This option is ideal if you want to connect two Virtual WANs using SD-WAN NVAs.
4449

4550
This option is similar to the previous one, except you place the SD-WAN NVA in a spoke virtual network that is peered to the virtual hub, rather than deploying it in the virtual hub. This setup allows you to configure BGP peering between the SD-WAN NVA and the virtual hub route server.
4651

47-
This approach is suitable for scenarios where SD-WAN NVAs can't be deployed into Virtual WAN hubs but still support BGP. As in the second option, you must replace ASNs 65520 and 65515 with those used by your SD-WAN to avoid BGP loop prevention.
52+
This approach is suitable for scenarios where SD-WAN NVAs can't be deployed into Virtual WAN hubs but still support BGP. As in the second option, you must replace ASNs 65520 and 65515 with the ones used by your SD-WAN to avoid BGP loop prevention.
4853

4954
:::image type="content" source="./media/virtual-wan-connectivity/vwan-connectivity-using-spoke-sdwan.png" alt-text="Diagram shows Virtual WAN connectivity using SD-WAN devices in spoke virtual networks." lightbox="./media/virtual-wan-connectivity/vwan-connectivity-using-spoke-sdwan.png":::
5055

0 commit comments

Comments
 (0)