Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 2.97 KB

README.md

File metadata and controls

61 lines (40 loc) · 2.97 KB

Deploying the NuGet Gallery

To run the NuGet Gallery in Azure you need to provision the following resources:

  1. A SQL Database to hold the package metadata.
  2. A location in which to store package files. The Gallery supports two at the moment: Local File System and Azure Storage Account.
  3. A Web Frontend to host the Gallery.

Deploying to Azure

We suggest using Windows Azure for hosting the gallery, as that is the environment used by http://www.nuget.org itself. When doing so, we suggest using Azure SQL Databases for the database and Azure Storage Accounts to store package files.

This guide will instruct you on hosting the Gallery to an Azure App Service. We will start with provisiong the supporting resources (Database, Storage, etc.).

Provisioning for Azure

Provisioning a Database

We recommend provisioning a dedicated Azure SQL Databases Server for the Gallery.

Follow the instrctions here to create an Azure SQL DB. Copy the connection string from the portal. It should look something like:

Server=[servername].database.windows.net;Database=NuGetGallery;User ID=[username];Password=[password];Trusted_Connection=False;Encrypt=True

Now, it's time to update your new DB with the Gallery SQL schema.

  1. Open the NuGetGallery solution in Visual Studio.

  2. Open the web.config and replace the Gallery.SqlServer connection string with this value.

  3. Expand the "Package Manager Console" tool window:

Package Manager Console

  1. In the Package Manager console, type the following command:
Update-Database -ConfigurationTypeName MigrationsConfiguration

Provisioning Storage Accounts

Follow the instruction here to create an Azure storage account. Copy the connection string from the portal. It should like something like:

DefaultEndpointsProtocol=https;AccountName=[account name];AccountKey=[primary key];

To configure Gallery to use your new storage account:

  1. Open the web.config
  2. Set Gallery.StorageType to 'AzureStorage'
  3. Replace all settings starting with 'Gallery.AzureStorage.' with your connection string.

Deploying the Frontend/Backend

You are almost done! Here are additional configurations in web.config:

  1. Gallery.SiteRoot - set with the URL of your Gallery website. For example: https://mygallery.azurewebsites.net
  2. Gallery.SmtpUri (optional)- set SMTP credentials if you would like to receive e-mails from the service.

Now you are ready to publish the Gallery to your own Azure app service. To do this through Visual Studio follow the instructions here.