This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch to our logger * preserve correlation id when calling CorpusAccounts Co-authored-by: Stas Tishkin <statis@microsoft.com>
- Loading branch information
Showing
13 changed files
with
140 additions
and
95 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
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,40 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Microsoft.Azure.Functions.Worker; | ||
using Microsoft.Azure.Functions.Worker.Http; | ||
|
||
namespace Microsoft.OneFuzz.Service; | ||
|
||
public record FunctionInfo(string Name, string ResourceGroup, string? SlotName); | ||
|
||
|
||
public class Info | ||
{ | ||
|
||
private readonly ILogTracerFactory _loggerFactory; | ||
|
||
|
||
public Info(ILogTracerFactory loggerFactory) | ||
{ | ||
_loggerFactory = loggerFactory; | ||
} | ||
|
||
[Function("Info")] | ||
public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequestData req) | ||
{ | ||
var log = _loggerFactory.MakeLogTracer(Guid.NewGuid()); | ||
log.Info("Creating function info response"); | ||
var response = req.CreateResponse(); | ||
FunctionInfo info = new( | ||
$"{EnvironmentVariables.OneFuzz.InstanceName}", | ||
$"{EnvironmentVariables.OneFuzz.ResourceGroup}", | ||
Environment.GetEnvironmentVariable("WEBSITE_SLOT_NAME")); | ||
|
||
|
||
log.Info("Returning function info"); | ||
await response.WriteAsJsonAsync(info); | ||
log.Info("Returned function info"); | ||
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
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
Oops, something went wrong.