Skip to content

Commit 638dfa2

Browse files
authored
Merge pull request #79 from nicolgit/main
testing environment variables
2 parents 7c744c6 + 18bacb0 commit 638dfa2

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.dtmp
22
*.bkp
33
*.tmp
4+
*.sln

firewall-mon-api/helloWorld.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ public helloWorld(ILogger<helloWorld> logger)
1717
[Function("helloWorld")]
1818
public IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequest req)
1919
{
20+
        string? author = "";
21+
22+
author = Environment.GetEnvironmentVariable("author");
23+
        if (string.IsNullOrEmpty(author))
24+
        {
25+
            author = "unknown";
26+
}
27+
2028
_logger.LogInformation("C# HTTP trigger function processed a request.");
21-
return new OkObjectResult("Hello from the other side... of the endpoint.");
29+
return new OkObjectResult($"Hello from the other side... of the endpoint. Azure function owned by {author}.");
2230
}
2331
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"IsEncrypted": false,
3+
"Values": {
4+
"AzureWebJobsStorage": "",
5+
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
6+
"author" : "john john"
7+
}
8+
}

0 commit comments

Comments
 (0)