You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Deploying/README.md
+18-5Lines changed: 18 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ To run the NuGet Gallery in Azure you need to provision the following resources:
8
8
9
9
## Deploying to Azure
10
10
11
-
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.
11
+
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.
12
12
13
13
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.).
14
14
@@ -18,13 +18,22 @@ This guide will instruct you on hosting the Gallery to an Azure App Service. We
18
18
19
19
We recommend provisioning a dedicated Azure SQL Databases Server for the Gallery.
20
20
21
-
Follow the instrctions [here](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-get-started-portal) to create an Azure SQL DB.
21
+
Follow the instructions [here](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-get-started-portal) to create an Azure SQL Database.
22
+
23
+
After you create your Azure SQL Database, update the server's firewall settings to allow access from other Azure resources:
24
+
25
+
1. Navigate to the "SQL Servers" blade.
26
+
2. Select your SQL Server.
27
+
3. Under the "Security" section, select "Firewall and and virtual networks".
28
+
4. Make sure that "Allow Azure services and resources to access this server" is set to "Yes".
29
+
22
30
Copy the connection string from the portal. It should look something like:
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.
46
55
Copy the connection string from the portal. It should like something like:
To configure Gallery to use your new storage account:
62
+
51
63
1. Open the [web.config](https://github.com/NuGet/NuGetGallery/blob/master/src/NuGetGallery/Web.config#L27)
52
64
2. Set Gallery.StorageType to 'AzureStorage'
53
65
3. Replace all settings starting with 'Gallery.AzureStorage.' with your connection string.
54
66
55
67
## Deploying the Frontend/Backend
56
68
57
69
You are almost done! Here are additional configurations in web.config:
70
+
58
71
1. Gallery.SiteRoot - set with the URL of your Gallery website. For example: _https://mygallery.azurewebsites.net_
59
-
2. Gallery.SmtpUri (optional)- set SMTP credentials if you would like to receive e-mails from the service.
72
+
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!
60
73
61
-
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).
74
+
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).
You can configure the NuGetGallery to use Azure Active Directory to manage your accounts.
4
+
5
+
## Create an Azure Active Directory application registration
6
+
7
+
1. On the portal, open the ["App registrations" blade](https://ms.portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade).
8
+
1. Select "New registration".
9
+
1. For "Supported account types", select "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)".
10
+
11
+
> ⚠ **NOTE**: This allows any Azure Active Directory or personal account to create an account and publish packages to your on-prem gallery. If you'd like to authenticate with a specific directory (the "Single tenant" option), you will need to make a code change later.
12
+
13
+
1. For "Redirect URI", select "Web" with the value `https://<Your domain>/users/account/authenticate/return`.
14
+
1. Press "Register" to create the application.
15
+
16
+
You will need to configure the Azure Active Directory application before it can be used by the NuGetGallery:
17
+
18
+
1. On the "Overview" pane, note down the "Application (client) ID".
19
+
1. Navigate to the "Authentication" pane. Under the "Implicit grant" section, enable "ID tokens" and press "Save".
20
+
1. Navigate to "Certificates & secrets" pane and create a new client secret. Note the value of your client secret.
21
+
22
+
## Configure the Gallery
23
+
24
+
Now that the Azure Active Directory application is ready, let's configure the NuGetGallery to use your new app:
25
+
26
+
1. Open the NuGetGallery solution using Visual Studio.
27
+
1. Modify the "Web.config" file in the NuGetGallery project.
28
+
1. Modify the `Auth.AzureActiveDirectoryV2.Enabled` setting to `true`.
29
+
1. Modify the `Auth.AzureActiveDirectoryV2.ClientId` setting to the application ID you copied earlier.
30
+
1. Modify the `Auth.AzureActiveDirectoryV2.ClientSecret` setting to the client secret you copied earlier.
31
+
32
+
If you selected the "Single tenant" option when you created your Azure Active Directory app registration, update [`AzureActiveDirectoryV2AuthenticatorConfiguration`](https://github.com/NuGet/NuGetGallery/blob/0659deed143f0b58868fa691ec22f46f1d57cba6/src/NuGetGallery.Services/Authentication/Providers/AzureActiveDirectoryV2/AzureActiveDirectoryV2AuthenticatorConfiguration.cs#L53) to set the authority tenant ID to your AAD Tenant ID:
0 commit comments