dotnet aks api template
1.0.0
dotnet new для создания полнофункционального 12-факторного, основного веб-API ASP.NET для AKS.
dotnet new -i RobBell.AksApi.Template
Шаблон решается из официального репозитория Nuget.
Чтобы создать новый проект по имени Myapi :
dotnet new aksapi -n MyApi
Другие варианты включают:
--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 restore dotnet new Creation Map 1: 1 с репозиторием? После внесения изменений в шаблон запустите сценарий ниже, чтобы упаковать и установить локально:
./pack-and-install.sh
После завершения вы можете создать новые проекты из шаблона, используя:
dotnet new aksapi
Пытаться:
dotnet new -i RobBell.AksApi.Template --nuget-source https://api.nuget.org/v3/index.json
Иногда у вас могут быть частные репозитории Nuget в ваших источниках пакетов, которые мешают установке шаблона из официального репо. Например:
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).