dotnet aks api template
1.0.0
dotnet new模板,用於創建一個為AKS創建完整的,12個因子,ASP.NET Core Web API。
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是否有存儲庫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).