I’ve often thought that it would be useful to make an app install available for GitHub projects that developers can run to test if they want to look into the project code. Generally, repositories are not the place for built apps. Azure Blob Storage Static Web Sites office a simple platform for hosting ClickOnce app installations. You can easily use a custom domain to point the static site’s Azure URL. Also, Azure CDN enables the TLS protocol (aka SSLs) for a custom domain without having to get an external SSL certificate. Pricing for the TLS capability is based upon volume so can be quite cheap for entry level.

I’ve implmented this for my JekyllFilter project on GitHub. The ClickOnce install is here and via a custom domain here.

Click Once

ClickOnce enables simple publishing of a Windows Forms app on a web site. WPF and Console apps cam also be published using ClickOnce. No App Store involvement. You do a Publish build of your app which can be placed in your project folder (typically under Publish\) or send to directly an FTP site. So, if your website host has an ftp portal to the website content you are done. For this exercise, an Azure Blob Site Static Web Site is used.

ClickOnce applications can be self-updating; they can check for newer versions when run as they become available and automatically replace any updated files. Because ClickOnce applications are isolated, installing or running a ClickOnce application cannot break existing applications.

If installing from the web, (they can also be installed locally from media if published for that), they must be installed from the web Url specified in the publish build. Once installed you can then run from the local installation, but a check is made at runtime for updates.

Unfortunately, Azure Blob Site Static Web Sites don’t have ftp access, although there are third party apps for doing so. From the Azure portal you can manually upload individual files to your web blob storage container but uploading folders is cumbersome. You can use Microsoft AzCopy, which you be useful for scripting, for example as Post Build actions. A simpler alternative is Microsoft Azure Storage Explorer. This has a nice GUI for uploads.

Getting Started

  • Create your Windows Forms app, test and debug it … get it running

  • Create an index.html page as well as a 404.html page

<head>
<title>My Apps</title>
</head>
<body>
<h1>My Apps</h1>
<ul>
</ul>
</body>

Eg. index.htm

<head>
<title>404 Page Not Found</title>
</head>
<body>
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</body>

Eg. 404.html

  • Assuming you have an Azure account, create your Azure Blob Storage account.\ Follow: Create an Blob Storage Account Quickstart

  • Create your static web site.\ Follow: Blob Storage Static Web Site Quickstart (Skip the last step)

  • Upload the index.html and 404.html pages to the $web container:

    • In the Azure Portal, go to your Blob Storage account

    • Click on Blobs (on left)

    • Click on $web

    • Use the Upload option

    • Click on Static Web Site (on left) and copy the primary Url\ eg https://myblobz26.web.core.windows.net/

    • Open that url in a browser to test the site.

  • Upload the ClickOnce installation:

    • Install Microsoft Azure Storage Explorer.

    • Run the Az Storage Explorer and log into your Azure account

    • Under the relevant subscription, expand Storage accounts, then the relevant Storage Account.

    • Expand Blob Containers then $web

    • Action Upload-Upload Folder and browse to your project folder and select the Publish folder and upload.\ NB: If updating you will need to choose Replace on the Conflict Dialog.

  • In the index.html add the link to your installation eg:

<head>
<title>My Apps</title>
</head>
<body>
<h1>My Apps</h1>
<ul>
 <li><a href="/publish/publish.htm">My App</a></li>
</ul>
</body>
  • Go back to your browser and refresh. You now should see the link to your app. Click on it and you will get something like:

  • Take press [Install] and your away.

  • You can now publish the link on your GitHub repository ReadMe.

Custom Domain

If you have a Custom Domain, you can make use of this with your static web site, using CNAME files. If you only refer the site URL to the custom domain and you use https, you always get a Certificate warning with the site. This can be resolved by adding a second DNS CNAME page that is used for https.

See CDN Static Web Site

Alternatively you can disable the https requirement.


 TopicSubtopic
  Next: >  
<  Prev:    
This Category:Application Dev
  Next: >  
<  Prev: