📜 ⬆️ ⬇️

Accelerating with Windows Azure Accelerator

Currently, Microsoft provides more than 200 cloud services, including Windows Azure, Office 365, Bing, MSN, Windows Live, Hotmail and many others. These resources are available 24x7x365 for more than a billion customers and 20 million businesses in more than 70 countries. These resources are supported on the basis of the Global Foundation Services (GFS), implementing the strategy of Microsoft Software Plus Services (software plus services). To support the IT infrastructure of cloud services, Microsoft has deployed a network of major data centers around the world. Thanks to these modern technological solutions, safe, reliable, scalable and efficient solutions have become available to users. One has only to envy the system administrators who support the work of GFS data centers, and admire their professionalism.



In order to use the capabilities and potential of Microsoft's cloud services with maximum business benefit, it will not be superfluous to become familiar with the Windows Azure platform. In any case, even just out of interest in innovation, the perspective of PaaS for their projects should be considered. Here, innovation means not so much an IT solution, but a new look at the business model of service delivery is a platform as a service. In fact, Windows Azure is a tool for quickly deploying its applications in Microsoft's globally distributed data centers. However, the concept of “fast” is very relative, for example, the deployment of the web role of the application in Windows Azure can take about 15-20 minutes. And here Windows Azure Accelerator for Web Roles comes to the rescue.

Windows Azure Web Role


Windows Azure Accelerator for Web Roles is a .NET application that runs in the Windows Azure web role mode and is a website (user) developer uploader. In turn, it should be clarified that the web role is an instance of a user application running in Windows Azure. The number of running web role instances depends on the load and is determined by the user. All copies are identical. A feature of the web role is the availability of access through the means of the web interface for clients working with the application. To access the web role is provided a kind of virtual IP-address (VIP), which is unchanged for the application. However, in the case of redeploying, the VIP application is likely to change. This feature does not apply to increasing or decreasing the number of instances of web roles.
')
Simplified structure of Windows Azure web role

An instance of a web role Windows Azure is a virtual machine with a Windows Server 2008 or Windows Server 2008 R2 to the user's choice, with the IIS web server installed. Since a web server can serve several sites, an instance of a web role may well provide access to several user resources. For each user request, the selection of a specific web role instance is performed by a load balancer, which does not take into account the current state of the session. Therefore, it is rational for the cloud-based application to use cookies stored on the client side, or to store session data in a remote repository.

The entire Windows Azure infrastructure is managed by Windows Azure Fabric, a Windows Server-based distributed computing system with a set of diagnostic and management tools, as well as a web portal providing users access to the Windows Azure control panel. Using Windows Azure Accelerator for Web Roles, you can enable users to deploy sites themselves without using the Windows Azure Control Panel.

Install Windows Azure Accelerator for Web Roles


You can use Microsoft Visual Studio 2010 or the free Microsoft Visual Web Developer 2010 Express to deploy in the Windows Azure Accelerator for Web Roles cloud. First, from the site http://waawebroles.codeplex.com/, you need to download the Windows Azure Accelerator for Web Roles distribution, and then start the package installation.

WAAWebRoles.exe

In fact, the package will be unzipped to a folder specified by the user on the local computer. Windows Azure Accelerator for Web Roles requires ASP.NET MVC 3 as dependencies and, of course, Windows Azure Tools for Microsoft Visual Studio 2010 Platform v1.4. If the specified components are not yet present on the developer's computer, they will be deployed using the Web Platform Installer 3.0.

WAAWebRoles.exe

At the next stage, a script will be launched, where in the command line you should answer affirmatively the questions posed. Of course, if all the dependencies are installed by this time and you want to continue installing the extensions for Visual Studio.

WAAWebRoles.exe

Now the graphical installer will be launched, which will add to the Visual Studio, and in the current example to the Microsoft Visual Web Developer 2010 Express, the Windows Azure Web Deploy Host project template.

WAAWebRoles.exe

After that, you can go to the stage of loading Windows Azure Accelerator for Web Roles into the Microsoft cloud. To do this, run the selected version of the Visual Studio development tools. It is assumed that by this time a user in the Windows Azure Control Panel has reserved his new service and one storage account.

Deploying Windows Azure Accelerator for Web Roles


After the launch of Microsoft Visual Web Developer 2010 Express, we select the creation of a new project - from the Visual C # template in the Cloud: Windows Azure Web Deploy Host section.

Visual Web Developer 2010 Express

In the next two successively opening dialog boxes, enter the parameters of the storage account (Enter your Windows Azure storage account information), i.e. You need to specify an account name (Account name) and a primary access key (Account key), which are available in the Windows Azure Control Panel. Then an arbitrary login (User name) and password (Password) of the administrator for the future site (Enter the account information for the Administration Site) are set. Now the project is ready for transfer to the cloud.

Visual Web Developer 2010 Express

True, small improvements do not interfere. First , if it is assumed that user websites will not only be developed as .NET applications, but PHP will be used, then you should set the parameters for web role deployment. In this case, when you deploy the application, the Fast-CGI module for IIS with PHP support will be connected. To do this, add a few lines to the file / Startup/ConfigureIIS.cmd. Or even easier - download the already modified file that Nathan Totten published on GitHub .

Secondly , if the subsequent deployment of web sites is to be performed using Microsoft WebMatrix, then you should allow access to Windows Azure Accelerator for Web Roles via TCP protocol on port 8172. This is absolutely not required if sites are loaded with Visual Studio in the future.

To open a port, add the line to the ServiceDefinition.csdef parameter definition file in the Endpoints section:

<InputEndpoint name = "RemoteDeploy" protocol = "tcp" port = "8172" localPort = "8172" />

That's all - it's time for the clouds! Deploying Windows Azure Accelerator for Web Roles is no different from a similar procedure for deploying a web role using Visual Studio. Right-click on the project name WebDeployHost1.Cloud and select Publish or Publish.

Visual Web Developer 2010 Express

In the dialog box that opens, select the parameters of the current Windows Azure service account. If the certificate of authenticity has not yet been uploaded to the cloud, then generate it and upload it. For those who are not familiar with the application deployment procedure using Visual Studio tools, we can recommend watching Sergey Baydachny’s screencast: Using Windows Azure: Visual Studio 2010 - TechDays.in.ua

Unfortunately, for deploying Windows Azure Accelerator for Web Roles, 24-hour test access to Windows Azure provided on the Ukrainian .NET community of developers http://dev-club.in.ua/ will not work , you need access to a fully-functional Windows control panel Azure. This is due to the fact that for Windows Azure Accelerator for Web Roles it is necessary to allow remote access to instances of web roles. To do this, select the Configure Remote Desktop connections settings in the Deploy Windows Azure project dialog box. Here, everything is the same as the standard remote access permission for an application instance. You must generate a certificate and a set of encryption keys that are downloaded to Windows Azure to identify the user, and you must specify the administrator name and password for the remote connection. For those who are not familiar with this, you can watch another screencast of Sergey Baydachny: Using Windows Azure: Azure Connect - TechDays.in.ua

To obtain test access to the Microsoft cloud platform, you can look at the current offers on the Windows Azure website, although they all involve the use of a credit card. A trial access for 30 days without entering credit card data seems to be no longer available, but I could be wrong. In any case, I want to thank Microsoft Ukraine for the online course for developers on Windows Azure and provided test access to the cloud.

Further, if all the simple operations of setting up a connection to a Windows Azure account are done correctly, you should wait a while until Windows Azure Accelerator for Web Roles is deployed in the cloud (then you can compare this time and time of site deployment using the accelerator). By default, two instances of the application are created.

Going to the Windows Azure Control Panel, you can make sure that the necessary instances are deployed and are already running. You can immediately remember the VIP address of the web role (section Input endpoints), which will be needed later.

Azure Control Panel

For interest, you can select any instance and connect remotely to his desktop.

RDC

Inside, everything is familiar - Windows Server 2008 R2. So, a remote connection account is necessary for further work with sites, and this mode is very interesting for understanding the internal structure of the web role instance.

Work with Windows Azure Accelerator for Web Roles website


The Windows Azure Accelerator for Web Roles website does not indulge in excesses. On the main - login and password entry. After authorization, to create a new site, select the link “new web site”, where we set Name - the name for the site (to be used later when the user’s site is deployed), Description - an arbitrary description. The connection parameters (protocol and port) are left at the default, and for the Host Name we specify the domain name by which the site will be available. Accordingly, in the DNS settings for the specified domain, you should set the link to the VIP address of the web role assigned to Windows Azure and available in the control panel. If the domain is virtual (access will be limited only by the developer's computer), for example: "site.local", then you can change the corresponding entries in the local file: "% windir% \ system32 \ drivers \ etc \ hosts".

WebSite Manager

After creating the site, you can go to the specified URL, where a hint on further actions will be available. Also on the WebSite Manager site will be indicated the number of instances of the web role in which the user's site will be deployed.

The next step is to install Microsoft WebMatrix. The installation procedure is very simple - go to the site http://www.microsoft.com/web/ , download the installer and wait for the result. In my case, the following dependencies were installed to Microsoft WebMatrix: Microsoft SQL Server Compact 4.0 [Russian], Microsoft SQL Server Compact 4.0 Tools [Russian], SQL Server 2008 R2 Management Objects [English], SQL Server Native Client [English], Types SQL Server CLR [English], Web Deployment Tool 2.1 without unified SQL support [Russian], IIS 7.5 Express [Russian], Microsoft WebMatrix Installer [Russian]. Total download size: 44.82 MB.

Installing WebMatrix

Now in Microsoft WebMatrix create a simple web site. Add a page to it in PHP, append the traditional code - call the function phpinfo (). Naturally, if we are talking only about ASP.NET, we forget about PHP.

Webmatrix

Next, we set application deployment parameters: web deployment, server — DNS name of Windows Azure service without http: // prefix . The username, password are the Remote Desktop access settings of the Windows Azure web role instance. The destination URL must match the parameters specified for the site in Windows Azure Accelerator for Web Roles. If everything is correct, then WebMatrix will report a certificate error. One can only agree with this, since our certificate is self-signed.

Webmatrix

The site will load almost instantly and will be available at the specified URL. For example, you can examine the result of the phpinfo () function.

PHPinfo

For the purity of the experiment, create a website in Microsoft Visual Web Developer 2010 Express and publish it using Windows Azure Accelerator for Web Roles. To do this, first of all in WebSite Manager we create a new site, for example, “mysite2”. For him, we specify a new domain, which we do not forget to register in the DNS records or locally in “hosts”.

Now, we open Microsoft Visual Web Developer 2010 Express and create a new site, for example, ASP.NET MVC, we can also add a PHP test page to it. We switch to the deployment mode, select the web deployment, specify the URL of the service, the application site: “mysite2” and, of course, the login and password for remote Remote Desktop connection to the Windows Azure web role instance.

Microsoft Visual Web Developer 2010 Express

After performing the actions, we received two sites (one created in WebMatrix, the other - in Microsoft Visual Web Developer 2010 Express), which are running in two instances of the Windows Azure cloud web role. Now you can examine the output of the phpinfo () function or look at the work of the ASP.NET MVC site procurement.

ASP.NET MVC

Thus, Windows Azure Accelerator for Web Roles allows you to work very effectively with websites in the Azure cloud. At the time of deployment of the “accelerator”, access to the Windows Azure administration panel is no longer needed. We get some kind of hosting analog, but with a very huge margin of scaling and reliability. With this, apart from ASP.NET sites, PHP solutions can be deployed in such an environment. Since Windows Azure Accelerator for Web Roles itself is a .NET application, it can be integrated with its developments.

Summary


As befits a platform as a service, Windows Azure hides its device behind certain abstractions. At first it may seem difficult, but the opposite is true. Clouds are easy! If we talk about development using .NET technologies, the Microsoft cloud platform performs its functions remarkably well and is quite attractive for large, scalable developments. For PHP is not so simple. If we talk about a hybrid project, where PHP solutions will be used along with .NET applications, this is rather interesting. In the case of PHP development, the advantages of the Windows Azure platform should be clearly attractive to the client in the pricing policy of the service provided or in specific features of the architecture, for example, using a data warehouse, etc. For existing PHP projects, migration to the Windows Azure cloud is rather vague for me. Here it is necessary to compare the costs of adapting the project with the possibility of using a cloud from another supplier. Although it is impossible not to recognize the architecture of Windows Azure magnificent.

Links

1. Microsoft Shares Video Tour of Cloud Datacenters - TechNet Blogs: MS Datacenters
2. Inside Windows Azure, The Cloud Operating System (Mark Video) - Tech · Ed North America 2011
3. Windows Azure Accelerator for Web Roles - Nathan Totten
4. Extending the Windows Azure Accelerator for Web Roles with PHP and MVC3 - Nathan Totten
5. Matias Woloski, Windows Azure Accelerators for Web
6. Windows Azure Accelerator for Web Roles - Maarten Balliauw {blog}
7. WebMatrix with Windows Azure Accelerator for Web Roles - superriverfield
8. Perspectives for developing PHP applications for the cloud. Introducing Windows Azure - Notebook
9. European experience in developing solutions on Windows Azure. Yuri Zaitsev (screencast) - TechDays.ru

Source: https://habr.com/ru/post/125371/


All Articles