Skip to content

Commit 39aa1e4

Browse files
authored
Update tooling for .NET 8 (Azure#3018)
1 parent 2391c3b commit 39aa1e4

File tree

15 files changed

+243
-42
lines changed

15 files changed

+243
-42
lines changed

.config/dotnet-tools.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"gitversion.tool": {
6+
"version": "5.12.0",
7+
"commands": [
8+
"dotnet-gitversion"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.devcontainer/Dockerfile

-12
This file was deleted.

.devcontainer/container-build.ps1

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@
55
# This is run during container creation.
66

77
# Install Python 3 dependencies
8-
sudo apt install python3-pip -y
8+
sudo apt-get update
9+
sudo apt-get install dotnet-sdk-8.0 -y
10+
sudo apt-get install python3-pip -y
911
sudo python3 -m pip install --upgrade pip
1012
sudo python3 -m pip install wheel
1113

14+
# Install Python packages
15+
pip install -r requirements-docs.txt
16+
17+
# Restore .NET packages
18+
dotnet restore
19+
1220
# Install PowerShell dependencies
1321
$ProgressPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue;
1422
if ($Null -eq (Get-PackageProvider -Name NuGet -ErrorAction Ignore)) {

.devcontainer/devcontainer.json

+17-19
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
13
{
24
"name": "PSRule for Azure Developer Codespace",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
37
"customizations": {
48
"vscode": {
59
"settings": {
610
"terminal.integrated.defaultProfile.linux": "pwsh",
711
"terminal.integrated.profiles.linux": {
812
"pwsh": {
9-
"path": "/opt/microsoft/powershell/7/pwsh"
13+
"path": "/usr/local/bin/pwsh"
1014
}
11-
},
12-
"powershell.powerShellDefaultVersion": "PowerShell"
15+
}
1316
},
1417
"extensions": [
15-
"ms-dotnettools.vscode-dotnet-runtime",
1618
"ms-dotnettools.csdevkit",
1719
"ms-vscode.powershell",
1820
"ms-azuretools.vscode-bicep",
@@ -21,29 +23,25 @@
2123
"github.vscode-github-actions",
2224
"bewhite.psrule-vscode-preview",
2325
"davidanson.vscode-markdownlint",
26+
"streetsidesoftware.code-spell-checker",
2427
"eamodio.gitlens",
25-
"streetsidesoftware.code-spell-checker"
28+
"ms-sarifvscode.sarif-viewer",
29+
"github.vscode-github-actions"
2630
]
2731
}
2832
},
2933
"features": {
30-
"ghcr.io/devcontainers/features/github-cli": {
34+
"ghcr.io/devcontainers/features/github-cli:1": {
3135
"version": "latest"
3236
},
33-
"ghcr.io/devcontainers/features/powershell": {
37+
"ghcr.io/devcontainers/features/powershell:1": {
38+
"version": "latest"
39+
},
40+
"ghcr.io/devcontainers/features/python:1": {
3441
"version": "latest"
3542
}
3643
},
37-
"onCreateCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1",
38-
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1",
39-
"build": {
40-
"dockerfile": "Dockerfile",
41-
"args": {
42-
"VARIANT": "7.0-bullseye-slim"
43-
}
44-
},
45-
"remoteUser": "vscode",
46-
"forwardPorts": [
47-
8000
48-
]
44+
"onCreateCommand": "sudo chown -R vscode:vscode /opt/microsoft/powershell/7/pwsh && sudo chmod u+x /opt/microsoft/powershell/7/pwsh && wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb && sudo apt-get update && sudo apt-get install dotnet-sdk-8.0 -y && sudo apt-get install python3-pip -y",
45+
"updateContentCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1",
46+
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1"
4947
}

.github/workflows/build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
env:
1717
DOTNET_NOLOGO: true
1818
DOTNET_CLI_TELEMETRY_OPTOUT: true
19-
DOTNET_VERSION: 7.x
19+
DOTNET_VERSION: 8.x
2020

2121
jobs:
2222
build:

docs/CHANGELOG-v1.md

+5
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers
2929

3030
## Unreleased
3131

32+
What's changed since pre-release v1.39.0-B0029:
33+
3234
- New rules:
3335
- Virtual Machine:
3436
- Verify that virtual machines does not have public IPs attached by @BenjaminEngeset.
3537
[#11](https://github.com/Azure/PSRule.Rules.Azure/issues/11)
3638
- Virtual Machine Scale Sets:
3739
- Verify that virtual machine scale set instances does not have public IPs attached by @BenjaminEngeset.
3840
[#3014](https://github.com/Azure/PSRule.Rules.Azure/issues/3014)
41+
- Engineering:
42+
- Bump development tools to .NET 8.0 SDK by @BernieWhite.
43+
[#3017](https://github.com/Azure/PSRule.Rules.Azure/issues/3017)
3944

4045
## v1.39.0-B0029 (pre-release)
4146

docs/install.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ This build script will compile the module and documentation then output the resu
259259
| Operating System | Tool | Overview | Installation Link |
260260
| ---------------- | ---- | -------- | ----------------- |
261261
| Windows | Windows PowerShell | Support for version 5.1 with .NET Framework 4.7.2 or greater. | [link](https://dotnet.microsoft.com/download/dotnet-framework/net48) |
262-
| Windows, MacOS, Linux | PowerShell | Version 7.3 or greater is support. | [link](https://github.com/PowerShell/PowerShell#get-powershell) |
262+
| Windows, MacOS, Linux | PowerShell | Version 7.4 or greater is support. | [link](https://github.com/PowerShell/PowerShell#get-powershell) |
263263
| - | - | Multiple PowerShell modules are required (PlatyPS, Pester, PSScriptAnalyzer, PowerShellGet, PackageManagement, InvokeBuild, PSRule). | Installed when you run the `build.ps1` script |
264-
| - | .NET | .NET SDK v7 is required. | [link](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) |
264+
| - | .NET | .NET SDK v8 is required. | [link](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) |
265265
| - | Bicep CLI | PSRule depends on the Bicep CLI to expand Bicep modules to ARM | [link](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/install) |
266266

267267
The following dependencies will be automatically installed if the required versions are not present:

global.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.400",
4+
"rollForward": "latestFeature"
5+
}
6+
}

src/PSRule.Common.props

+5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
<PropertyGroup>
55
<TargetFramework>netstandard2.0</TargetFramework>
66
<LangVersion>9.0</LangVersion>
7+
<!-- <Nullable>enable</Nullable> -->
8+
<!-- <ImplicitUsings>enable</ImplicitUsings> -->
79
<NeutralLanguage>en-US</NeutralLanguage>
810
<DebugSymbols>true</DebugSymbols>
911
<DebugType>portable</DebugType>
1012
<IncludeSymbols>true</IncludeSymbols>
1113
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1214
<EmbedUntrackedSources>true</EmbedUntrackedSources>
15+
<!-- <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> -->
1316
<GenerateDocumentationFile>true</GenerateDocumentationFile>
17+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
18+
<RestoreLockedMode Condition="'$(CI)' == 'true' And '$(GITHUB_ACTIONS)' != 'true'">true</RestoreLockedMode>
1419
</PropertyGroup>
1520

1621
<!-- Package metadata -->

src/PSRule.Rules.Azure.Benchmark/PSRule.Rules.Azure.Benchmark.csproj

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<PlatformTarget>AnyCPU</PlatformTarget>
77
<ProjectGuid>{9bb90abe-25f9-4110-af9f-149b0618b2a0}</ProjectGuid>
88
<RepositoryUrl>https://github.com/Azure/PSRule.Rules.Azure</RepositoryUrl>
@@ -19,9 +19,11 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.12" />
23-
<PackageReference Include="System.Management.Automation" Version="7.3.12" />
22+
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.4" />
23+
<PackageReference Include="System.Management.Automation" Version="7.4.4" />
2424
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
25+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
26+
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
2527
</ItemGroup>
2628

2729
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">

src/PSRule.Rules.Azure.BuildTool/PSRule.Rules.Azure.BuildTool.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\PSRule.Common.props" />
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ProjectGuid>{218b2d45-a2bd-4966-9b9f-4064cd68ba8a}</ProjectGuid>
77
<EnableNuget>false</EnableNuget>
88
<IsPackable>false</IsPackable>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
"net8.0": {
5+
"Microsoft.SourceLink.GitHub": {
6+
"type": "Direct",
7+
"requested": "[8.0.0, )",
8+
"resolved": "8.0.0",
9+
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
10+
"dependencies": {
11+
"Microsoft.Build.Tasks.Git": "8.0.0",
12+
"Microsoft.SourceLink.Common": "8.0.0"
13+
}
14+
},
15+
"Newtonsoft.Json": {
16+
"type": "Direct",
17+
"requested": "[13.0.3, )",
18+
"resolved": "13.0.3",
19+
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
20+
},
21+
"System.CommandLine": {
22+
"type": "Direct",
23+
"requested": "[2.0.0-beta1.21308.1, )",
24+
"resolved": "2.0.0-beta1.21308.1",
25+
"contentHash": "X8qLygjyktfmcNMNFekMkumyaTblJmkH3BBbKiQlk4FvJfp613gkMKrA0CNqLUT9tEfLcm3XMzAbsiYFwM8zbQ==",
26+
"dependencies": {
27+
"Microsoft.CSharp": "4.4.1",
28+
"system.memory": "4.5.4"
29+
}
30+
},
31+
"Microsoft.Build.Tasks.Git": {
32+
"type": "Transitive",
33+
"resolved": "8.0.0",
34+
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
35+
},
36+
"Microsoft.CSharp": {
37+
"type": "Transitive",
38+
"resolved": "4.4.1",
39+
"contentHash": "A5hI3gk6WpcBI0QGZY6/d5CCaYUxJgi7iENn1uYEng+Olo8RfI5ReGVkjXjeu3VR3srLvVYREATXa2M0X7FYJA=="
40+
},
41+
"Microsoft.SourceLink.Common": {
42+
"type": "Transitive",
43+
"resolved": "8.0.0",
44+
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
45+
},
46+
"System.Memory": {
47+
"type": "Transitive",
48+
"resolved": "4.5.4",
49+
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
50+
}
51+
}
52+
}
53+
}
+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
".NETStandard,Version=v2.0": {
5+
"Microsoft.CodeAnalysis.NetAnalyzers": {
6+
"type": "Direct",
7+
"requested": "[8.0.0, )",
8+
"resolved": "8.0.0",
9+
"contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg=="
10+
},
11+
"Microsoft.SourceLink.GitHub": {
12+
"type": "Direct",
13+
"requested": "[8.0.0, )",
14+
"resolved": "8.0.0",
15+
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
16+
"dependencies": {
17+
"Microsoft.Build.Tasks.Git": "8.0.0",
18+
"Microsoft.SourceLink.Common": "8.0.0"
19+
}
20+
},
21+
"NETStandard.Library": {
22+
"type": "Direct",
23+
"requested": "[2.0.3, )",
24+
"resolved": "2.0.3",
25+
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
26+
"dependencies": {
27+
"Microsoft.NETCore.Platforms": "1.1.0"
28+
}
29+
},
30+
"Newtonsoft.Json": {
31+
"type": "Direct",
32+
"requested": "[13.0.3, )",
33+
"resolved": "13.0.3",
34+
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
35+
},
36+
"PowerShellStandard.Library": {
37+
"type": "Direct",
38+
"requested": "[5.1.1, )",
39+
"resolved": "5.1.1",
40+
"contentHash": "e31xJjG+Kjbv6YF3Yq6D4Dl3or8v7LrNF41k3CXrWozW6hR1zcOe5KYuZJaGSiAgLnwP8wcW+I3+IWEzMPZKXQ=="
41+
},
42+
"YamlDotNet": {
43+
"type": "Direct",
44+
"requested": "[11.2.1, )",
45+
"resolved": "11.2.1",
46+
"contentHash": "tBt8K+korVfrjH9wyDEhiLKxbs8qoLCLIFwvYgkSUuMC9//w3z0cFQ8LQAI/5MCKq+BMil0cfRTRvPeE7eXhQw=="
47+
},
48+
"Microsoft.Build.Tasks.Git": {
49+
"type": "Transitive",
50+
"resolved": "8.0.0",
51+
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
52+
},
53+
"Microsoft.NETCore.Platforms": {
54+
"type": "Transitive",
55+
"resolved": "1.1.0",
56+
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
57+
},
58+
"Microsoft.SourceLink.Common": {
59+
"type": "Transitive",
60+
"resolved": "8.0.0",
61+
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
62+
}
63+
}
64+
}
65+
}

src/SDK/packages.lock.json

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
".NETStandard,Version=v2.0": {
5+
"Microsoft.SourceLink.GitHub": {
6+
"type": "Direct",
7+
"requested": "[8.0.0, )",
8+
"resolved": "8.0.0",
9+
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
10+
"dependencies": {
11+
"Microsoft.Build.Tasks.Git": "8.0.0",
12+
"Microsoft.SourceLink.Common": "8.0.0"
13+
}
14+
},
15+
"NETStandard.Library": {
16+
"type": "Direct",
17+
"requested": "[2.0.3, )",
18+
"resolved": "2.0.3",
19+
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
20+
"dependencies": {
21+
"Microsoft.NETCore.Platforms": "1.1.0"
22+
}
23+
},
24+
"Microsoft.Build.Tasks.Git": {
25+
"type": "Transitive",
26+
"resolved": "8.0.0",
27+
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
28+
},
29+
"Microsoft.NETCore.Platforms": {
30+
"type": "Transitive",
31+
"resolved": "1.1.0",
32+
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
33+
},
34+
"Microsoft.SourceLink.Common": {
35+
"type": "Transitive",
36+
"resolved": "8.0.0",
37+
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
38+
},
39+
"Newtonsoft.Json": {
40+
"type": "Transitive",
41+
"resolved": "13.0.3",
42+
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
43+
},
44+
"YamlDotNet": {
45+
"type": "Transitive",
46+
"resolved": "11.2.1",
47+
"contentHash": "tBt8K+korVfrjH9wyDEhiLKxbs8qoLCLIFwvYgkSUuMC9//w3z0cFQ8LQAI/5MCKq+BMil0cfRTRvPeE7eXhQw=="
48+
},
49+
"Microsoft.PSRule.Rules.Azure.Core": {
50+
"type": "Project",
51+
"dependencies": {
52+
"Newtonsoft.Json": "[13.0.3, )",
53+
"YamlDotNet": "[11.2.1, )"
54+
}
55+
}
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)