Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<ItemGroup>
<PackageVersion Include="Azure.Core" Version="1.51.1" />
<PackageVersion Include="Microsoft.Identity.Client" Version="4.83.0" />
<PackageVersion Include="Microsoft.Identity.Client" Version="4.84.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>

Expand Down Expand Up @@ -97,6 +97,7 @@

<ItemGroup>
<PackageVersion Include="Azure.Identity" Version="1.18.0" />
<PackageVersion Include="Microsoft.Identity.Client.Broker" Version="4.84.2" />
</ItemGroup>

<!-- ===================================================================== -->
Expand Down
34 changes: 34 additions & 0 deletions doc/apps/AzureSqlConnector/AzureSqlConnector.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<!--
WinForms WAM-broker sample. Targets net481 (for callers still on .NET Framework)
plus net10.0-windows (for modern .NET) so the sample exercises both API
flavors: the legacy SetIWin32WindowFunc path on net481 and the modern
SetParentActivityOrWindowFunc path on net10. The net10.0-windows TFM
restores and builds cleanly on Linux/macOS hosts even though the resulting
binary only runs on Windows, so the sample no longer needs a separate
no-op cross-platform fallback.
-->
<PropertyGroup>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net481;net10.0-windows</TargetFrameworks>
<TargetFramework Condition="'$(OS)' != 'Windows_NT'">net10.0-windows</TargetFramework>
<!-- Required to build the net*-windows TFM on Linux/macOS (e.g. CodeQL); without
this, the SDK fails with NETSDK1100. The produced binary still only runs on Windows. -->
<EnableWindowsTargeting Condition="'$(OS)' != 'Windows_NT'">true</EnableWindowsTargeting>
<OutputType>WinExe</OutputType>
<RootNamespace>Microsoft.Data.SqlClient.Samples.AzureSqlConnector</RootNamespace>
<AssemblyName>AzureSqlConnector</AssemblyName>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>latest</LangVersion>
<Nullable>disable</Nullable>
<Platforms>AnyCPU</Platforms>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Microsoft.Data.SqlClient.Extensions\Azure\src\Azure.csproj" />
<ProjectReference Include="..\..\..\src\Microsoft.Data.SqlClient\src\Microsoft.Data.SqlClient.csproj" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions doc/apps/AzureSqlConnector/IdentityQuery.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace Microsoft.Data.SqlClient.Samples.AzureSqlConnector
{
/// <summary>
/// Shared SQL text used by both <see cref="MainForm"/> (UI-thread variant) and
/// <see cref="MainFormWorker"/> (worker-thread variant). Keeping the literal in one place
/// avoids drift when one variant gains a new column.
/// </summary>
internal static class IdentityQuery
{
public const string CommandText =
"SELECT " +
" SUSER_SNAME() AS LoggedInUser, " +
" ORIGINAL_LOGIN() AS OriginalLogin, " +
" USER_NAME() AS DatabaseUser, " +
" SUSER_ID() AS LoginSid, " +
" DB_NAME() AS DatabaseName, " +
" @@SERVERNAME AS ServerName, " +
" HOST_NAME() AS ClientHost, " +
" APP_NAME() AS AppName, " +
" SESSION_USER AS SessionUser, " +
" CURRENT_USER AS CurrentUser, " +
" @@SPID AS SessionId, " +
" @@VERSION AS ServerVersion;";
}
}
Loading
Loading