Sample Portal Code based on Windows Azure Pack, Service Provider Foundation and Virtual Machine Manager – version 2

After releasing version 1 of the Sample Portal Code, we enhanced it with new  scenarios based on customer input. Today, we are releasing version 2 of the Sample Portal code, which includes new scenarios such as VM console connection and VM checkpointing through SMA runbook execution.

 

image


 

The scenarios covered in Sample Portal code

 

Control Panel or Portal Integration

  1. WAP authentication for tenant (uses ASP.NET membership provider) and administrator (uses Windows) portals
  2. List available plans for subscription
  3. List subscriptions for a tenant
  4. List quota for tenant subscription

VM Cloud Resource Provider (SPF)

  1. List virtual machines for a subscription (tenant)
  2. Perform virtual machine operations:
    • Start VM
    • Stop VM
    • Create VM
    • VM Details
    • VM Connect (new in version 2): This feature allows you to download an RDP file with settings specific to a selected virtual machine for connecting to it. The scenario needs the remote console feature to be configured in your environment. Refer to the Technet document for details on setting up the remote console for Windows Server and System Center.
    • Ability to execute SMA runbook (new in version 2): This feature allows you to execute a pre-configured SMA runbook using WAP admin portal on behalf of a tenant. Here in the sample, an example of a tenant taking a checkpoint of a virtual machine is shown, though it is configurable to run any pre-configured SMA runbook using WAP admin portal. Refer to the Readme file (Readme for ContosoCloud sample) for instructions on configuring SMA runbook.

 

Sample screenshots

  • Tenant subscription

image

image

 

  • VM checkpoint

image

 

Software prerequisite:

Sample portal code needs the following to run:

 

The parts of Sample Portal code

The sample portal code contains the following two parts, or Visual Studio (VS) projects:

  1. WAPWrapper.csproj - VS project implementing the common Service Management API calls for tenant authentication, subscriptions, VM operations, Cloud operations, and VM template operations
  2. WAPContosoPortal.csproj - VS project implementing the MVC (Model-View-Controller) code to call Service Management APIs through the WAPWrapper library and perform the user requested operations on the portal

For simplicity, and from a best practices perspective, the Service Management API layer integration is in the form of a wrapper library. This offers you flexibility to use the same code across different types of portals, such as Tenant and Administrator. Also, in the case of an upgrade in the Service Management API layer, it is enough to modify and build only the wrapper library, as opposed to modifying and building the complete portal code. Additionally, the wrapper library implements both Tenant and Admin related functions, whereas the portal code contains only the Tenant-specific operations, as it is for Tenant’s use only.

More information about Sample Portal code

The sample portal code contains the following deliverables:

  • Documents folder: Contains the following three documents that describe  the source code, the build, and how to deploy the build to a web server based on Web Server (IIS).
  • Readme for WAPWrapper sample.docx – This document describes the source code details in the wrapper library (WAPWrapper.csproj) VS project
  • Readme for ContosoCloud sample (WAP version).docx – This document describes the source code details in the sample Contoso Portal (WAPContosoPortal.csproj) VS project
  • Readme for Deploying ContosoCloud sample (WAP version).docx – This document describes the deployment details in the sample Contoso Portal
  • Source folder: Contains the following two folders for the source code
  • WAPWrapper – This folder contains the source code for the wrapper library (WAPWrapper.csproj) VS project
  • WAPSamplePortal – This folder contains the source code for the sample Contoso Portal (WAPContosoPortal.csproj) VS project
  • Download Location: You can download the documents and source files from the following TechNet Gallery site.

BC-DLButton

 

Additional References