-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #749 from MicrosoftLearning/dotnet8-prep
Dotnet 8 labs launch
- Loading branch information
Showing
268 changed files
with
152,536 additions
and
1,238 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api", "Api.csproj", "{05767BB4-C22D-4F7A-BD47-B6C7D347F4BC}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{05767BB4-C22D-4F7A-BD47-B6C7D347F4BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{05767BB4-C22D-4F7A-BD47-B6C7D347F4BC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{05767BB4-C22D-4F7A-BD47-B6C7D347F4BC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{05767BB4-C22D-4F7A-BD47-B6C7D347F4BC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {BAFEAA17-5F2E-452B-84F3-7555D3567EED} | ||
EndGlobalSection | ||
EndGlobal |
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
Binary file not shown.
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
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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web", "Web.csproj", "{C48CAA05-3E5D-4A41-B5B6-0C2D943831BD}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C48CAA05-3E5D-4A41-B5B6-0C2D943831BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C48CAA05-3E5D-4A41-B5B6-0C2D943831BD}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C48CAA05-3E5D-4A41-B5B6-0C2D943831BD}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C48CAA05-3E5D-4A41-B5B6-0C2D943831BD}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5D1796EB-4D97-47F6-B085-F69BE733E87A} | ||
EndGlobalSection | ||
EndGlobal |
Binary file not shown.
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,32 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Azure.WebJobs; | ||
using Microsoft.AspNetCore.Http; | ||
using System.Net; | ||
using Microsoft.Azure.Functions.Worker; | ||
using Microsoft.Azure.Functions.Worker.Http; | ||
using Microsoft.Extensions.Logging; | ||
|
||
public static class Echo | ||
namespace func | ||
{ | ||
[FunctionName("Echo")] | ||
public static IActionResult Run( | ||
[HttpTrigger("POST")] HttpRequest request, | ||
ILogger logger) | ||
public class Echo | ||
{ | ||
logger.LogInformation("Received a request"); | ||
return new OkObjectResult(request.Body); | ||
private readonly ILogger _logger; | ||
|
||
public Echo(ILoggerFactory loggerFactory) | ||
{ | ||
_logger = loggerFactory.CreateLogger<Echo>(); | ||
} | ||
|
||
[Function("Echo")] | ||
public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequestData req) | ||
{ | ||
_logger.LogInformation("C# HTTP trigger function processed a request."); | ||
|
||
var response = req.CreateResponse(HttpStatusCode.OK); | ||
response.Headers.Add("Content-Type", "text/plain; charset=utf-8"); | ||
|
||
StreamReader reader = new StreamReader(req.Body); | ||
string requestBody = reader.ReadToEnd(); | ||
response.WriteString(requestBody); | ||
|
||
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,12 +1,33 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Azure.WebJobs; | ||
|
||
public static class GetSettingInfo | ||
{ | ||
[FunctionName("GetSettingInfo")] | ||
public static IActionResult Run( | ||
[HttpTrigger("GET")] HttpRequest request, | ||
[Blob("content/settings.json")] string json) | ||
=> new OkObjectResult(json); | ||
} | ||
using System.Net; | ||
using Microsoft.Azure.Functions.Worker; | ||
using Microsoft.Azure.Functions.Worker.Http; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace func | ||
{ | ||
public class GetSettingInfo | ||
{ | ||
private readonly ILogger _logger; | ||
|
||
public GetSettingInfo(ILoggerFactory loggerFactory) | ||
{ | ||
_logger = loggerFactory.CreateLogger<GetSettingInfo>(); | ||
} | ||
|
||
[Function("GetSettingInfo")] | ||
public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequestData req, | ||
[BlobInput("content/settings.json", Connection = "AzureWebJobsStorage")] string blobContent | ||
) | ||
{ | ||
_logger.LogInformation("C# HTTP trigger function processed a request."); | ||
_logger.LogInformation($"{blobContent}"); | ||
|
||
var response = req.CreateResponse(HttpStatusCode.OK); | ||
response.Headers.Add("Content-Type", "text/plain; charset=utf-8"); | ||
|
||
response.WriteString($"{blobContent}"); | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
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,16 +1,39 @@ | ||
using System; | ||
using Microsoft.Azure.WebJobs; | ||
using Microsoft.Azure.WebJobs.Host; | ||
using Microsoft.Azure.Functions.Worker; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace func | ||
{ | ||
public static class Recurring | ||
public class Recurring | ||
{ | ||
[FunctionName("Recurring")] | ||
public static void Run([TimerTrigger("*/30 * * * * *")]TimerInfo myTimer, ILogger log) | ||
private readonly ILogger _logger; | ||
|
||
public Recurring(ILoggerFactory loggerFactory) | ||
{ | ||
_logger = loggerFactory.CreateLogger<Recurring>(); | ||
} | ||
|
||
[Function("Recurring")] | ||
public void Run([TimerTrigger("0 */2 * * * *")] MyInfo myTimer) | ||
{ | ||
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); | ||
_logger.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); | ||
_logger.LogInformation($"Next timer schedule at: {myTimer.ScheduleStatus.Next}"); | ||
} | ||
} | ||
} | ||
|
||
public class MyInfo | ||
{ | ||
public MyScheduleStatus ScheduleStatus { get; set; } | ||
|
||
public bool IsPastDue { get; set; } | ||
} | ||
|
||
public class MyScheduleStatus | ||
{ | ||
public DateTime Last { get; set; } | ||
|
||
public DateTime Next { get; set; } | ||
|
||
public DateTime LastUpdated { get; set; } | ||
} | ||
} |
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
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
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": { | ||
"AzureWebJobsStorage": "<storage-connection-string>", | ||
"FUNCTIONS_WORKER_RUNTIME": "dotnet" | ||
"AzureWebJobsStorage": "", | ||
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" | ||
} | ||
} |
Oops, something went wrong.