Skip to content

Commit

Permalink
Improve deploy to Azure documentation (NuGet#8149)
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-sharma authored Aug 11, 2020
1 parent fc10e35 commit 533076a
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions docs/Deploying/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To run the NuGet Gallery in Azure you need to provision the following resources:

## 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.
We suggest using Azure to host the gallery, as that is the environment used by https://www.nuget.org itself. When doing so, we suggest using Azure SQL Databases for the database and Azure Storage to store packages.

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.).

Expand All @@ -18,13 +18,22 @@ This guide will instruct you on hosting the Gallery to an Azure App Service. We

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

Follow the instrctions [here](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-get-started-portal) to create an Azure SQL DB.
Follow the instructions [here](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-get-started-portal) to create an Azure SQL Database.

After you create your Azure SQL Database, update the server's firewall settings to allow access from other Azure resources:

1. Navigate to the "SQL Servers" blade.
2. Select your SQL Server.
3. Under the "Security" section, select "Firewall and and virtual networks".
4. Make sure that "Allow Azure services and resources to access this server" is set to "Yes".

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.
Now, let's update your new DB with the Gallery SQL schema.

1. Open the NuGetGallery solution in Visual Studio.

Expand All @@ -44,18 +53,22 @@ Update-Database -ConfigurationTypeName MigrationsConfiguration

Follow the instruction [here](https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=portal) 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](https://github.com/NuGet/NuGetGallery/blob/master/src/NuGetGallery/Web.config#L27)
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.
1. Gallery.AppInsightsInstrumentationKey - set to the [Application Insights](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview) instrumentation key to capture telemetry. Useful for debugging!

Now you are ready to publish the Gallery to your own Azure app service. To do this through Visual Studio follow the instructions [here](https://docs.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-to-azure).
You are now ready to publish the Gallery to your own Azure App Service. To do this through Visual Studio follow the instructions [here](https://docs.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-to-azure).

0 comments on commit 533076a

Please sign in to comment.