[Azure Stack] Deploy the Web App Resource Provider

February 12, 2016 at 6:00 am in Azure Stack, Resource Provider, TP1 by Florent

After the first article on how to deploy the MySQL RP of Azure Stack, and the second on how to deploy the SQL RP of Azure Stack, I will explain to you how to install the Web App RP.

The prerequisites for this RP are:

Go to the ClientVM, start PowerShell ISE as Administrator and download the following package. Extract it:

image

On a PowerShell window, execute the script Deploy-SqlServerDSC.ps1. It will ask you your Azure AD directory name, a password for the admin account (used to connect to the VM and to the SQL Instance) and an account that is Global Admin of Azure AD and Admin of Azure Stack:

image

image

The SQL VM will be deployed on a RG named WebsitesSQL:

image

During the deployment, get the private IP address of the SQL VM, 10.0.2.4 in my case:

image

The SQL VM is now deployed (it took approximatively 45 minutes in my case):

image

It’s now time to install the WebApp RP. Start by downloading the appservice.exe tool, on the ClientVM. Start it with an admin account. Click on Deploy using Azure Resource Manager:

image

Accept the license:

image

Approve the license for all products that will be deployed:

image

After that, create a new storage account for the deployment, in the Default Provider Subscription:

image

When it’s done, get the storage account name and the key to access to it:

SNAGHTML35ebfe4

Provide these information in the next screen of the App Service installer:

image

The download of each product is in progress and after that, it will be uploaded:

SNAGHTML360308b

The deployment has been completed successfully. A new button appear, Deploy to Azure Stack. Click on it:

image

On the popup click No. It’s important because by clickin on No, all commands that will be executed will be copied to your clipboard. These information could be retrived directly from your storage account. They will be used to deploy the WebApp RP. Paste them on NotePad:

image

image

It’s now time to deploy our WebApp RP. You have 2 solutions here. By Powershell with ARM or with the Web interface. I will explain to you with the web interface (for PowerShell, it’s explained here). Open the second URL that you have in your notepad:

image

Here, you need some information:

1 – The name of the storage account, webappstorage for example
2 – The admin username for each VM
3 – The password for each admin username
4 – A suffix to access to the WebApp, for example webapps.azurestack.local
5 – The SQL Server IP address that you get previously, in my case 10.0.2.4
6 – The sysadmin account, sa
7 – The password for the sysadmin account, it’s the same that the local admin account of the SQL Server

image

You can adapt value for each VM after. I will use juste 1 instance for each VM, but I will change the size to Standard_A2:

image

It is very important to deploy this WebApp RP to the same resource group that the SQL Server. In my case, WebsitesSQL. Click on create to start the deployment of each virtual machines:

image

The deployment is starting:

image

It will deploy 6 VMs:

  • CN0-VM: This VM is the primarry controller, to manage the WebApp infrastructure
  • FS-VM : It’s the file server, where binaries are stored and binaries of your client will be stored
  • WW0-VM: This VM is the Web Worker, where you will provide your resources for your Web Site deployed by your clients
  • MN0-VM: This VM is used for the Hosting Management
  • FTP0-VM: It’s the publisher VM
  • FE0-VM: It’s the front-end VM

The deployment is finished correctly (40 minutes in my case):

image

We will now create the DNS entry for the *.webapps.azurestack.local. The IP address is the IP of the load-balancer FrontEndServersLoadBalancer, in my case, 192.168.133.28:

image

The DNS entry (type A) associated:

image

This * will create a folder named webapps in your DNS:

image

Get the IP address of the ManagementServerLoadBalancer, in my case 192.168.133.29:

image

Create a new DNS record (type A) with the name management. It will be used to register the WebApp in Azure Stack:

image

We will setup the wildcard certificate. If you already installed the SQL RP, you have this certificate. If you don’t install it, follow the beginning of this article. Connect to management.azurestack.local virtual machine and copy the wildcard pfx certificate to your desktop:

image

Open it and choose the Local Machine:

image

Check the 2 last boxes to export the private key at a later time and include all properties:

image

Choose the first option, automatically:

image

Import it:

image

The import has been done correctly:

image

We will install this certificate on the VM CN0-VM. Get his IP address in the portal:

image

You can connect to this IP in RDP through the management VM. Copy the certificate from the management VM and paste it in C:\Temp of the controller VM:

image

Execute the following PowerShell script by adapting the password variable your the password of the PFX and the Uri of the last command with the URL of the management server:

Import-Module Websites

$password="pfxPassword"
Set-WebSitesConfig -Type Global -ManagementServerCertificateFileName "C:\Temp\Certificate.pfx" -ManagementServerCertificatePassword $password
Set-WebSitesConfig -Type Global -ArmEndpoint "https://api.azurestack.local"
Set-WebsitesConfig -Type Global -ArmResourceProviderUri ‘https://management.azurestack.local/’

SNAGHTML3e6dda7

Execute now this script:

Get-WebSitesServer -ServerType ManagementServer | Repair-WebSitesServer
Get-WebSitesServer -ServerType LoadBalancer | Repair-WebSitesServer
Get-WebSitesServer -ServerType WebWorker | Repair-WebSitesServer

image

The finish is closed. We will register the WebApp RP in our Azure Stack environment. Connect to the ClientVM and navigate to https://portal.azurestack.local .Then go to Resource Providers and click on Add:

image

Now, fill in each text box:

1 – The name of your deployment
2 – The management URL, https://management.azurestack.local/
3
– The username of the vm, admin
4 – The password of the VM
5 – The location, local
6 – A resource group, WebAppsRG

image

The register is done:

image

The deployment is done, we can add this RP to a plan:

image

We will now add a server, to be able to use the Standard pricing. I deployed a new WS 2012 R2 VM with a biz size to be able to purpose the 3 types (small, medium and large) of service app. This VM is connected to the same network that other WebApp VM and on the same RG:

image

Connect to this VM and add the same account that your WebApp farm. For me, it was admin/password. This account must be local admin:

image

Execute the following PowerShell command to be able to log in remotely with account that are not in this computer:

Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name LocalAccountTokenFilterPolicy -Value 1 -Force

Now, go on your Web-apps RP:

image

Click on Roles:

image

As you can see, currently, customers can only create WebSites on a Shared infrastructure. We need to add a server for the Small/Medium/Large instances. Click on Add Role Instance and provide the IP address of the VM that you just created and choose the size where you want to associate:

image

image

If you go on the controller VM, and open the shortcut Web Cloud Management Console on the desktop, you can see that the server is configuring to be able to receive Web sites:

image

The server is now ready to receive instances (it took 30 minutes in my case):

image

My customer can now deploy a Web App. Click on New > Web + Mobile and choose a site:

image

I will deploy a WordPress. For the App Service, because I just added a Standard-Medium, I will choose this one:

image

With an existing MySQL database:

image

image

After few minutes, I can navigate to my website:

imageimage

Django:

image

And for .Net Nuke, with a sql database:

image

image

image

If you have any questions, just ask me Sourire