Introduction
The Windows Web Application Gallery (WAG) provides instant access to the most popular free web applications available today. With just a few clicks you can install any of these applications and be up and running within minutes. This is integrated into the Microsoft Web Platform Installer© and is available for users to download and host in their environments. More information about the Web Platform Installer can be found in the blog post by Shawn Gibbs,
Application Management - System Center and the Web Platform Installer (WebPI)
The WAG is also integrated within Windows Azure Pack for tenants to view and easily deploy the gallery items to the Windows Azure Web Sites Resource Provider in a few clicks.
Scope
This guide will provide you information about offlining the Gallery feed and exposing it through the WAP Portal.
This will not provide you any information about adding your own custom applications to the gallery. You can find more information about adding custom applications to the Gallery at
Problem Statement
Organizations have firewalls set up to restrict internet access, and would like to host a copy of the feed and the installers locally within their infrastructure.
Solution
Fortunately, there is a way to offline a WAG feed and host it locally using the Web Platform Installer command line tool (WebPICmd.exe). WebPICmd.exe has a /Offline parameter which, when provided a list of products to download and a target feed to download the products from, will download the products and their dependencies as mentioned in the feed.
You can host the offlined feed and the packages on an intranet location and modify the feed location in the WAP Admin Portal to point to the intranet location. This guide will provide you with instructions on how to do it.
Note: Once you offline the feed, you will need to maintain it on your own. You won't be notified automatically when there is a new version of an app, You might want to establish a schedule for updating your off-lined feed.
Click the download button to download the complete script user for this blog
Things you will need
- An Internet connected Machine
You have to run the scripts on this machine to offline the feed. once the packages are offline, you can then host them on a non-internet joined server and provide access to your users - Web Platform Installer
The WebPICmd.exe utility installs as a part of the Web Platform installer. You can installer Web Platform Installer from http://www.microsoft.com/web/downloads/platform.aspx - Latest Web PI feed
The latest feed at the time of writing this blog was for Web PI 4.6 at http://www.microsoft.com/web/webpi/4.6/webproductlist.xml. This is refreshed quite frequently so you have to identify the latest feed - Web Application Gallery feed from the WAP portal
Open the WAP Admin Portal and navigate to Web Site Clouds -> Settings. Note the FWD link in the FEED URL field under the web gallery feed. Paste the FWD link into the browser which will redirect you to the location of the WAP Gallery feed - Web Application Gallery feed in Web Platform installer: Open the Web PI feed and find the feed location of the Web Application Gallery referenced in the feed
1:<?xmlversion="1.0"encoding="utf-8"?>
2:<feedxmlns="http://www.w3.org/2005/Atom">
3:<webpiFileversion="4.2.0.0"/>
4:<title>Web Platform Installer 4.6 Feed</title>
5:<linkrel="enclosure"href="https://www.microsoft.com/web/webpi/4.6/webapplicationlist.xml"/>
6:<linkrel="enclosure"href="https://www.microsoft.com/web/webpi/4.6/mediaproductlist.xml"/>
7:<linkrel="enclosure"href="https://www.microsoft.com/web/webpi/4.6/ToolsProductList.xml"/>
8:<linkrel="enclosure"href="https://www.microsoft.com/web/webpi/4.6/enterpriseproductlist.xml"/>
9:<linkhref="http://www.microsoft.com/web/webpi/4.6/WebProductList.xml"/>
10:<updated>2013-10-22T12:00:00.000Z</updated>
11:<author>
Armed with these three values, you can execute the following steps to offline the Gallery Feed
- Read the feeds from Steps 3 and 4
1: [xml]$webPiFeedUriXml = (New-Object System.Net.WebClient).DownloadString($webPiFeedUri)
2: [xml]$webAppGalleryFeedUriXml = (New-Object System.Net.WebClient).DownloadString($webAppGalleryFeedUri)
Alternatively, you can also use a copy of the feeds saved to the local machine or a network location1: [xml]$webPiFeedUriXml = Get-Content($webPiFeedFile)
2: [xml]$webAppGalleryFeedUriXml = Get-Content($webAppGalleryFeedFile)
- The WAG feed is also a part of the standard Web PI feed. However, WAP supports a subset of the items that are present in the standard WAG feed and hence has a different feed from the one referenced in Web PI. Therefore, before we offline the feed, we have to remove the reference of the standard WAG feed from the Web PI feed. This can be done manually or by parsing the HTML. Use the value obtained in Step 5 for this
1: $links = $webPiFeedUriXml.feed.link | Where-Object {$_.href -eq "https://www.microsoft.com/web/webpi/4.6/webapplicationlist.xml"} `
2: | %{$webPiFeedUriXml.feed.RemoveChild($_)}
- Next would be to save the feed to a temporary location so that it can be provided as an input to WebPICmd.exe. While we're at it, let's also save the Web App Gallery feed to an offline location
1: $tempDir = "$env:temp\webPIoffline-"+(Get-Date).ToString("yyyy-MM-dd-HH-mm-ss-ffff")
2: New-Item $tempDir -type directory -Force |Out-Null
3: $tempWebPiFile = "$tempdir\webproductlist.xml"
4: $webPiFeedUriXml.Save($tempWebPiFile)
5: $tempWagFile = "$tempdir\webapplicationlist.xml"
6: $webAppGalleryFeedUriXml.Save($tempWagFile)
- We now have to get a list of products for WebPiCmd.exe to offline. We can get this by parsing the WAG feed
1: [xml] $wagxml = Get-Content($tempWagFile)
2: $productids = $wagxml.feed.entry.productid
3: $list = [string]::Join(',',$productids)
- With this list of products, a copy of the WAG feed for product installer locations and dependency list and a copy of the Web PI feed to point to the locations of the dependencies, we now have all the information required to pass on to WebPICmd.exe
1:& "$env:ProgramFiles\Microsoft\Web Platform Installer\WebpiCmd.exe" /Offline /XML:$tempWebPiFile /Path:$offlineLocation /Feeds:$tempWagFile /Products:$list /UpdateAll
This will offline the feeds to the location specified by the $offlineLocation variable - This will take a while depending on your internet connectivity. Once the process completes, you can use the feed that is generated at
$offlineLocation\feeds\latest\supplementalfeeds\webapplicationlist.xml
- At this point, you can now take the offlined folder and host it on any machine with no internet connection and is accessible by all the machines in that network. it does not have to be the same machine hosting the Windows Azure Pack services
- Open the WAP Admin Portal and navigate to Web Site Clouds -> Settings. Replace the value in the FEED URL field under the web gallery feed section and hit Save
- Now when a tenant user clicks on create Web Site from Gallery on the tenant Portal, they will be shown a list of Gallery items from the off lined feed
Summary
In this blog post, we looked at the steps required to offline a Web Application Gallery feed and expose it through the WAP portals. The steps we followed are
- Downloaded the Web PI feed and the WAP Web App Gallery feed
- Removed the reference to the standard Web Application Gallery Feed from the Web PI feed
- Extracted a list of product Ids from the WAP feed
- Executed the WebPICmd.exe utility with all the above information and offlined the feed to an offline location
- Hosted the feed on a server and pointed the WAP Admin portal to this hosted location