Skip to content
Merged
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
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<!-- Add packages, then highlight all lines and go to Edit > Advanced > Sort Lines -->
<ItemGroup>
<!-- Packages for the main MSAL code -->
<PackageVersion Include="Microsoft.Azure.Security.KeyGuardAttestation" Version="1.1.5" />
<PackageVersion Include="Microsoft.CodeAnalysis.RulesetToEditorconfigConverter" Version="3.3.3" PrivateAssets="All" />
<PackageVersion Include="Microsoft.CSharp" Version="4.5.0" />
<PackageVersion Include="Microsoft.Identity.Client.NativeInterop" Version="$(MSALRuntimeNativeInteropVersion)" IncludeAssets="all" />
Expand Down
20 changes: 17 additions & 3 deletions build/template-build-and-prep-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ steps:
Contents: '**/bin/**/**'
TargetFolder: '$(Build.SourcesDirectory)/WAM'

- task: CopyFiles@2
displayName: 'Copy Managed Identity DevApp Dlls'
inputs:
SourceFolder: 'tests\devapps\Managed Identity apps\ManagedIdentityAppVM'
Contents: '**\bin\**\*'
TargetFolder: '$(Build.SourcesDirectory)/ManagedIdentityAppVM'

- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: drop'
inputs:
Expand Down Expand Up @@ -112,6 +119,16 @@ steps:
$errors += "Failed to find Linux runtime files in : " + $SearchInFolder + $app + "`n";
}

# Managed Identity app runtime DLL check
$managedIdentityFolder = Join-Path $(Build.SourcesDirectory) 'ManagedIdentityAppVM'
$managedIdentityDll = Join-Path $managedIdentityFolder 'bin\Release\net8.0\runtimes\win-x64\native\AttestationClientLib.dll'

Write-Host "Checking: $managedIdentityDll"
if (-not (Test-Path -Path $managedIdentityDll -PathType Leaf))
{
$errors += "Failed to find AttestationClientLib.dll at: $managedIdentityDll`n"
}

#exit if there are errors
IF (![string]::IsNullOrWhitespace($errors))
{
Expand All @@ -123,6 +140,3 @@ steps:
{
Write-Host "File check complete. All msalruntime dlls are present."
}



Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<ProjectReference Include="..\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Security.KeyGuardAttestation" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(TargetFrameworkNetStandard)'">
<PackageReference Include="System.Security.Cryptography.Cng" />
</ItemGroup>
Expand All @@ -46,4 +50,4 @@
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- Optional toggle (override with /p:VerifyAttestationClientLib=false) -->
<VerifyAttestationClientLib Condition="'$(VerifyAttestationClientLib)' == ''">true</VerifyAttestationClientLib>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\src\client\Microsoft.Identity.Client.KeyAttestation\Microsoft.Identity.Client.KeyAttestation.csproj" />
<ProjectReference Include="..\..\..\..\src\client\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj" />
</ItemGroup>

<!-- Fail the build if the native runtime DLL isn't in the output -->
<Target Name="VerifyAttestationClientLib"
AfterTargets="CopyFilesToOutputDirectory"
Condition="'$(VerifyAttestationClientLib)' == 'true' and '$(Configuration)' == 'Release'">
<PropertyGroup>
<!-- Use forward slashes so it's safe cross-platform -->
<_AttestationClientLib>$(TargetDir)runtimes/win-x64/native/AttestationClientLib.dll</_AttestationClientLib>
</PropertyGroup>

<Message Importance="High" Text="Checking: $(_AttestationClientLib)" />
<Error Condition="!Exists('$(_AttestationClientLib)')"
Text="Failed to find AttestationClientLib.dll at '$(_AttestationClientLib)'. TargetDir='$(TargetDir)'." />
</Target>

</Project>