dotnet aks api template
1.0.0
A dotnet new template for creating a fully-featured, 12 Factor, ASP.NET Core Web API for AKS.
dotnet new -i RobBell.AksApi.Template
The template resolves from the official NuGet repository.
To create a new project named MyApi:
dotnet new aksapi -n MyApi
Other options include:
--controller-name The name of the default controller
Default: SampleController
--disable-open-api Disable OpenAPI (Swagger) support
Default: false
--disable-health-check Disable liveness and readiness support
Default: false
--disable-logging Disable Logging and AppInsights support
Default: false
--instrumentation-key The AppInsights application key if logging is enabled
Default: 11111111-1111-1111-11111111111111111
--skip-restore Skips the restore of the project on create
Default: false
dotnet restoredotnet new creation map 1:1 with a repository?After making changes to the template, run the script below to pack and install locally:
./pack-and-install.sh
Once complete, you can create new projects from the template using:
dotnet new aksapi
Try:
dotnet new -i RobBell.AksApi.Template --nuget-source https://api.nuget.org/v3/index.json
Sometimes you might have private NuGet repositories in your package sources which interfere with installation of the template from the official repo. For example:
C:Program Filesdotnetsdk3.1.403NuGet.targets(128,5):
error : Unable to load the service index for source https://myprivatenugetrepo.com/nuget/v3/index.json.
C:Program Filesdotnetsdk3.1.403NuGet.targets(128,5):
error : Response status code does not indicate success: 401 (Unauthorized).