Skip to content

Commit

Permalink
1ES Migration (#3557)
Browse files Browse the repository at this point in the history
* Refactor release-cli.yml to stage templates

* Refactor for 1ES

* Insert syntax

* Parameters syntax

* Proper parameter syntax

* Parameter testing...

* convertToJson

* Revert syntax testing

* Publishing

* s

* Revert template

* image

* Matrix expansion

* Formatting

* Variables

* Spelling

* Pool info

* Tabbing

* macos-12

* Notes

* Insert syntax

* Log matrix parts

* Syntax

* No variables

* Mac images, also swap formatting

* Remove BaseUrl

* Formatting, chomping

* Test un-chomped

* Tabbing

* Not a variable

* Uncomment

* Cred Scan Suppression

* Bring New-TestResources.ps1 up to date

* CredScan suppressions

* Docker install on macOS

* Skip live test

* Task version

* s

* Test in short mode

* M365

* Do not use variables for OS

* Fix pool.os in other places

* Linux ARM

* ImageKey

* Setup Golang in ARM64

* aarch64

* PreSteps, Host Arch

* Wire up HostArchitecture

* Wire up HostArchitecture

* sudo

* Exclude _manifest, Skip live tests

* Template wiring

* fix YAML

* Artifact staging

* workingDirectory

* Build output

* standalone.json

* Add options suggested by BinSkim

* Parameters for release

* /Qspectre

* Variable expansion

* vcxproj configs

* vscode 1ES migration

* ImageKey

* vmImage/image

* Set shield artifact condition

* image

* string true

* s

* image

* outputs

* Ensure variables

* Remove ARM64 linux

* Refactor deployments

* deployments need to consume artifacts

* checkout

* Inputs

* Names

* Expand variables

* Re-enable deployments

* Migrate repoman pipeline to 1ES

* templateContext

* Test change

* use env vars in script

* do not skip az login

* no condition

* Address TODOs

* Revert NOTICE.txt

* Review feedback, spacing

* Re-add Skip.LiveTest condition to azd-login.yml

---------

Co-authored-by: Victor Vazquez <[email protected]>
  • Loading branch information
danieljurek and vhvb1989 authored Mar 25, 2024
1 parent 8929197 commit 87610eb
Show file tree
Hide file tree
Showing 26 changed files with 2,700 additions and 2,133 deletions.
169 changes: 95 additions & 74 deletions cli/installer/windows-actions/actions.vcxproj
Original file line number Diff line number Diff line change
@@ -1,74 +1,95 @@
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\WixToolset.WcaUtil.4.0.0\build\WixToolset.WcaUtil.props" Condition="Exists('..\packages\WixToolset.WcaUtil.4.0.0\build\WixToolset.WcaUtil.props')" />
<Import Project="..\packages\WixToolset.DUtil.4.0.0\build\WixToolset.DUtil.props" Condition="Exists('..\packages\WixToolset.DUtil.4.0.0\build\WixToolset.DUtil.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{51D5518D-64BD-43C6-9A8A-91A5936BC2D6}</ProjectGuid>
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<OutDir>bin/$(Platform)/$(Configuration)/</OutDir>
<IntDir>obj/$(Platform)/$(Configuration)/</IntDir>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebug</RuntimeLibrary>
<RuntimeLibrary Condition="'$(Configuration)'=='Release'">MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalDependencies>msi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>actions.def</ModuleDefinitionFile>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="textfile.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="actions.def" />
<None Include="actions.wxs" CopyToOutputDirectory="always" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\WixToolset.DUtil.4.0.0\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WixToolset.DUtil.4.0.0\build\WixToolset.DUtil.props'))" />
<Error Condition="!Exists('..\packages\WixToolset.WcaUtil.4.0.0\build\WixToolset.WcaUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WixToolset.WcaUtil.4.0.0\build\WixToolset.WcaUtil.props'))" />
</Target>
</Project>
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\WixToolset.WcaUtil.4.0.0\build\WixToolset.WcaUtil.props" Condition="Exists('..\packages\WixToolset.WcaUtil.4.0.0\build\WixToolset.WcaUtil.props')" />
<Import Project="..\packages\WixToolset.DUtil.4.0.0\build\WixToolset.DUtil.props" Condition="Exists('..\packages\WixToolset.DUtil.4.0.0\build\WixToolset.DUtil.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{51D5518D-64BD-43C6-9A8A-91A5936BC2D6}</ProjectGuid>
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<OutDir>bin/$(Platform)/$(Configuration)/</OutDir>
<IntDir>obj/$(Platform)/$(Configuration)/</IntDir>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebug</RuntimeLibrary>
<RuntimeLibrary Condition="'$(Configuration)'=='Release'">MultiThreaded</RuntimeLibrary>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Guard</ControlFlowGuard>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/ZH:SHA_256 /GUARD:CF %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/ZH:SHA_256 /GUARD:CF %(AdditionalOptions)</AdditionalOptions>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level3</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level3</WarningLevel>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/ZH:SHA_256 /GUARD:CF %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/ZH:SHA_256 /GUARD:CF %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>msi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>actions.def</ModuleDefinitionFile>
<SubSystem>Windows</SubSystem>
<CETCompat Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CETCompat>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/GUARD:CF %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="textfile.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="actions.def" />
<None Include="actions.wxs" CopyToOutputDirectory="always" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\WixToolset.DUtil.4.0.0\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WixToolset.DUtil.4.0.0\build\WixToolset.DUtil.props'))" />
<Error Condition="!Exists('..\packages\WixToolset.WcaUtil.4.0.0\build\WixToolset.WcaUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WixToolset.WcaUtil.4.0.0\build\WixToolset.WcaUtil.props'))" />
</Target>
</Project>
12 changes: 12 additions & 0 deletions eng/CredScanSuppression.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"tool": "Credential Scanner",
"suppressions": [
{
"file": [
"cli/azd/pkg/auth/testdata/certificate.pem",
"eng/common/testproxy/dotnet-devcert.pfx"
],
"_justification": "File contains private key used by test code."
}
]
}
8 changes: 4 additions & 4 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ param (
[string] $Environment = 'AzureCloud',

[Parameter()]
[ValidateSet('test', 'perf')]
[ValidateSet('test', 'perf', 'stress-test')]
[string] $ResourceType = 'test',

[Parameter()]
Expand Down Expand Up @@ -196,14 +196,14 @@ function NewServicePrincipalWrapper([string]$subscription, [string]$resourceGrou
# Submitting a password credential object without specifying a password will result in one being generated on the server side.
$password = New-Object -TypeName "Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential"
$password.DisplayName = "Password for $displayName"
$credential = Retry { New-AzADSpCredential -PasswordCredentials $password -ServicePrincipalObject $servicePrincipal }
$credential = Retry { New-AzADSpCredential -PasswordCredentials $password -ServicePrincipalObject $servicePrincipal -ErrorAction 'Stop' }
$spPassword = ConvertTo-SecureString $credential.SecretText -AsPlainText -Force
$appId = $servicePrincipal.AppId
} else {
Write-Verbose "Creating service principal credential via MS Graph API"
# In 5.2.0 the password credential issue was fixed (see https://github.com/Azure/azure-powershell/pull/16690) but the
# parameter set was changed making the above call fail due to a missing ServicePrincipalId parameter.
$credential = Retry { $servicePrincipal | New-AzADSpCredential }
$credential = Retry { $servicePrincipal | New-AzADSpCredential -ErrorAction 'Stop' }
$spPassword = ConvertTo-SecureString $credential.SecretText -AsPlainText -Force
$appId = $servicePrincipal.AppId
}
Expand Down Expand Up @@ -1119,4 +1119,4 @@ Run this in an Azure DevOps CI (with approrpiate variables configured) before
executing live tests. The script will output variables as secrets (to enable
log redaction).
#>
#>
Loading

0 comments on commit 87610eb

Please sign in to comment.