Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 2025 image build fails when Activating Windows Feature 'NET-Framework-Features' #11687

Closed
2 of 15 tasks
ChrisGibson1982 opened this issue Feb 28, 2025 · 9 comments
Closed
2 of 15 tasks

Comments

@ChrisGibson1982
Copy link

Description

The windows 2025 build image generation fails (GenerateResourcesAndImage) when activating Windows Feature 'NET-Framework-Features'.

Error message from log:

azure-arm.image: Activating Windows Feature 'NET-Framework-Features'...
==> azure-arm.image: Install-WindowsFeature : The request to add or remove features on the specified server failed.
==> azure-arm.image: Installation of one or more roles, role services, or features failed.
==> azure-arm.image: Element not found. Error: 0x80070490
==> azure-arm.image: At C:\Windows\Temp\script-67c07d4c-ce66-ae6d-a955-81aeff501c62.ps1:21 char:19
==> azure-arm.image: + $result = Install-WindowsFeature @arguments
==> azure-arm.image: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm.image: + CategoryInfo : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature],
==> azure-arm.image: Exception
==> azure-arm.image: + FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager.Commands.AddWind
==> azure-arm.image: owsFeatureCommand
==> azure-arm.image: Failed to activate Windows Feature 'NET-Framework-Features'
==> azure-arm.image: At C:\Windows\Temp\script-67c07d4c-ce66-ae6d-a955-81aeff501c62.ps1:29 char:9
==> azure-arm.image: + throw "Failed to activate Windows Feature '$($feature.name)'"
==> azure-arm.image: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm.image: + CategoryInfo : OperationStopped: (Failed to activ...ework-Features':String) [], RuntimeException
==> azure-arm.image: + FullyQualifiedErrorId : Failed to activate Windows Feature 'NET-Framework-Features'
==> azure-arm.image:
==> azure-arm.image: Script exited with non-zero exit status: 1. Allowed exit codes are: [0]
==> azure-arm.image: Step "StepProvision" failed

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • Windows Server 2019
  • Windows Server 2022
  • Windows Server 2025

Image version and build link

azure-arm.image: Activating Windows Feature 'NET-Framework-Features'...
==> azure-arm.image: Install-WindowsFeature : The request to add or remove features on the specified server failed.
==> azure-arm.image: Installation of one or more roles, role services, or features failed.
==> azure-arm.image: Element not found. Error: 0x80070490
==> azure-arm.image: At C:\Windows\Temp\script-67c07d4c-ce66-ae6d-a955-81aeff501c62.ps1:21 char:19
==> azure-arm.image: + $result = Install-WindowsFeature @arguments
==> azure-arm.image: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm.image: + CategoryInfo : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature],
==> azure-arm.image: Exception
==> azure-arm.image: + FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager.Commands.AddWind
==> azure-arm.image: owsFeatureCommand
==> azure-arm.image: Failed to activate Windows Feature 'NET-Framework-Features'
==> azure-arm.image: At C:\Windows\Temp\script-67c07d4c-ce66-ae6d-a955-81aeff501c62.ps1:29 char:9
==> azure-arm.image: + throw "Failed to activate Windows Feature '$($feature.name)'"
==> azure-arm.image: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm.image: + CategoryInfo : OperationStopped: (Failed to activ...ework-Features':String) [], RuntimeException
==> azure-arm.image: + FullyQualifiedErrorId : Failed to activate Windows Feature 'NET-Framework-Features'
==> azure-arm.image:
==> azure-arm.image: Script exited with non-zero exit status: 1. Allowed exit codes are: [0]
==> azure-arm.image: Step "StepProvision" failed

Is it regression?

no

Expected behavior

The image should build successfully

Actual behavior

The image build fails with an error

Repro steps

Run the command "GenerateResourcesAndImag" to build a new 2025 iamge

@kishorekumar-anchala
Copy link
Contributor

Hi @ChrisGibson1982 - we're not encountering this issue , could you please try to rerun the build and request you to share the repro steps to understand more about the issue (if not work with rerun) ?

@denyos
Copy link

denyos commented Feb 28, 2025

We are facing the same issue. Re-run is not solving the problem. Seems that this is a known issue that should be fixed as more users are facing this: #11510

We are building using the windows-2025.pkr.hcl configuration without any modifications:
vm_size = Standard_F8s_v2,
image_offer = "WindowsServer"
image_publisher = "MicrosoftWindowsServer"
image_sku = "2025-Datacenter"

To build the image we are using images.CI/linux-and-win/build-image.ps1

Update: Did some further investigation. Last monday (2025-02-24T03:30:44.8495921Z) this was still working. It seems that this issue started after the update to image version 20250224.3.1.

Update 2: I'm currently running a test build with the image version pinned to '20250209.1.0'
This was a workaround in 2022 when the same problem occurred: #6431

Update 3: The build (with the pinned image version) is past the NET-Framework-45-features. As my other builds for windows 2019 and 2022 are succeeding, I don't expect any other issue. This issue is only related to windows 2025.

azure-arm.image:
    azure-arm.image: Windows Feature 'VirtualMachinePlatform' was activated successfully
    azure-arm.image: Activating Windows Feature 'NET-Framework-45-Features'...
    azure-arm.image: WARNING: You must restart this server to finish the installation process.
    azure-arm.image: Windows Feature 'NET-Framework-45-Features' was activated successfully
    azure-arm.image: Activating Windows Optional Feature 'Client-ProjFS'...
    azure-arm.image: WARNING: Restart is suppressed because NoRestart is specified.

@mmcdermo2
Copy link

We've also seen this issue when attempting to build Windows 2025. Seems to be intermittent however as we've had at least one instance where it was successful, but then subsequently fails on Install-VisualStudio.ps1 (saying that the thumbprint is incorrect)

==> azure-arm.image: Install-WindowsFeature : The request to add or remove features on the specified server failed.
==> azure-arm.image: Installation of one or more roles, role services, or features failed.
==> azure-arm.image: Element not found. Error: 0x80070490
==> azure-arm.image: At C:\Windows\Temp\script-67c178a6-c599-f6f5-5a7e-6db031b36117.ps1:21 char:19
==> azure-arm.image: +         $result = Install-WindowsFeature @arguments
==> azure-arm.image: +                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm.image:     + CategoryInfo          : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature],
==> azure-arm.image:     Exception
==> azure-arm.image:     + FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager.Commands.AddWind
==> azure-arm.image:    owsFeatureCommand
==> azure-arm.image: Failed to activate Windows Feature 'NET-Framework-Features'
==> azure-arm.image: At C:\Windows\Temp\script-67c178a6-c599-f6f5-5a7e-6db031b36117.ps1:29 char:9
==> azure-arm.image: +         throw "Failed to activate Windows Feature '$($feature.name)'"
==> azure-arm.image: +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm.image:     + CategoryInfo          : OperationStopped: (Failed to activ...ework-Features':String) [], RuntimeException
==> azure-arm.image:     + FullyQualifiedErrorId : Failed to activate Windows Feature 'NET-Framework-Features'
==> azure-arm.image:
==> azure-arm.image: Provisioning step had errors: Running the cleanup provisioner, if present...

@denyos
Copy link

denyos commented Feb 28, 2025

@mmcdermo2 The visual studio version is a different issue that has been fixed yesterday. See: #11680

For now the image version pinning seems to be working. That build is taking a few hours, so I can't guarantee that I won't face a different issue. But so far, everything seems good.

@mmcdermo2
Copy link

@denyos thank you. I did a search yesterday but didn't find find that PR. Glad to hear it's fixed anyway, thank you. I'll kick off a fresh build now and see if I re-encounter the .net issue above

@denyos
Copy link

denyos commented Feb 28, 2025

Update: My build finished 30 minutes ago and is successful.
It looks like the latest image is causing the issues because with version pinning everything is working correct.

@kishorekumar-anchala
Copy link
Contributor

Hi @ChrisGibson1982 - We request you to try with the below workaround. We're unable to encounter the issue from our end .

#11510 (comment)

@ChrisGibson1982
Copy link
Author

The work around works, but now means that i have to run a modified template file. I find it really strange that you can't reproduce this. I will test again the next release without the modification and log an new issue if it doesn't work. Happy for this to be closed for now

@mmcdermo2
Copy link

I re-tested our build on Friday, no longer getting the Visual Studio error and this issue also didn't crop up, so our build was successful. Don't know why we didn't hit it this time having seen it multiple times in the past

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants