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.
The scenarios covered in Sample Portal code
Control Panel or Portal Integration
- WAP authentication for tenant (uses ASP.NET membership provider) and administrator (uses Windows) portals
- List available plans for subscription
- List subscriptions for a tenant
- List quota for tenant subscription
VM Cloud Resource Provider (SPF)
- List virtual machines for a subscription (tenant)
- 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.
Virtual machine list with links to “VM Connect” and “VM Checkpoint”
Sample portal code needs the following to run:
- System Center 2012 R2 Virtual Machine Manager with Update Rollup 2
- System Center 2012 R2 Service Provider Foundation with Update Rollup 2
- System Center 2012 R2 Orchestrator (Service Management Automation) with Update Rollup 2
- Windows Azure Pack for Windows Server with Update Rollup 2
The parts of Sample Portal code
The sample portal code contains the following two parts, or Visual Studio (VS) projects:
- WAPWrapper.csproj - VS project implementing the common Service Management API calls for tenant authentication, subscriptions, VM operations, Cloud operations, and VM template operations
- 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.