STEP1:
Create new project on solution of type Azure Cloud Service
STEP2:
Add existing web role to the cloud service
STEP3:
Add some changes to support .Net Framework 4.5.2. on cloud service
- Download the .NET 4.5.2 Web Installer
- For a Web Role
- In Solution Explorer, under In Roles in the cloud service project right click on your role and select Add>New Folder. Create a folder named bin
- Right click on the bin folder and select Add>Existing Item. Select the .NET installer and add it to the bin folder.
- Files added this way to the Role Content Folder will automatically be added to the cloud service package and deployed to a consistent location on the virtual machine. Repeat this process for all web and worker roles in your Cloud Service so all roles have a copy of the installer
- Define startup tasks for your roles. Startup tasks allow you to perform operations before a role starts. Installing the .NET Framework as part of the startup task will ensure that the framework is installed before any of your application code is run.
- Add the following to the ServiceDefinition.csdef file under the WebRole node for all roles:
- Create the install.cmd file with the following content:
PowerShell
Editar Script|Remove
REM install.cmd to install .NET Framework
set timehour=%time:~0,2%
set timestamp=%date:~-4,4%%date:~-10,2%%date:~-7,2%-%timehour: =0%%time:~3,2%
set startuptasklog=%PathToInstallLogs%\startuptasklog-%timestamp%.txt
set netfxinstallerlog = %PathToInstallLogs%\NetFXInstallerLog-%timestamp%
echo Logfile generated at: %startuptasklog% >> %startuptasklog%
echo Checking if .NET 4.5.2 is installed >> %startuptasklog%
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v Release | Find "0x5cbf5"
if %ERRORLEVEL%== 0 goto end
echo Installing .NET 4.5.2. Log: %netfxinstallerlog% >> %startuptasklog%
start /wait %~dp0NDP452-KB2901954-Web.exe /q /serialdownload /log %netfxinstallerlog%
:end
echo install.cmd completed: %date:~-4,4%%date:~-10,2%%date:~-7,2%-%timehour: =0%%time:~3,2% >> %startuptasklog%
STEP4:
The install script checks whether .NET 4.5.2 is already installed on the machine by querying the registry. If .NET 4.5.2 is not installed then the .Net Web Installer launched. To help troubleshoot with any issues the script will log all activity to a file named startuptasklog-(currentdatetime).txt stored in InstallLogs local storage. Add the install.cmd file to all roles by right click on the role and selecting Add>Existing Item.... So all roles should now have the .NET installer file as well as the install.cmd file.
STEP5:
Publish to Microsoft Azure
Resources
Some good resources about Signal could be found here: