How do I enable the .NET Framework 3.5 on an Azure VM created from a Windows Server 2012 R2 image?
Solution 1:
From Unable to install .NET Framework 3.5 feature in Azure Windows Server images:
You will get the error if the conditions listed below are valid:
The virtual machine is part of an Azure Virtual Network
DNS server(s) are added to the Azure Virtual Network configuration
Those DNS server do not have a forward to an external DNS server able to resolve internet based servers.
So you need to ensure that your DNS resolution/forwarding is working correctly so that public DNS names are resolved, or change the VM settings to not use the AVN.
Doing the latter will cause the VM to get it's (DNS) settings from MS's DHCP servers, and it will be able to resolve public addresses. You don't want to do this if your server is a DC, in which case you would setup your local DNS properly (with forwarders) instead.
Solution 2:
If you're coming here in October 2014, you might just need to go to Windows Update on the VM and install the fix for this issue. It seems like a recent security fix broke the ability to install 3.5.
Solution 3:
In my case, even with unrestricted internet access I could not install any roles or features. This turned out to be because I have policy setting windows updates to come from an internal WSUS server IP, which does not include the source files for Server 2012 R2 roles and features. To fix this set the alternate sources policy:
- In Local Group Policy Editor or Group Policy Management Console, open the following policy setting. Computer Configuration\Administrative Templates\System\Specify settings for optional component installation and component repair
- Select Enabled to enable the policy setting, if it is not already enabled.
- If the computers that are controlled by this policy setting typically receive updates through WSUS, but you prefer to go through Windows Update and not WSUS to find missing feature files, select Contact Windows Update directly to download repair content instead of Windows Server Update Services (WSUS).
This setting will work for any role and feature, not just .NET 3.5