/AzureFunctions.GreenPipes

Little example of how to combined Azure Functions with Green Pipes!

Primary LanguageC#MIT LicenseMIT

AzureFunctions.GreenPipes

Little example of how to use GreenPipes with Azure Function.

Examples

Start hosting functions

PS > func host start
Http Function Function1: http://localhost:7071/api/Function1
Http Function Function2: http://localhost:7071/api/Function2

Unauthorized requests

PS > Invoke-RestMethod http://localhost:7071/api/Function1
Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At line:1 char:1
+ Invoke-RestMethod http://localhost:7071/api/Function1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

PS > Invoke-RestMethod http://localhost:7071/api/Function2
Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At line:1 char:1
+ Invoke-RestMethod http://localhost:7071/api/Function2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Authorized requests

PS > Invoke-RestMethod -Headers @{Authorization="abc-token"} http://localhost:7071/api/Function1
Hello World from Function1

PS > Invoke-RestMethod -Headers @{Authorization="abc-token"} http://localhost:7071/api/Function2
Hello World from Function2

Contributing

  1. Fork
  2. Hack!
  3. Pull Request