diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 49ac8e66..8d8ff3ff 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "powershell": { - "version": "7.4.2", + "version": "7.4.3", "commands": [ "pwsh" ] @@ -21,4 +21,4 @@ ] } } -} +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 69599b87..3f1c5ed9 100644 --- a/.gitignore +++ b/.gitignore @@ -352,3 +352,6 @@ MigrationBackup/ # mac-created file to track user view preferences for a directory .DS_Store + +# Analysis results +*.sarif diff --git a/Directory.Build.props b/Directory.Build.props index cbff8e2b..77fa90ba 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,7 +6,6 @@ $(RepoRootPath)obj\$([MSBuild]::MakeRelative($(RepoRootPath), $(MSBuildProjectDirectory)))\ $(RepoRootPath)bin\$(MSBuildProjectName)\ $(RepoRootPath)bin\Packages\$(Configuration)\NuGet\ - 12 enable enable latest diff --git a/Directory.Build.targets b/Directory.Build.targets index 5f8e2a6d..ac2fd63d 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,9 @@ + + 12 + 16.9 + diff --git a/azure-pipelines/Archive-SourceCode.ps1 b/azure-pipelines/Archive-SourceCode.ps1 index 73f52abd..0360a14f 100644 --- a/azure-pipelines/Archive-SourceCode.ps1 +++ b/azure-pipelines/Archive-SourceCode.ps1 @@ -35,7 +35,7 @@ .PARAMETER SourceCodeArchivalUri The URI to POST the source code archival request to. This value will typically come automatically by a variable group associated with your pipeline. - You can also look it up at https://dpsrequestforms.azurewebsites.net/#/help -> SCA Request Help -> SCA API Help -> Description + You can also look it up at https://dpsopsrequestforms.azurewebsites.net/#/help -> SCA Request Help -> SCA API Help -> Description #> [CmdletBinding(SupportsShouldProcess = $true, PositionalBinding = $false)] param ( @@ -76,7 +76,9 @@ param ( [Parameter()] [string]$ServerPath = '', [Parameter()] - [Uri]$SourceCodeArchivalUri = $env:SOURCECODEARCHIVALURI + [Uri]$SourceCodeArchivalUri = $env:SOURCECODEARCHIVALURI, + [Parameter(Mandatory = $true)] + [string]$AccessToken ) function Invoke-Git() { @@ -199,9 +201,13 @@ if ($PSCmdlet.ShouldProcess('source archival request', 'post')) { exit 1 } + $headers = @{ + 'Authorization' = "Bearer $AccessToken" + } + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - $Response = Invoke-WebRequest -Uri $SourceCodeArchivalUri -Method POST -Body $RequestJson -ContentType "application/json" -UseBasicParsing -SkipHttpErrorCheck + $Response = Invoke-WebRequest -Uri $SourceCodeArchivalUri -Method POST -Headers $headers -Body $RequestJson -ContentType "application/json" -UseBasicParsing -SkipHttpErrorCheck Write-Host "Status Code : " -NoNewline if ($Response.StatusCode -eq 200) { Write-Host $Response.StatusCode -ForegroundColor Green diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml index 12b4d0c9..f5b4781e 100644 --- a/azure-pipelines/archive-sourcecode.yml +++ b/azure-pipelines/archive-sourcecode.yml @@ -63,7 +63,16 @@ extends: - powershell: azure-pipelines/variables/_pipelines.ps1 failOnStderr: true displayName: ⚙ Set pipeline variables based on source - - powershell: > + - task: AzureCLI@2 + displayName: 🔏 Authenticate with WIF service connection + inputs: + azureSubscription: VS Core Source Code Archival + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | + $accessToken = az account get-access-token --query accessToken --resource api://177cf50a-4bf5-4481-8b7e-f32900dfc8e6 -o tsv + Write-Host "##vso[task.setvariable variable=scaToken;issecret=true]$accessToken" + - pwsh: > $TeamAlias = '$(TeamEmail)'.Substring(0, '$(TeamEmail)'.IndexOf('@')) azure-pipelines/Archive-SourceCode.ps1 @@ -73,6 +82,7 @@ extends: -ProductName '$(SymbolsFeatureName)' -ProductLanguage English -Notes '${{ parameters.notes }}' + -AccessToken '$(scaToken)' -Verbose -WhatIf:$${{ parameters.whatif }} displayName: 🗃️ Submit archival request diff --git a/azure-pipelines/microbuild.after.yml b/azure-pipelines/microbuild.after.yml index 34bdb452..67f43b2c 100644 --- a/azure-pipelines/microbuild.after.yml +++ b/azure-pipelines/microbuild.after.yml @@ -11,7 +11,7 @@ steps: displayName: 🔍 Verify Signed Files inputs: TargetFolders: | - $(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration)/NuGet + $(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration) condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) - ${{ if parameters.IsOptProf }}: diff --git a/src/AssemblyInfo.vb b/src/AssemblyInfo.vb new file mode 100644 index 00000000..75fe6ea4 --- /dev/null +++ b/src/AssemblyInfo.vb @@ -0,0 +1,6 @@ +' Copyright (c) Microsoft Corporation. All rights reserved. +' Licensed under the MIT license. See LICENSE file in the project root for full license information. + +Imports System.Runtime.InteropServices + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 07f41346..654f5c6d 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,7 +1,8 @@ - + +