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).