-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to devcontainer and code to .net8
- Loading branch information
Showing
7 changed files
with
113 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<GetResume>(); | ||
} | ||
|
||
[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<GetResume>(); | ||
} | ||
|
||
[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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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": "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"IsEncrypted": false, | ||
"Values": { | ||
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", | ||
"AzureWebJobsStorage": "" | ||
} | ||
{ | ||
"IsEncrypted": false, | ||
"Values": { | ||
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", | ||
"AzureWebJobsStorage": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<AzureFunctionsVersion>v4</AzureFunctionsVersion> | ||
<OutputType>Exe</OutputType> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>serverless_resume_api</RootNamespace> | ||
<UserSecretsId>f1064ac0-4d4a-4f05-99f7-e19dae7d467e</UserSecretsId> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.8.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="5.0.1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Update="host.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="local.settings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>Never</CopyToPublishDirectory> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" /> | ||
</ItemGroup> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<AzureFunctionsVersion>v4</AzureFunctionsVersion> | ||
<OutputType>Exe</OutputType> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>serverless_resume_api</RootNamespace> | ||
<UserSecretsId>f1064ac0-4d4a-4f05-99f7-e19dae7d467e</UserSecretsId> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="6.2.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="6.2.0" /> | ||
|
||
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.20.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.15.1" /> | ||
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.21.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.0.0" /> | ||
|
||
</ItemGroup> | ||
<ItemGroup> | ||
<None Update="host.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="local.settings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>Never</CopyToPublishDirectory> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |