Friday, July 31, 2015

Setup your Chocolatey repository in Azure - Part 1


The complete list of posts in this series:

Part 1: Creating a nuget website to upload packages
Part 2: Packaging and uploading packages to the nuget repository
Part 3: Configuring PowerShell package management or OneGet to install packages from your repository
Part 4: Configure the infrastructure in Chef
Part 5: Using DSC and Chef to install the packages

Chocolatey is a package manager for Windows designed to be a decentralized framework for quickly installing applications and tools that you need. Chocolatey is actually built on top of the NuGet package system, but it is designed to fill a different need. Chocolatey wraps up applications and other executables and makes it easy to install them on your computer.

The goal behind this post is to successfully setup up a Chocolatey repository in Azure websites to distribute software easily throughout the network. You can use the same approach to host a repository on premises, by choosing a deployment option not to host on Azure but on local IIS.

Follow the steps in the given order to complete the process.

  • Open Visual Studio and create an empty project (ASP.NET Web Application)

  • In the package manager console, type the cmdlet Install-Package Nuget.Server to install the NuGet server package

  • Alternatively you can use the Manage Nuget Packages options by right clicking the project.

  • After successful installation, your project structure should look like

  • Open the added Web.config file and change the following values in the appSettings section. Make sure that your package path is not a physical path like C:\MyPackages. With Azure websites, you will not have write access to the c:\ on the machines.

  • Right click the project and choose Publish website to deploy the website to Azure

  • In the dialog, sign into your Azure subscription and provide values for the web site name as given below

  • Continue the Wizard and click on Publish to start the deployment process.


  • After successful deployment you can browse the website from the url given for the website.

  • Now we have the source repository configured, next we can use this source to publish and install packages we need. That we’ll see in the next post.


No comments: