diff --git a/src/GetResume.cs b/src/GetResume.cs index d4820a2..d10f46b 100644 --- a/src/GetResume.cs +++ b/src/GetResume.cs @@ -1,32 +1,32 @@ -using System.Net; -using Microsoft.Azure.Functions.Worker; -using Microsoft.Azure.Functions.Worker.Http; -using Microsoft.Extensions.Logging; - -namespace Company.Function -{ - public class GetResume - { - private readonly ILogger _logger; - - public GetResume(ILoggerFactory loggerFactory) - { - _logger = loggerFactory.CreateLogger(); - } - - [Function("GetResume")] - public HttpResponseData Run( - [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req, - [BlobInput("resume/myresume.json")] string myResume) - { - _logger.LogInformation("C# HTTP trigger function processed a request."); - - var response = req.CreateResponse(HttpStatusCode.OK); - response.Headers.Add("Content-Type", "application/json; charset=utf-8"); - - response.WriteString(myResume); - - return response; - } - } -} +using System.Net; +using Microsoft.Azure.Functions.Worker; +using Microsoft.Azure.Functions.Worker.Http; +using Microsoft.Extensions.Logging; + +namespace Company.Function +{ + public class GetResume + { + private readonly ILogger _logger; + + public GetResume(ILoggerFactory loggerFactory) + { + _logger = loggerFactory.CreateLogger(); + } + + [Function("GetResume")] + public HttpResponseData Run( + [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req, + [BlobInput("resume/myresume.json")] string myResume) + { + _logger.LogInformation("C# HTTP trigger function processed a request."); + + var response = req.CreateResponse(HttpStatusCode.OK); + response.Headers.Add("Content-Type", "application/json; charset=utf-8"); + + response.WriteString(myResume); + + return response; + } + } +} diff --git a/src/Program.cs b/src/Program.cs index 51336f3..c76837e 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -1,7 +1,7 @@ -using Microsoft.Extensions.Hosting; - -var host = new HostBuilder() - .ConfigureFunctionsWorkerDefaults() - .Build(); - -host.Run(); +using Microsoft.Extensions.Hosting; + +var host = new HostBuilder() + .ConfigureFunctionsWorkerDefaults() + .Build(); + +host.Run(); diff --git a/src/Properties/launchSettings.json b/src/Properties/launchSettings.json index 38ad39b..f7527af 100644 --- a/src/Properties/launchSettings.json +++ b/src/Properties/launchSettings.json @@ -1,9 +1,9 @@ -{ - "profiles": { - "serverless_resume_api": { - "commandName": "Project", - "commandLineArgs": "--port 7172", - "launchBrowser": false - } - } +{ + "profiles": { + "serverless_resume_api": { + "commandName": "Project", + "commandLineArgs": "--port 7172", + "launchBrowser": false + } + } } \ No newline at end of file diff --git a/src/host.json b/src/host.json index ffbc52d..1fbf7f1 100644 --- a/src/host.json +++ b/src/host.json @@ -1,16 +1,16 @@ -{ - "version": "2.0", - "logging": { - "applicationInsights": { - "samplingSettings": { - "isEnabled": true, - "excludedTypes": "Request" - } - } - }, - "extensions": { - "http": { - "routePrefix": "" - } - } +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingSettings": { + "isEnabled": true, + "excludedTypes": "Request" + } + } + }, + "extensions": { + "http": { + "routePrefix": "" + } + } } \ No newline at end of file diff --git a/src/local.settings.sample.json b/src/local.settings.sample.json index 414c96c..bf711ec 100644 --- a/src/local.settings.sample.json +++ b/src/local.settings.sample.json @@ -1,7 +1,7 @@ -{ - "IsEncrypted": false, - "Values": { - "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", - "AzureWebJobsStorage": "" - } +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "" + } } \ No newline at end of file diff --git a/src/serverless-resume-api.csproj b/src/serverless-resume-api.csproj index 51342d5..dc2ff19 100644 --- a/src/serverless-resume-api.csproj +++ b/src/serverless-resume-api.csproj @@ -1,29 +1,34 @@ - - - net6.0 - v4 - Exe - enable - enable - serverless_resume_api - f1064ac0-4d4a-4f05-99f7-e19dae7d467e - - - - - - - - - - PreserveNewest - - - PreserveNewest - Never - - - - - + + + net8.0 + v4 + Exe + enable + enable + serverless_resume_api + f1064ac0-4d4a-4f05-99f7-e19dae7d467e + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + Never + + + + + \ No newline at end of file diff --git a/src/setup.sh b/src/setup.sh new file mode 100644 index 0000000..f1175a0 --- /dev/null +++ b/src/setup.sh @@ -0,0 +1,12 @@ +# set to 9 or 10 +DEBIAN_VERSION=10 + +wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg +sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ +wget -q https://packages.microsoft.com/config/debian/$DEBIAN_VERSION/prod.list +sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list +sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg +sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list + +sudo apt-get update +sudo apt-get install azure-functions-core-tools-4 \ No newline at end of file