To install SQL Server on Windows Server 2012 R2 VM Server in Azure, .net framework 3.5 should be installed first on the same Server.
.net framework 3.5 can be installed using below two steps:
1. DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:"D:sxs"
2. Enable the feature in the Add Roles and Features Wizard and specify path Source:"D:sxs"
Both the above steps require a source file which is a part of installation disk but in Azure VMs, Installation disk is not available to specify the source path.
Below Error appear if installation fails
Installation of one or more roles, role service feature failed.
The source files could not be found. Try installing the roles, role services, or features again in a new Add Roles and features Wizard session, and on the Confirmation page of the wizard, click "Specify an alternate source path" to specify a valid location of source files that are required for installation. The location must be accessible by computer account of the destination server.”
Solution to enable .net framework 3.5 role in azure: Download and install latest updates using windows update on the Windows Server 2012 R2 VM Server in Azure.
Follow the below steps to enable .net framework 3.5 feature on windows server 2012 R2 VM created in Azure Environment:
Go to Control PanelSystem and SecurityWindows Update
Check for Latest updates (note: Try to disable IE ESC under Server Manager, if unable to connect to internet for checking updates)
Download and install the latest updates
Restart Server if required.
Once the Server is restarted, Enable .NET Framework 3.5 by using the Add Roles and Features Wizard under Server Manager following below steps:
Open Server Manager and click on dashboard
In right pane, Click on Add roles and features
Click Next and choose Role-based or feature-based installation
Click Next till feature page appear, check the box for .net framework 3.5 feature and click next
Click install without specifying the alternate source path to install .net framework 3.5 features role.
The above issue occurs in Azure because we cannot specify an alternate source path for a source file due to unavailability of installation disk So to enable .net framework 3.5 role in Windows Server 2012 R2 VM in Azure as a prerequisite for SQL Server or any other application, check and download latest windows updates on Windows Server 2012 R2 VM and then enable the role without using alternate source path.