diff --git a/build.data.json b/build.data.json index 4b93c135b..1d5463f54 100644 --- a/build.data.json +++ b/build.data.json @@ -5,7 +5,6 @@ "brew.dsc.resource.sh" ], "Linux": [ - "bicep.dsc.extension.json", "dsc", "dsc_default.settings.json", "dsc.settings.json", @@ -29,7 +28,6 @@ "sshd_config.dsc.resource.json" ], "macOS": [ - "bicep.dsc.extension.json", "dsc", "dsc_default.settings.json", "dsc.settings.json", @@ -55,7 +53,6 @@ "Windows": [ "appx.dsc.extension.json", "appx-discover.ps1", - "bicep.dsc.extension.json", "dsc.exe", "dsc_default.settings.json", "dsc.settings.json", @@ -177,17 +174,6 @@ ] } }, - { - "Name": "bicep", - "Kind": "Extension", - "RelativePath": "extensions/bicep", - "CopyFiles": { - "All": [ - "bicep.dsc.extension.json", - "bicepparams.dsc.extension.json" - ] - } - }, { "Name": "tree-sitter-dscexpression", "Kind": "Grammar", diff --git a/dsc/tests/dsc_extension_discover.tests.ps1 b/dsc/tests/dsc_extension_discover.tests.ps1 index fcb5693c4..af86d5cf2 100644 --- a/dsc/tests/dsc_extension_discover.tests.ps1 +++ b/dsc/tests/dsc_extension_discover.tests.ps1 @@ -24,37 +24,21 @@ Describe 'Discover extension tests' { $out = dsc extension list | ConvertFrom-Json $LASTEXITCODE | Should -Be 0 if ($IsWindows) { - $out.Count | Should -Be 4 -Because ($out | Out-String) - $out[0].type | Should -Be 'Microsoft.DSC.Extension/Bicep' + $out.Count | Should -Be 2 -Because ($out | Out-String) + $out[0].type | Should -Be 'Microsoft.Windows.Appx/Discover' $out[0].version | Should -Be '0.1.0' - $out[0].capabilities | Should -BeExactly @('import') + $out[0].capabilities | Should -BeExactly @('discover') $out[0].manifest | Should -Not -BeNullOrEmpty - $out[1].type | Should -BeExactly 'Microsoft.DSC.Extension/BicepParameters' + $out[1].type | Should -BeExactly 'Test/Discover' $out[1].version | Should -BeExactly '0.1.0' - $out[1].capabilities | Should -BeExactly @('import') + $out[1].capabilities | Should -BeExactly @('discover') $out[1].manifest | Should -Not -BeNullOrEmpty - $out[2].type | Should -Be 'Microsoft.Windows.Appx/Discover' - $out[2].version | Should -Be '0.1.0' - $out[2].capabilities | Should -BeExactly @('discover') - $out[2].manifest | Should -Not -BeNullOrEmpty - $out[3].type | Should -BeExactly 'Test/Discover' - $out[3].version | Should -BeExactly '0.1.0' - $out[3].capabilities | Should -BeExactly @('discover') - $out[3].manifest | Should -Not -BeNullOrEmpty } else { - $out.Count | Should -Be 3 -Because ($out | Out-String) - $out[0].type | Should -Be 'Microsoft.DSC.Extension/Bicep' - $out[0].version | Should -Be '0.1.0' - $out[0].capabilities | Should -BeExactly @('import') + $out.Count | Should -Be 1 -Because ($out | Out-String) + $out[0].type | Should -BeExactly 'Test/Discover' + $out[0].version | Should -BeExactly '0.1.0' + $out[0].capabilities | Should -BeExactly @('discover') $out[0].manifest | Should -Not -BeNullOrEmpty - $out[1].type | Should -BeExactly 'Microsoft.DSC.Extension/BicepParameters' - $out[1].version | Should -BeExactly '0.1.0' - $out[1].capabilities | Should -BeExactly @('import') - $out[1].manifest | Should -Not -BeNullOrEmpty - $out[2].type | Should -BeExactly 'Test/Discover' - $out[2].version | Should -BeExactly '0.1.0' - $out[2].capabilities | Should -BeExactly @('discover') - $out[2].manifest | Should -Not -BeNullOrEmpty } } diff --git a/extensions/bicep/.project.data.json b/extensions/bicep/.project.data.json deleted file mode 100644 index 21137eca0..000000000 --- a/extensions/bicep/.project.data.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Name": "bicep", - "Kind": "Extension", - "CopyFiles": { - "All": [ - "bicep.dsc.extension.json", - "bicepparams.dsc.extension.json" - ] - } -} diff --git a/extensions/bicep/bicep.dsc.extension.json b/extensions/bicep/bicep.dsc.extension.json deleted file mode 100644 index e2a1f71ad..000000000 --- a/extensions/bicep/bicep.dsc.extension.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "https://aka.ms/dsc/schemas/v3/bundled/extension/manifest.json", - "type": "Microsoft.DSC.Extension/Bicep", - "version": "0.1.0", - "description": "Enable passing Bicep file directly to DSC, but requires bicep executable to be available.", - "condition": "[not(equals(tryWhich('bicep'), null()))]", - "import": { - "fileExtensions": ["bicep"], - "executable": "bicep", - "args": [ - "build", - { - "fileArg": "" - }, - "--stdout" - ] - } -} diff --git a/extensions/bicep/bicep.tests.ps1 b/extensions/bicep/bicep.tests.ps1 deleted file mode 100644 index 12be8d1ba..000000000 --- a/extensions/bicep/bicep.tests.ps1 +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -BeforeDiscovery { - $foundBicep = if (Get-Command bicep -ErrorAction Ignore) { - $true - } else { - $false - } -} - -Describe 'Bicep extension tests' -Skip:(!$foundBicep) { - BeforeAll { - $dateVersion = @' -{ - "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", - "type": "Microsoft.DSC.Debug/Echo", - "version": "2025-08-27", - "description": "Echo resource for testing and debugging purposes", - "get": { - "executable": "dscecho", - "args": [ - { - "jsonInputArg": "--input", - "mandatory": true - } - ] - }, - "set": { - "executable": "dscecho", - "args": [ - { - "jsonInputArg": "--input", - "mandatory": true - } - ] - }, - "test": { - "executable": "dscecho", - "args": [ - { - "jsonInputArg": "--input", - "mandatory": true - } - ] - }, - "export": { - "executable": "dscecho", - "args": [ - { - "jsonInputArg": "--input", - "mandatory": true - } - ] - }, - "schema": { - "command": { - "executable": "dscecho" - } - } -} -'@ - Set-Content -Path "$TestDrive/dateVersion.dsc.resource.json" -Value $dateVersion - $env:DSC_RESOURCE_PATH = "$env:PATH" + [System.IO.Path]::PathSeparator + "$TestDrive" - } - - AfterAll { - $env:DSC_RESOURCE_PATH = $null - } - - It 'Example bicep file should work' { - $bicepFile = Resolve-Path -Path "$PSScriptRoot\..\..\dsc\examples\hello_world.dsc.bicep" - $out = dsc -l trace config get -f $bicepFile 2>$TestDrive/error.log | ConvertFrom-Json - $LASTEXITCODE | Should -Be 0 -Because (Get-Content -Path $TestDrive/error.log -Raw | Out-String) - $out.results[0].result.actualState.output | Should -BeExactly 'Hello, world!' - $bicepFile = $bicepFile.ToString().Replace('\', '\\') - (Get-Content -Path $TestDrive/error.log -Raw) | Should -Match "Importing file '$bicepFile' with extension 'Microsoft.DSC.Extension/Bicep'" - } - - It 'Invalid bicep file returns error' { - $bicepFile = "$TestDrive/invalid.bicep" - Set-Content -Path $bicepFile -Value @" -targetScope = 'invalidScope' - -resource invalid 'Microsoft.DSC.Extension/Bicep:1.0' = { - name: 'invalid' - properties: { - output: 'This is invalid' -"@ - dsc -l trace config get -f $bicepFile 2>$TestDrive/error.log | ConvertFrom-Json - $LASTEXITCODE | Should -Be 4 -Because (Get-Content -Path $TestDrive/error.log -Raw | Out-String) - $content = (Get-Content -Path $TestDrive/error.log -Raw) - $bicepFile = $bicepFile.ToString().Replace('\', '\\') - $content | Should -Match "Importing file '$bicepFile' with extension 'Microsoft.DSC.Extension/Bicep'" - $content | Should -Match "BCP033" - } - - It 'Example bicep parameters file should work' { - $bicepFile = Resolve-Path -Path "$PSScriptRoot\..\..\dsc\examples\hello_world.dsc.bicep" - $bicepParamFile = Resolve-Path -Path "$PSScriptRoot\..\..\dsc\examples\hello_world.dsc.bicepparam" - $out = dsc -l trace config --parameters-file $bicepParamFile get --file $bicepFile 2>$TestDrive/error.log | ConvertFrom-Json - $LASTEXITCODE | Should -Be 0 -Because (Get-Content -Path $TestDrive/error.log -Raw | Out-String) - $out.results[0].result.actualState.output | Should -BeExactly 'This is a parameterized hello world!' - } -} diff --git a/extensions/bicep/bicepparams.dsc.extension.json b/extensions/bicep/bicepparams.dsc.extension.json deleted file mode 100644 index 8bd19868b..000000000 --- a/extensions/bicep/bicepparams.dsc.extension.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "https://aka.ms/dsc/schemas/v3/bundled/extension/manifest.json", - "type": "Microsoft.DSC.Extension/BicepParameters", - "version": "0.1.0", - "description": "Enable passing Bicep parameters file directly to DSC, but requires bicep executable to be available.", - "condition": "[not(equals(tryWhich('bicep'), null()))]", - "import": { - "fileExtensions": ["bicepparam"], - "executable": "bicep", - "args": [ - "build-params", - { - "fileArg": "" - }, - "--stdout" - ], - "output": "[json(json(stdout()).parametersJson)]" - } -} diff --git a/extensions/bicep/copy_files.txt b/extensions/bicep/copy_files.txt deleted file mode 100644 index 816c85531..000000000 --- a/extensions/bicep/copy_files.txt +++ /dev/null @@ -1,2 +0,0 @@ -bicep.dsc.extension.json -bicepparams.dsc.extension.json \ No newline at end of file diff --git a/packaging.ps1 b/packaging.ps1 index 6d4a1c14f..91d31fef2 100755 --- a/packaging.ps1 +++ b/packaging.ps1 @@ -50,8 +50,6 @@ if ($GetPackageVersion) { $filesForWindowsPackage = @( 'appx.dsc.extension.json', 'appx-discover.ps1', - 'bicep.dsc.extension.json', - 'bicepparams.dsc.extension.json', 'dsc.exe', 'dsc_default.settings.json', 'dsc.settings.json', @@ -91,8 +89,6 @@ $filesForWindowsPackage = @( ) $filesForLinuxPackage = @( - 'bicep.dsc.extension.json', - 'bicepparams.dsc.extension.json', 'dsc', 'dsc_default.settings.json', 'dsc.settings.json', @@ -118,8 +114,6 @@ $filesForLinuxPackage = @( ) $filesForMacPackage = @( - 'bicep.dsc.extension.json', - 'bicepparams.dsc.extension.json', 'dsc', 'dsc_default.settings.json', 'dsc.settings.json', @@ -365,7 +359,6 @@ if (!$SkipBuild) { "lib/dsc-lib", "dsc", "resources/dscecho", - "extensions/bicep", "resources/osinfo", "adapters/powershell", 'resources/PSScript',