Run BaGetter on Azure
This page is a work in progress!
Use Azure to scale BaGetter. You can store metadata on Azure SQL Database or Table Storage, upload packages to Azure Blob Storage, and soon provide powerful search using Azure Search.
TODO
- App Service
- High availability setup
Configure BaGetter
You can modify BaGetter's configurations by editing the appsettings.json
file or through environment variables. For the full list of configurations, please refer to BaGetter's configuration guide.
Package Metadata Database
To storage the package metadata, you can use any Azure SQL database (as any normal SQL DB), but also Azure Table Storage in a Storage Account or Azure Cosmod DB in Table API mode.
- SQL Database
- Table Storage
To use a SQL database, set the database type to the SQL provider of your choice (e.g. SqlServer
) and provide a connection string:
{
...
"Database": {
"Type": "SqlServer",
"ConnectionString": "..."
},
...
}
To use Azure Table Storage or Azure Cosmos DB in Table API mode, set the database type to AzureTable
and provide a connection string and optionally a custom table name. If no table name is set, the default table name Packages
will be used.
If it doesn't exist, it will be created automatically.
{
...
"Database": {
"Type": "AzureTable",
"ConnectionString": "...",
"TableName": "my-nuget-packages"
},
...
}
Azure Blob Storage
Set the storage type to AzureBlobStorage
and provide a container name to use and credentials:
- Access Key
- Connection string
To use account name and access key, add them like this:
{
...
"Storage": {
"Type": "AzureBlobStorage",
"Container": "my-container",
"AccountName": "my-account",
"AccessKey": "abcd1234"
},
...
}
To use a connection string, add it like this:
{
...
"Storage": {
"Type": "AzureBlobStorage",
"Container": "my-container",
"ConnectionString": "AccountName=my-account;AccountKey=abcd1234;..."
},
...
}
Azure Search
Azure Search is currently not available due to significant API changes BaGetter has to make. Once it's available, you can set the search type to AzureSearch
and provide an account name and API key:
{
...
"Search": {
"Type": "AzureSearch",
"AccountName": "my-account",
"ApiKey": "ABCD1234"
},
...
}
Publish packages
Publish your first package with:
dotnet nuget push -s http://localhost:5000/v3/index.json package.1.0.0.nupkg
Publish your first symbol package with:
dotnet nuget push -s http://localhost:5000/v3/index.json symbol.package.1.0.0.snupkg
You should secure your server by requiring an API Key to publish packages. For more information, please refer to the Require an API Key guide.
Restore packages
You can restore packages by using the following package source:
http://localhost:5000/v3/index.json
Some helpful guides:
Symbol server
You can load symbols by using the following symbol location:
http://localhost:5000/api/download/symbols
For Visual Studio, please refer to the Configure Debugging guide.