Skip to content

Commit 050c248

Browse files
Merge pull request #36332 from MicrosoftDocs/main
Auto Publish – main to live - 2026-01-20 23:30 UTC
2 parents 55b74d5 + 2e89756 commit 050c248

91 files changed

Lines changed: 859 additions & 456 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Block preview branch merges
2+
3+
permissions:
4+
pull-requests: write
5+
statuses: write
6+
checks: write
7+
8+
on:
9+
pull_request:
10+
types: [opened, synchronize, reopened]
11+
# Monitor all target branches since preview branches cannot merge to ANY branch
12+
13+
jobs:
14+
block-preview:
15+
name: Block preview branch merge
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Check head reference restrictions
20+
shell: pwsh
21+
env:
22+
HEAD_REF: ${{ github.head_ref }}
23+
BASE_REF: ${{ github.base_ref }}
24+
PR_NUMBER: ${{ github.event.number }}
25+
REPO_NAME: ${{ github.repository }}
26+
run: |
27+
Write-Host "Checking merge restrictions for PR #$env:PR_NUMBER"
28+
Write-Host "Head reference: $env:HEAD_REF"
29+
Write-Host "Base reference: $env:BASE_REF"
30+
Write-Host "Repository: $env:REPO_NAME"
31+
32+
# Only apply restrictions if head branch is a release-preview branch
33+
if ($env:HEAD_REF -like "*release-preview*") {
34+
Write-Host "Release-preview branch detected: $env:HEAD_REF"
35+
36+
# Block merges to main
37+
if ($env:BASE_REF -eq "main") {
38+
Write-Host "❌ MERGE BLOCKED: Release-preview branches cannot merge to main"
39+
Write-Host ""
40+
Write-Host "This pull request is attempting to merge from a release-preview branch"
41+
Write-Host "'$env:HEAD_REF' to 'main', which is not permitted."
42+
Write-Host ""
43+
Write-Host "IMPORTANT: Release-preview branches cannot merge directly to main."
44+
Write-Host ""
45+
Write-Host "To merge such branches:"
46+
Write-Host "1. Create a new branch from main"
47+
Write-Host "2. Squash the changes to one commit"
48+
Write-Host "3. Create a new pull request from the new branch"
49+
Write-Host ""
50+
51+
# Set job summary for GitHub UI
52+
echo "# 🚫 Merge Blocked - Release-Preview to Main" >> $env:GITHUB_STEP_SUMMARY
53+
echo "" >> $env:GITHUB_STEP_SUMMARY
54+
echo "Release-preview branches cannot merge directly to **main**." >> $env:GITHUB_STEP_SUMMARY
55+
echo "" >> $env:GITHUB_STEP_SUMMARY
56+
echo "## Restriction Details" >> $env:GITHUB_STEP_SUMMARY
57+
echo "- **Head branch:** $env:HEAD_REF" >> $env:GITHUB_STEP_SUMMARY
58+
echo "- **Target branch:** $env:BASE_REF" >> $env:GITHUB_STEP_SUMMARY
59+
echo "- **Restriction:** Release-preview branches cannot merge to main" >> $env:GITHUB_STEP_SUMMARY
60+
61+
exit 1
62+
}
63+
# For release-* targets (non-preview), always block
64+
elseif ($env:BASE_REF -like "release-*" -and $env:BASE_REF -notlike "release-preview-*") {
65+
Write-Host "❌ MERGE BLOCKED: Release-preview branches cannot merge to non-preview release branches"
66+
Write-Host ""
67+
Write-Host "This pull request is attempting to merge from '$env:HEAD_REF'"
68+
Write-Host "to '$env:BASE_REF', which is not permitted."
69+
Write-Host ""
70+
Write-Host "IMPORTANT: Release-preview branches can only merge to other release-preview branches."
71+
Write-Host ""
72+
73+
# Set job summary for GitHub UI
74+
echo "# 🚫 Merge Blocked - Release-Preview to Release" >> $env:GITHUB_STEP_SUMMARY
75+
echo "" >> $env:GITHUB_STEP_SUMMARY
76+
echo "Release-preview branches cannot merge to non-preview release branches." >> $env:GITHUB_STEP_SUMMARY
77+
echo "" >> $env:GITHUB_STEP_SUMMARY
78+
echo "## Restriction Details" >> $env:GITHUB_STEP_SUMMARY
79+
echo "- **Head branch:** $env:HEAD_REF" >> $env:GITHUB_STEP_SUMMARY
80+
echo "- **Target branch:** $env:BASE_REF" >> $env:GITHUB_STEP_SUMMARY
81+
echo "- **Restriction:** Release-preview branches can only merge to other release-preview branches" >> $env:GITHUB_STEP_SUMMARY
82+
83+
exit 1
84+
}
85+
# For other targets (including release-preview-*), check name matching
86+
else {
87+
if ($env:HEAD_REF -like "*$env:BASE_REF*") {
88+
Write-Host "✅ Merge allowed: Head branch '$env:HEAD_REF' contains base branch name '$env:BASE_REF'"
89+
echo "# ✅ Merge Check Passed" >> $env:GITHUB_STEP_SUMMARY
90+
echo "Head branch **$env:HEAD_REF** is allowed to merge to **$env:BASE_REF**." >> $env:GITHUB_STEP_SUMMARY
91+
} else {
92+
Write-Host "❌ MERGE BLOCKED: Release-preview branch name doesn't contain target branch name"
93+
Write-Host ""
94+
Write-Host "This pull request is attempting to merge from '$env:HEAD_REF'"
95+
Write-Host "to '$env:BASE_REF', but the head branch name doesn't contain the target name."
96+
Write-Host ""
97+
98+
# Set job summary for GitHub UI
99+
echo "# 🚫 Merge Blocked - Name Mismatch" >> $env:GITHUB_STEP_SUMMARY
100+
echo "" >> $env:GITHUB_STEP_SUMMARY
101+
echo "Release-preview branch name must contain target branch name." >> $env:GITHUB_STEP_SUMMARY
102+
echo "" >> $env:GITHUB_STEP_SUMMARY
103+
echo "## Restriction Details" >> $env:GITHUB_STEP_SUMMARY
104+
echo "- **Head branch:** $env:HEAD_REF" >> $env:GITHUB_STEP_SUMMARY
105+
echo "- **Target branch:** $env:BASE_REF" >> $env:GITHUB_STEP_SUMMARY
106+
107+
exit 1
108+
}
109+
}
110+
} else {
111+
Write-Host "✅ Merge allowed: Non-release-preview branch '$env:HEAD_REF' has no restrictions"
112+
echo "# ✅ Merge Check Passed" >> $env:GITHUB_STEP_SUMMARY
113+
echo "Head branch **$env:HEAD_REF** is allowed to merge to **$env:BASE_REF**." >> $env:GITHUB_STEP_SUMMARY
114+
}

docs/connect/ado-net/sql/azure-active-directory-authentication.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Describes how to use supported Microsoft Entra authentication modes
44
author: David-Engel
55
ms.author: davidengel
66
ms.reviewer: davidengel
7-
ms.date: 06/09/2025
7+
ms.date: 01/16/2026
88
ms.service: sql
99
ms.subservice: connectivity
1010
ms.topic: integration
@@ -28,7 +28,7 @@ Microsoft Entra authentication uses identities in Microsoft Entra ID to access d
2828

2929
When you set the `Authentication` connection property in the connection string, the client can choose a preferred Microsoft Entra authentication mode according to the value provided:
3030

31-
- The earliest **Microsoft.Data.SqlClient** version supports `Active Directory Password` for .NET Framework, .NET Core, and .NET Standard. It also supports `Active Directory Integrated` authentication and `Active Directory Interactive` authentication for .NET Framework.
31+
- The earliest **Microsoft.Data.SqlClient** version supports `Active Directory Password` [DEPRECATED] for .NET Framework, .NET Core, and .NET Standard. It also supports `Active Directory Integrated` authentication and `Active Directory Interactive` authentication for .NET Framework.
3232
- Starting with **Microsoft.Data.SqlClient** 2.0.0, support for `Active Directory Integrated` authentication and `Active Directory Interactive` authentication is extended across .NET Framework, .NET Core, and .NET Standard.
3333

3434
A new `Active Directory Service Principal` authentication mode is also added in SqlClient 2.0.0. It makes use of the client ID and secret of a service principal identity to accomplish authentication.
@@ -44,19 +44,21 @@ When the application is connecting to Azure SQL data sources by using Microsoft
4444

4545
| Value | Description | Microsoft.Data.SqlClient version |
4646
|:--|:--|:--:|
47-
| Active Directory Password | Authenticate with a Microsoft Entra identity's username and password | 1.0+ |
4847
| Active Directory Integrated | Authenticate with a Microsoft Entra identity by using Integrated Windows Authentication (IWA) | 2.0.0+<sup>1</sup> |
4948
| Active Directory Interactive | Authenticate with a Microsoft Entra identity by using interactive authentication | 2.0.0+<sup>1</sup> |
5049
| Active Directory Service Principal | Authenticate with a Microsoft Entra service principal, using its client ID and secret | 2.0.0+ |
5150
| Active Directory Device Code Flow | Authenticate with a Microsoft Entra identity by using Device Code Flow mode | 2.1.0+ |
5251
| Active Directory Managed Identity, <br>Active Directory MSI | Authenticate using a Microsoft Entra system-assigned or user-assigned managed identity | 2.1.0+ |
5352
| Active Directory Default | Authenticate with a Microsoft Entra identity by using password-less and non-interactive mechanisms including managed identities, Visual Studio Code, Visual Studio, Azure CLI, etc. | 3.0.0+ |
5453
| Active Directory Workload Identity | Authenticate with a Microsoft Entra identity by using a federated User Assigned Managed Identity to connect to SQL Database from Azure client environments that are enabled for Workload Identity. | 5.2.0+ |
54+
| Active Directory Password [DEPRECATED] | Authenticate with a Microsoft Entra identity's username and password.<br/><br/>Active Directory Password is deprecated. For more information, see [Using password authentication](#using-password-authentication). | 1.0+ |
5555

5656
<sup>1</sup> Before **Microsoft.Data.SqlClient** 2.0.0, `Active Directory Integrated`, and `Active Directory Interactive` authentication modes are supported only on .NET Framework.
5757

5858
## Using password authentication
5959

60+
[!INCLUDE [entra-password-auth-deprecation](../../../includes/entra-password-auth-deprecation.md)]
61+
6062
`Active Directory Password` authentication mode supports authentication to Azure data sources with Microsoft Entra ID for native or federated Microsoft Entra users. When you're using this mode, user credentials must be provided in the connection string. The following example shows how to use `Active Directory Password` authentication.
6163

6264
```csharp
@@ -332,7 +334,7 @@ The following example displays how to use a custom callback when `Active Directo
332334

333335
[!code-csharp [AADAuthenticationCustomDeviceFlowCallback#1](~/../sqlclient/doc/samples/AADAuthenticationCustomDeviceFlowCallback.cs#1)]
334336

335-
With a customized `ActiveDirectoryAuthenticationProvider` class, a user-defined application client ID can be passed to SqlClient when a supported Microsoft Entra authentication mode is in use. Supported Microsoft Entra authentication modes include `Active Directory Password`, `Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Service Principal`, and `Active Directory Device Code Flow`.
337+
With a customized `ActiveDirectoryAuthenticationProvider` class, a user-defined application client ID can be passed to SqlClient when a supported Microsoft Entra authentication mode is in use. Supported Microsoft Entra authentication modes include `Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Service Principal`, `Active Directory Device Code Flow`, and `Active Directory Password` [DEPRECATED].
336338

337339
The application client ID is also configurable via `SqlAuthenticationProviderConfigurationSection` or `SqlClientAuthenticationProviderConfigurationSection`. The configuration property `applicationClientId` applies to .NET Framework 4.6+ and .NET Core 2.1+.
338340

0 commit comments

Comments
 (0)