From 4c1d36a1bcf4e81d3b490571d6737c3d16e2c8d7 Mon Sep 17 00:00:00 2001 From: Chris Ayers Date: Wed, 6 Apr 2022 11:14:18 -0700 Subject: [PATCH] added dotnet sample --- dotnet-sample/Program.cs | 6 ++++ dotnet-sample/appsettings.Development.json | 8 +++++ dotnet-sample/appsettings.json | 9 ++++++ dotnet-sample/dotnet-sample.csproj | 10 +++++++ dotnet-sample/iac/main.bicep | 35 ++++++++++++++++++++++ 5 files changed, 68 insertions(+) create mode 100644 dotnet-sample/Program.cs create mode 100644 dotnet-sample/appsettings.Development.json create mode 100644 dotnet-sample/appsettings.json create mode 100644 dotnet-sample/dotnet-sample.csproj create mode 100644 dotnet-sample/iac/main.bicep diff --git a/dotnet-sample/Program.cs b/dotnet-sample/Program.cs new file mode 100644 index 0000000..1760df1 --- /dev/null +++ b/dotnet-sample/Program.cs @@ -0,0 +1,6 @@ +var builder = WebApplication.CreateBuilder(args); +var app = builder.Build(); + +app.MapGet("/", () => "Hello World!"); + +app.Run(); diff --git a/dotnet-sample/appsettings.Development.json b/dotnet-sample/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/dotnet-sample/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/dotnet-sample/appsettings.json b/dotnet-sample/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/dotnet-sample/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/dotnet-sample/dotnet-sample.csproj b/dotnet-sample/dotnet-sample.csproj new file mode 100644 index 0000000..4ffc225 --- /dev/null +++ b/dotnet-sample/dotnet-sample.csproj @@ -0,0 +1,10 @@ + + + + net6.0 + enable + enable + dotnet_sample + + + diff --git a/dotnet-sample/iac/main.bicep b/dotnet-sample/iac/main.bicep new file mode 100644 index 0000000..660b571 --- /dev/null +++ b/dotnet-sample/iac/main.bicep @@ -0,0 +1,35 @@ +param webAppName string = uniqueString(resourceGroup().id) // Generate unique String for web app name +param sku string = 'S1' // The SKU of App Service Plan +param location string = resourceGroup().location // Location for all resources +param linuxFxVersion string = 'DOTNETCORE|6.0' // The runtime stack of web app + +var appServicePlanName = toLower('AppServicePlan-FeatureFlags') +var webSiteName = toLower('wapp-${webAppName}') + + +resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = { + name: appServicePlanName + location: location + sku: { + name: sku + } + kind: 'linux' + properties: { + reserved: true + } +} + +resource appService 'Microsoft.Web/sites@2020-06-01' = { + name: webSiteName + location: location + kind: 'app' + properties: { + serverFarmId: appServicePlan.id + siteConfig: { + linuxFxVersion: linuxFxVersion + + } + } +} + +output webAppName string = appService.name