-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Redis sample, adding Queue example.
Fixes #8
- Loading branch information
Showing
19 changed files
with
148 additions
and
44 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,4 @@ | ||
{ | ||
"azureFunctions.projectLanguage": "C#", | ||
"azureFunctions.projectRuntime": "~2" | ||
} |
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,4 @@ | ||
{ | ||
"azureFunctions.projectLanguage": "C#Script", | ||
"azureFunctions.projectRuntime": "~2" | ||
} |
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,10 +1,11 @@ | ||
{ | ||
"IsEncrypted": false, | ||
"Values": { | ||
"FUNCTIONS_WORKER_RUNTIME": "dotnet", | ||
"AzureWebJobsStorage": "UseDevelopmentStorage=true", | ||
"AzureWebJobsDashboard": "UseDevelopmentStorage=true", | ||
"AzureWebJobs_ExtensionsPath": ".", | ||
"eventgrid_sas": "EFgFqSaABprKP0Ww7jgf8TCY9L6lE3cVrB4+nVeloxc=", | ||
"eventgrid_endpoint": "https://frbtest.westeurope-1.eventgrid.azure.net/api/events" | ||
"eventgrid_sas": "", | ||
"eventgrid_endpoint": "https://xxxxx.westeurope-1.eventgrid.azure.net/api/events" | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-azuretools.vscode-azurefunctions", | ||
"ms-vscode.csharp" | ||
] | ||
} |
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,11 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Attach to C# Functions", | ||
"type": "coreclr", | ||
"request": "attach", | ||
"processId": "${command:azureFunctions.pickProcess}" | ||
} | ||
] | ||
} |
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,8 @@ | ||
{ | ||
"azureFunctions.projectRuntime": "~2", | ||
"azureFunctions.projectLanguage": "C#", | ||
"azureFunctions.templateFilter": "Verified", | ||
"azureFunctions.deploySubpath": "bin/Release/netstandard2.0/publish", | ||
"azureFunctions.preDeployTask": "publish", | ||
"debug.internalConsoleOptions": "neverOpen" | ||
} |
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,46 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "clean", | ||
"command": "dotnet clean", | ||
"type": "shell", | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "build", | ||
"command": "dotnet build", | ||
"type": "shell", | ||
"dependsOn": "clean", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "clean release", | ||
"command": "dotnet clean --configuration Release", | ||
"type": "shell", | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet publish --configuration Release", | ||
"type": "shell", | ||
"dependsOn": "clean release", | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "runFunctionsHost", | ||
"type": "shell", | ||
"dependsOn": "build", | ||
"options": { | ||
"cwd": "${workspaceFolder}/bin/Debug/netstandard2.0" | ||
}, | ||
"command": "func host start", | ||
"isBackground": true, | ||
"problemMatcher": "$func-watch" | ||
} | ||
] | ||
} |
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,37 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Fbeltrao.AzureFunctionExtensions; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Azure.WebJobs; | ||
using Microsoft.Azure.WebJobs.Extensions.Http; | ||
using Microsoft.Azure.WebJobs.Host; | ||
using Microsoft.Extensions.Logging; | ||
using StackExchange.Redis; | ||
|
||
namespace Fbeltrao.RedisSample | ||
{ | ||
public static class QueueTriggerWithRedisFunctions | ||
{ | ||
[FunctionName(nameof(MoveQueueItemToRedis))] | ||
public static async Task MoveQueueItemToRedis( | ||
[QueueTrigger("myqueue-items", Connection = "AzureWebJobsStorage")] string myQueueItem, | ||
[RedisDatabase(Connection = "%redis_connectionstring%")] IDatabase db, | ||
ILogger log) | ||
{ | ||
await db.ListRightPushAsync("my-queue", myQueueItem); | ||
log.LogInformation($"Queue trigger pushed to redis list: {myQueueItem}"); | ||
} | ||
|
||
|
||
[FunctionName(nameof(GetRedisList))] | ||
public static async Task<IActionResult> GetRedisList( | ||
[HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req, | ||
[RedisDatabase(Connection = "%redis_connectionstring%")] IDatabase db, | ||
ILogger log) | ||
{ | ||
var values = await db.ListRangeAsync("my-queue"); | ||
return new OkObjectResult(new { values }); | ||
} | ||
} | ||
} |
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,10 +1,11 @@ | ||
{ | ||
"IsEncrypted": false, | ||
"Values": { | ||
"FUNCTIONS_WORKER_RUNTIME": "dotnet", | ||
"AzureWebJobsStorage": "UseDevelopmentStorage=true", | ||
"AzureWebJobsDashboard": "UseDevelopmentStorage=true", | ||
"AzureWebJobs_ExtensionsPath": ".", | ||
"redis_connectionstring": "10.211.55.2:6379", | ||
"redis_connectionstring": "192.168.1.124:6379", | ||
"redis_setvalueinredis_key": "mySample" | ||
} | ||
} |
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
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
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