From 68f448fe6a60e1cade88c2004bf6491af7e5f1df Mon Sep 17 00:00:00 2001 From: Naren Soni Date: Thu, 11 Oct 2018 16:47:51 -0700 Subject: [PATCH] updating templates version to 2.0.0-10288 (#797) --- build/Settings.cs | 4 ++-- .../StaticResources/templates.json.template | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/Settings.cs b/build/Settings.cs index fe5d21e89..67ad7b621 100644 --- a/build/Settings.cs +++ b/build/Settings.cs @@ -19,8 +19,8 @@ private static string config(string @default = null, [CallerMemberName] string k : value; } - public const string ItemTemplatesVersion = "2.0.0-10262"; - public const string ProjectTemplatesVersion = "2.0.0-10262"; + public const string ItemTemplatesVersion = "2.0.0-10288"; + public const string ProjectTemplatesVersion = "2.0.0-10288"; public static readonly string SrcProjectPath = Path.GetFullPath("../src/Azure.Functions.Cli/"); diff --git a/src/Azure.Functions.Cli/StaticResources/templates.json.template b/src/Azure.Functions.Cli/StaticResources/templates.json.template index 1f1882078..93163be40 100644 --- a/src/Azure.Functions.Cli/StaticResources/templates.json.template +++ b/src/Azure.Functions.Cli/StaticResources/templates.json.template @@ -1 +1 @@ -[{"id":"BlobTrigger-CSharp","runtime":"2","files":{"BlobTriggerCSharp.csx":"public static void Run(Stream myBlob, string name, ILogger log)\r\n{\r\n log.LogInformation($\"C# Blob trigger function Processed blob\\n Name:{name} \\n Size: {myBlob.Length} Bytes\");\r\n}\r\n","readme.md":"# BlobTrigger - C#\r\n\r\nThe `BlobTrigger` makes it incredibly easy to react to new Blobs inside of Azure Blob Storage. This sample demonstrates a simple use case of processing data from a given Blob using C#.\r\n\r\n## How it works\r\n\r\nFor a `BlobTrigger` to work, you provide a path which dictates where the blobs are located inside your container, and can also help restrict the types of blobs you wish to return. For instance, you can set the path to `samples/{name}.png` to restrict the trigger to only the samples path and only blobs with \".png\" at the end of their name.\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":"samples-workitems/workitem.txt"},"function":{"disabled":false,"bindings":[{"name":"myBlob","type":"blobTrigger","direction":"in","path":"samples-workitems/{name}","connection":""}]},"metadata":{"defaultFunctionName":"BlobTriggerCSharp","description":"$BlobTrigger_description","name":"Blob trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"blob","enabledInTryMode":true,"userPrompt":["connection","path"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"BlobTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, myBlob) {\r\n context.log(\"JavaScript blob trigger function processed blob \\n Name:\", context.bindingData.name, \"\\n Blob Size:\", myBlob.length, \"Bytes\");\r\n};","readme.md":"# BlobTrigger - JavaScript\r\n\r\nThe `BlobTrigger` makes it incredibly easy to react to new Blobs inside of Azure Blob Storage. This sample demonstrates a simple use case of processing data from a given Blob using JavaScript.\r\n\r\n## How it works\r\n\r\nFor a `BlobTrigger` to work, you provide a path which dictates where the blobs are located inside your container, and can also help restrict the types of blobs you wish to return. For instance, you can set the path to `samples/{name}.png` to restrict the trigger to only the samples path and only blobs with \".png\" at the end of their name.\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":"samples-workitems/workitem.txt"},"function":{"disabled":false,"bindings":[{"name":"myBlob","type":"blobTrigger","direction":"in","path":"samples-workitems/{name}","connection":""}]},"metadata":{"defaultFunctionName":"BlobTriggerJS","description":"$BlobTrigger_description","name":"Blob trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"blob","enabledInTryMode":true,"userPrompt":["connection","path"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"BlobTrigger-Python","runtime":"2","files":{"readme.md":"# BlobTrigger - Python\r\n\r\nThe `BlobTrigger` makes it incredibly easy to react to new Blobs inside of Azure Blob Storage. This sample demonstrates a simple use case of processing data from a given Blob using Python.\r\n\r\n## How it works\r\n\r\nFor a `BlobTrigger` to work, you provide a path which dictates where the blobs are located inside your container, and can also help restrict the types of blobs you wish to return. For instance, you can set the path to `samples/{name}.png` to restrict the trigger to only the samples path and only blobs with \".png\" at the end of their name.\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":"samples-workitems/workitem.txt","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(myblob: func.InputStream):\r\n logging.info(f\"Python blob trigger function processed blob \\n\"\r\n f\"Name: {myblob.name}\\n\"\r\n f\"Blob Size: {myblob.length} bytes\")\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"name":"myblob","type":"blobTrigger","direction":"in","path":"samples-workitems/{name}","connection":""}]},"metadata":{"defaultFunctionName":"BlobTriggerPython","description":"$BlobTrigger_description","name":"Blob trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"blob","enabledInTryMode":true,"userPrompt":["connection","path"],"filters":["Python3"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"CosmosDBTrigger-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.DocumentDB.Core\"\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing Microsoft.Azure.Documents;\r\n\r\npublic static void Run(IReadOnlyList input, ILogger log)\r\n{\r\n if (input != null && input.Count > 0)\r\n {\r\n log.LogInformation(\"Documents modified \" + input.Count);\r\n log.LogInformation(\"First document Id \" + input[0].Id);\r\n }\r\n}\r\n"},"function":{"bindings":[{"type":"cosmosDBTrigger","name":"input","direction":"in","connectionStringSetting":"","databaseName":"","collectionName":"","leaseCollectionName":"leases","createLeaseCollectionIfNotExists":true}]},"metadata":{"defaultFunctionName":"CosmosTriggerCSharp","description":"$CosmosDBTrigger_description","name":"Azure Cosmos DB trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"cosmosDB","enabledInTryMode":false,"userPrompt":["connectionStringSetting","databaseName","collectionName","leaseCollectionName","createLeaseCollectionIfNotExists"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.CosmosDB","version":"3.0.1"}]}},{"id":"CosmosDBTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, documents) {\r\n if (!!documents && documents.length > 0) {\r\n context.log('Document Id: ', documents[0].id);\r\n }\r\n}\r\n","sample.dat":"[\r\n\t{\r\n\t\t\"id\": \"sample\"\r\n\t}\r\n]"},"function":{"bindings":[{"type":"cosmosDBTrigger","name":"documents","direction":"in","leaseCollectionName":"leases","connectionStringSetting":"","databaseName":"","collectionName":"","createLeaseCollectionIfNotExists":true}]},"metadata":{"defaultFunctionName":"CosmosTriggerJavascript","description":"$CosmosDBTrigger_description","name":"Azure Cosmos DB trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"cosmosDB","enabledInTryMode":false,"userPrompt":["connectionStringSetting","databaseName","collectionName","leaseCollectionName","createLeaseCollectionIfNotExists"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.CosmosDB","version":"3.0.1"}]}},{"id":"CosmosDBTrigger-Python","runtime":"2","files":{"sample.dat":"[\r\n\t{\r\n\t\t\"id\": \"sample\"\r\n\t}\r\n]","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(documents: func.DocumentList) -> str:\r\n if documents:\r\n logging.info('Document id: %s', documents[0].id)\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"type":"cosmosDBTrigger","name":"documents","direction":"in","leaseCollectionName":"leases","connectionStringSetting":"","databaseName":"","collectionName":"","createLeaseCollectionIfNotExists":true}]},"metadata":{"defaultFunctionName":"CosmosTriggerPython","description":"$CosmosDBTrigger_description","name":"Azure Cosmos DB trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"cosmosDB","enabledInTryMode":false,"userPrompt":["connectionStringSetting","databaseName","collectionName","leaseCollectionName","createLeaseCollectionIfNotExists"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.CosmosDB","version":"3.0.1"}],"filters":["Python3"]}},{"id":"DurableFunctionsActivity-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.WebJobs.Extensions.DurableTask\"\r\n\r\npublic static string Run(string name)\r\n{\r\n return $\"Hello {name}!\";\r\n}","sample.dat":""},"function":{"bindings":[{"name":"name","type":"activityTrigger","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"Hello","description":"$DurableFunctionsActivity_description","name":"Durable Functions activity","language":"C#","category":["$temp_category_durableFunctions"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.DurableTask","version":"1.6.2"}]}},{"id":"DurableFunctionsHttpStart-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.WebJobs.Extensions.DurableTask\"\r\n#r \"Newtonsoft.Json\"\r\n\r\nusing System.Net;\r\n\r\npublic static async Task Run(\r\n HttpRequestMessage req,\r\n DurableOrchestrationClient starter,\r\n string functionName,\r\n ILogger log)\r\n{\r\n // Function input comes from the request content.\r\n dynamic eventData = await req.Content.ReadAsAsync();\r\n\r\n // Pass the function name as part of the route \r\n string instanceId = await starter.StartNewAsync(functionName, eventData);\r\n\r\n log.LogInformation($\"Started orchestration with ID = '{instanceId}'.\");\r\n\r\n return starter.CreateCheckStatusResponse(req, instanceId);\r\n}"},"function":{"bindings":[{"authLevel":"anonymous","name":"req","type":"httpTrigger","direction":"in","route":"orchestrators/{functionName}","methods":["post","get"]},{"name":"$return","type":"http","direction":"out"},{"name":"starter","type":"orchestrationClient","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"DurableFunctionsHttpStart","description":"$DurableFunctionsHttpStart_description","name":"Durable Functions HTTP starter","language":"C#","category":["$temp_category_durableFunctions"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.DurableTask","version":"1.6.2"}]}},{"id":"DurableFunctionsOrchestrator-CSharp","runtime":"2","files":{"run.csx":"/*\r\n * Before running this sample, please create a Durable Activity function (default name is \"Hello\")\r\n */\r\n\r\n#r \"Microsoft.Azure.WebJobs.Extensions.DurableTask\"\r\n\r\npublic static async Task> Run(DurableOrchestrationContext context)\r\n{\r\n var outputs = new List();\r\n\r\n // Replace \"Hello\" with the name of your Durable Activity Function.\r\n outputs.Add(await context.CallActivityAsync(\"Hello\", \"Tokyo\"));\r\n outputs.Add(await context.CallActivityAsync(\"Hello\", \"Seattle\"));\r\n outputs.Add(await context.CallActivityAsync(\"Hello\", \"London\"));\r\n\r\n // returns [\"Hello Tokyo!\", \"Hello Seattle!\", \"Hello London!\"]\r\n return outputs;\r\n}","sample.dat":""},"function":{"bindings":[{"name":"context","type":"orchestrationTrigger","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"DurableFunctionsOrchestratorCSharp","description":"$DurableFunctionsOrchestrator_description","name":"Durable Functions orchestrator","language":"C#","category":["$temp_category_durableFunctions"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.DurableTask","version":"1.6.2"}]}},{"id":"EventGridTrigger-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.EventGrid\"\r\nusing Microsoft.Azure.EventGrid.Models;\r\n\r\npublic static void Run(EventGridEvent eventGridEvent, ILogger log)\r\n{\r\n log.LogInformation(eventGridEvent.Data.ToString());\r\n}\r\n","sample.dat":"{\n \"topic\": \"/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/test/providers/Microsoft.EventHub/namespaces/test\",\n \"subject\": \"eventhubs/test\",\n \"eventType\": \"captureFileCreated\",\n \"eventTime\": \"2017-07-14T23:10:27.7689666Z\",\n \"id\": \"7b11c4ce-1c34-4416-848b-1730e766f126\",\n \"data\": {\n \"fileUrl\": \"https://test.blob.core.windows.net/debugging/testblob.txt\",\n \"fileType\": \"AzureBlockBlob\",\n \"partitionId\": \"1\",\n \"sizeInBytes\": 0,\n \"eventCount\": 0,\n \"firstSequenceNumber\": -1,\n \"lastSequenceNumber\": -1,\n \"firstEnqueueTime\": \"0001-01-01T00:00:00\",\n \"lastEnqueueTime\": \"0001-01-01T00:00:00\"\n },\n \"dataVersion\": \"\",\n \"metadataVersion\": \"1\" \n}\n"},"function":{"bindings":[{"type":"eventGridTrigger","name":"eventGridEvent","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"EventGridTriggerCSharp","description":"$EventGridTrigger_description","name":"Event Grid trigger","language":"C#","category":["$temp_category_core","$$temp_category_dataProcessing"],"categoryStyle":"eventGrid","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventGrid","version":"2.0.0"}]}},{"id":"EventGridTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, eventGridEvent) {\r\n context.log(typeof eventGridEvent);\r\n context.log(eventGridEvent);\r\n};","sample.dat":"{\n \"topic\": \"/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/test/providers/Microsoft.EventHub/namespaces/test\",\n \"subject\": \"eventhubs/test\",\n \"eventType\": \"captureFileCreated\",\n \"eventTime\": \"2017-07-14T23:10:27.7689666Z\",\n \"id\": \"7b11c4ce-1c34-4416-848b-1730e766f126\",\n \"data\": {\n \"fileUrl\": \"https://test.blob.core.windows.net/debugging/testblob.txt\",\n \"fileType\": \"AzureBlockBlob\",\n \"partitionId\": \"1\",\n \"sizeInBytes\": 0,\n \"eventCount\": 0,\n \"firstSequenceNumber\": -1,\n \"lastSequenceNumber\": -1,\n \"firstEnqueueTime\": \"0001-01-01T00:00:00\",\n \"lastEnqueueTime\": \"0001-01-01T00:00:00\"\n },\n \"dataVersion\": \"\", \n \"metadataVersion\": \"1\" \n}\n"},"function":{"bindings":[{"type":"eventGridTrigger","name":"eventGridEvent","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"EventGridTriggerJS","description":"$EventGridTrigger_description","name":"Event Grid trigger","language":"JavaScript","category":["$temp_category_core","$$temp_category_dataProcessing"],"categoryStyle":"eventGrid","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventGrid","version":"2.0.0"}]}},{"id":"EventGridTrigger-Python","runtime":"2","files":{"sample.dat":"{\n 'topic': '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/test/providers/Microsoft.EventHub/namespaces/test',\n 'subject': 'eventhubs/test',\n 'eventType': 'captureFileCreated',\n 'eventTime': '2017-07-14T23:10:27.7689666Z',\n 'id': '7b11c4ce-1c34-4416-848b-1730e766f126',\n 'data': {\n 'fileUrl': 'https://test.blob.core.windows.net/debugging/testblob.txt',\n 'fileType': 'AzureBlockBlob',\n 'partitionId': '1',\n 'sizeInBytes': 0,\n 'eventCount': 0,\n 'firstSequenceNumber': -1,\n 'lastSequenceNumber': -1,\n 'firstEnqueueTime': '0001-01-01T00:00:00',\n 'lastEnqueueTime': '0001-01-01T00:00:00'\n },\n \"dataVersion\": \"\", \n \"metadataVersion\": \"1\" \n}\n","__init__.py":"import json\r\nimport logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(event: func.EventGridEvent):\r\n result = json.dumps({\r\n 'id': event.id,\r\n 'data': event.get_json(),\r\n 'topic': event.topic,\r\n 'subject': event.subject,\r\n 'event_type': event.event_type,\r\n })\r\n\r\n logging.info('Python EventGrid trigger processed an event: %s', result)\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"type":"eventGridTrigger","name":"event","direction":"in"}]},"metadata":{"defaultFunctionName":"EventGridTriggerPython","description":"$EventGridTrigger_description","name":"Event Grid trigger","language":"Python","category":["$temp_category_core","$$temp_category_dataProcessing"],"categoryStyle":"eventGrid","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventGrid","version":"2.0.0"}]}},{"id":"EventHubTrigger-CSharp","runtime":"2","files":{"run.csx":"using System;\r\n\r\npublic static void Run(string myEventHubMessage, ILogger log)\r\n{\r\n log.LogInformation($\"C# Event Hub trigger function processed a message: {myEventHubMessage}\");\r\n}\r\n","sample.dat":"Test Message"},"function":{"disabled":false,"bindings":[{"type":"eventHubTrigger","name":"myEventHubMessage","direction":"in","eventHubName":"samples-workitems","connection":"","consumerGroup":"$Default"}]},"metadata":{"defaultFunctionName":"EventHubTriggerCSharp","description":"$EventHubTrigger_description","name":"Event Hub trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"eventHub","enabledInTryMode":false,"userPrompt":["connection","eventHubName","consumerGroup"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventHubs","version":"3.0.0"}]}},{"id":"EventHubTrigger-Python","runtime":"2","files":{"sample.dat":"Test Message","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(event: func.EventHubEvent):\r\n logging.info('Python EventHub trigger processed an event: %s',\r\n event.get_body().decode('utf-8'))\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"type":"eventHubTrigger","name":"event","direction":"in","eventHubName":"samples-workitems","connection":"","cardinality":"many","consumerGroup":"$Default"}]},"metadata":{"defaultFunctionName":"EventHubTriggerPython","description":"$EventHubTrigger_description","name":"Event Hub trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"eventHub","enabledInTryMode":false,"userPrompt":["connection","eventHubName","consumerGroup"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventHubs","version":"3.0.0"}]}},{"id":"HttpTrigger-CSharp","runtime":"2","files":{"readme.md":"# HttpTrigger - C#\r\n\r\nThe `HttpTrigger` makes it incredibly easy to have your functions executed via an HTTP call to your function.\r\n\r\n## How it works\r\n\r\nWhen you call the function, be sure you checkout which security rules you apply. If you're using an apikey, you'll need to include that in your request.\r\n\r\n## Learn more\r\n\r\n Documentation","run.csx":"#r \"Newtonsoft.Json\"\r\n\r\nusing System.Net;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.Extensions.Primitives;\r\nusing Newtonsoft.Json;\r\n\r\npublic static async Task Run(HttpRequest req, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\");\r\n\r\n string name = req.Query[\"name\"];\r\n\r\n string requestBody = await new StreamReader(req.Body).ReadToEndAsync();\r\n dynamic data = JsonConvert.DeserializeObject(requestBody);\r\n name = name ?? data?.name;\r\n\r\n return name != null\r\n ? (ActionResult)new OkObjectResult($\"Hello, {name}\")\r\n : new BadRequestObjectResult(\"Please pass a name on the query string or in the request body\");\r\n}\r\n","sample.dat":"{\r\n \"name\": \"Azure\"\r\n}"},"function":{"disabled":false,"bindings":[{"authLevel":"function","name":"req","type":"httpTrigger","direction":"in","methods":["get","post"]},{"name":"$return","type":"http","direction":"out"}]},"metadata":{"defaultFunctionName":"HttpTriggerCSharp","description":"$HttpTrigger_description","name":"HTTP trigger","language":"C#","category":["$temp_category_core","$temp_category_api"],"categoryStyle":"http","enabledInTryMode":true,"userPrompt":["authLevel"]}},{"id":"HttpTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, req) {\r\n context.log('JavaScript HTTP trigger function processed a request.');\r\n\r\n if (req.query.name || (req.body && req.body.name)) {\r\n context.res = {\r\n // status: 200, /* Defaults to 200 */\r\n body: \"Hello \" + (req.query.name || req.body.name)\r\n };\r\n }\r\n else {\r\n context.res = {\r\n status: 400,\r\n body: \"Please pass a name on the query string or in the request body\"\r\n };\r\n }\r\n};","sample.dat":"{\r\n \"name\": \"Azure\"\r\n}"},"function":{"disabled":false,"bindings":[{"authLevel":"function","type":"httpTrigger","direction":"in","name":"req","methods":["get","post"]},{"type":"http","direction":"out","name":"res"}]},"metadata":{"defaultFunctionName":"HttpTriggerJS","description":"$HttpTrigger_description","name":"HTTP trigger","language":"JavaScript","trigger":"HttpTrigger","category":["$temp_category_core","$temp_category_api"],"categoryStyle":"http","enabledInTryMode":true,"userPrompt":["authLevel"]}},{"id":"HttpTrigger-PowerShell","runtime":"2","files":{"run.ps1":"# Input bindings are passed in via param block.\nparam($req, $TriggerMetadata)\n\n# Write to the Azure Functions Trace-level log stream.\nWrite-Verbose \"PowerShell HTTP trigger function processed a request.\" -Verbose\n\n# Interact with query parameters, the body of the request, etc.\n$name = $req.Query.Name\nif (-not $name) { $name = $req.Body.Name }\n\nif($name) {\n $status = 200\n $body = \"Hello \" + $name\n}\nelse {\n $status = 400\n $body = \"Please pass a name on the query string or in the request body.\"\n}\n\n# Associate values to output bindings by calling 'Push-OutputBinding'.\nPush-OutputBinding -Name res -Value ([HttpResponseContext]@{\n StatusCode = $status\n Body = $body\n})\n","sample.dat":"{\r\n \"name\": \"Azure\"\r\n}\r\n"},"function":{"disabled":false,"bindings":[{"authLevel":"function","type":"httpTrigger","direction":"in","name":"req","methods":["get","post"]},{"type":"http","direction":"out","name":"res"}]},"metadata":{"defaultFunctionName":"HttpTriggerPS","description":"$HttpTrigger_description","name":"HTTP trigger","language":"PowerShell","trigger":"HttpTrigger","category":["$temp_category_core","$temp_category_api"],"categoryStyle":"http","enabledInTryMode":true,"userPrompt":["authLevel"]}},{"id":"HttpTrigger-Python","runtime":"2","files":{"sample.dat":"{\r\n \"name\": \"Azure\"\r\n}","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(req: func.HttpRequest) -> func.HttpResponse:\r\n logging.info('Python HTTP trigger function processed a request.')\r\n\r\n name = req.params.get('name')\r\n if not name:\r\n try:\r\n req_body = req.get_json()\r\n except ValueError:\r\n pass\r\n else:\r\n name = req_body.get('name')\r\n\r\n if name:\r\n return func.HttpResponse(f\"Hello {name}!\")\r\n else:\r\n return func.HttpResponse(\r\n \"Please pass a name on the query string or in the request body\",\r\n status_code=400\r\n )\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"authLevel":"anonymous","type":"httpTrigger","direction":"in","name":"req","methods":["get","post"]},{"type":"http","direction":"out","name":"$return"}]},"metadata":{"defaultFunctionName":"HttpTriggerPython","description":"$HttpTrigger_description","name":"HTTP trigger","language":"Python","trigger":"HttpTrigger","category":["$temp_category_core","$temp_category_api"],"categoryStyle":"http","enabledInTryMode":true,"userPrompt":["authLevel"],"filters":["Python3"]}},{"id":"OutlookMessageWebhookCreator-CSharp","runtime":"2","files":{"run.csx":"using System;\r\nusing System.Net;\r\n\r\npublic static HttpResponseMessage run(HttpRequestMessage req, out string clientState, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\");\r\n\tclientState = Guid.NewGuid().ToString();\r\n\treturn new HttpResponseMessage(HttpStatusCode.OK);\r\n}"},"function":{"bindings":[{"name":"req","type":"httpTrigger","direction":"in"},{"type":"graphWebhookSubscription","name":"clientState","direction":"out","action":"create","subscriptionResource":"me/mailFolders('Inbox')/messages","changeTypes":["created"],"identity":"userFromRequest"},{"type":"http","name":"$return","direction":"out"}],"disabled":false},"metadata":{"defaultFunctionName":"OutlookMessageWebhookCreatorCSharp","description":"$OutlookMessageWebhookCreator_description","name":"Outlook message webhook creator","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]},{"resourceAppId":"00000003-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"570282fd-fa5c-430d-a7fd-fc8dc98a9dca"}]}]}},{"id":"OutlookMessageWebhookDeleter-CSharp","runtime":"2","files":{"run.csx":"#r \"Newtonsoft.Json\"\r\n#r \"Microsoft.Graph\"\r\n\r\nusing Microsoft.Graph;\r\nusing System.Net;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.Extensions.Primitives;\r\nusing Newtonsoft.Json;\r\n\r\npublic static async Task Run(HttpRequest req, Subscription[] existingSubscriptions, IAsyncCollector subscriptionsToDelete, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\");\r\n foreach (var subscription in existingSubscriptions)\r\n {\r\n log.LogInformation($\"Deleting subscription {subscription.Id}\");\r\n await subscriptionsToDelete.AddAsync(subscription.Id);\r\n }\r\n}"},"function":{"bindings":[{"name":"req","type":"httpTrigger","direction":"in"},{"type":"graphWebhookSubscription","name":"existingSubscriptions","direction":"in","filter":"userFromRequest"},{"type":"graphWebhookSubscription","name":"subscriptionsToDelete","direction":"out","action":"delete","identity":"userFromRequest"},{"type":"http","name":"res","direction":"out"}],"disabled":false},"metadata":{"defaultFunctionName":"OutlookMessageWebhookDeleterCSharp","description":"$OutlookMessageWebhookDeleter_description","name":"Outlook message webhook deleter","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]},{"resourceAppId":"00000003-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"570282fd-fa5c-430d-a7fd-fc8dc98a9dca"}]}]}},{"id":"OutlookMessageWebhookHandler-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Graph\"\r\nusing Microsoft.Graph;\r\nusing System.Net;\r\n\r\npublic static async Task Run(Message msg, ILogger log) \r\n{\r\n\tlog.LogInformation(\"Microsoft Graph webhook trigger function processed a request.\");\r\n\r\n // Testable by sending an email with the Subject \"[DEMO] Azure Functions\" and some text body\r\n if (msg.Subject.Contains(\"[DEMO] Azure Functions\")) {\r\n log.LogInformation($\"Processed email: {msg.BodyPreview}\");\r\n }\r\n}"},"function":{"bindings":[{"name":"msg","type":"graphWebhookTrigger","direction":"in","resourceType":"#Microsoft.Graph.Message"}],"disabled":false},"metadata":{"defaultFunctionName":"OutlookMessageWebhookHandlerCSharp","description":"$OutlookMessageWebhookHandler_description","name":"Outlook message webhook handler","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]},{"resourceAppId":"00000003-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"570282fd-fa5c-430d-a7fd-fc8dc98a9dca"}]}]}},{"id":"OutlookMessageWebhookRefresher-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.WebJobs.Extensions.Tokens\"\r\n#r \"Microsoft.Azure.WebJobs.Extensions.O365\"\r\n\r\nusing System.Net;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.Extensions.Primitives;\r\nusing Microsoft.Azure.WebJobs;\r\n\r\npublic static async Task Run(TimerInfo myTimer, UserSubscription[] existingSubscriptions, IBinder binder, ILogger log)\r\n{\r\n log.LogInformation($\"C# Timer trigger function executed at: {DateTime.Now}\");\r\n foreach (var subscription in existingSubscriptions)\r\n {\r\n // binding in code to allow dynamic identity\r\n var subscriptionsToRefresh = await binder.BindAsync>(\r\n new GraphWebhookSubscriptionAttribute()\r\n {\r\n Action = GraphWebhookSubscriptionAction.Refresh,\r\n Identity = TokenIdentityMode.UserFromId,\r\n UserId = subscription.UserId\r\n }\r\n );\r\n {\r\n log.LogInformation($\"Refreshing subscription {subscription.Id}\");\r\n await subscriptionsToRefresh.AddAsync(subscription.Id);\r\n }\r\n }\r\n}\r\n\r\npublic class UserSubscription {\r\n public string UserId {get; set;}\r\n public string Id {get; set;}\r\n}"},"function":{"bindings":[{"name":"myTimer","type":"timerTrigger","direction":"in","schedule":"0 * * */2 * *"},{"type":"graphWebhookSubscription","name":"existingSubscriptions","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"OutlookMessageWebhookRefresherCSharp","description":"$OutlookMessageWebhookRefresher_description","name":"Outlook message webhook refresher","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]},{"resourceAppId":"00000003-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"570282fd-fa5c-430d-a7fd-fc8dc98a9dca"}]}]}},{"id":"ProfilePhotoAPI-CSharp","runtime":"2","files":{"run.csx":"using System.Net; \r\nusing System.Net.Http; \r\nusing System.Net.Http.Headers; \r\n\r\npublic static async Task Run(HttpRequestMessage req, string graphToken, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\"); \r\n HttpClient client = new HttpClient();\r\n client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(\"Bearer\", graphToken);\r\n return await client.GetAsync(\"https://graph.microsoft.com/v1.0/me/photo/$value\");\r\n}"},"function":{"bindings":[{"name":"req","type":"httpTrigger","direction":"in","authLevel":"anonymous","methods":["get"]},{"name":"graphToken","type":"token","direction":"in","resource":"https://graph.microsoft.com","identity":"userFromRequest"},{"name":"$return","type":"http","direction":"out"}],"disabled":false},"metadata":{"defaultFunctionName":"ProfilePhotoAPICSharp","description":"$ProfilePhotoAPI_description","name":"Microsoft Graph profile photo API","trigger":"HttpTrigger","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.AuthTokens","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]}]}},{"id":"QueueTrigger-CSharp","runtime":"2","files":{"readme.md":"# QueueTrigger - C#\r\n\r\nThe `QueueTrigger` makes it incredibly easy to react to new Queues inside of Azure Queue Storage. This sample demonstrates a simple use case of processing data from a given Queue using C#.\r\n\r\n## How it works\r\n\r\nFor a `QueueTrigger` to work, you must provide a queue name that defines the queue messages will be read from.\r\n\r\n## Learn more\r\n\r\n Documentation","run.csx":"using System;\r\n\r\npublic static void Run(string myQueueItem, ILogger log)\r\n{\r\n log.LogInformation($\"C# Queue trigger function processed: {myQueueItem}\");\r\n}\r\n","sample.dat":"sample queue data"},"function":{"disabled":false,"bindings":[{"name":"myQueueItem","type":"queueTrigger","direction":"in","queueName":"myqueue-items","connection":""}]},"metadata":{"defaultFunctionName":"QueueTriggerCSharp","description":"$QueueTrigger_description","name":"Queue trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"queue","enabledInTryMode":true,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"QueueTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, myQueueItem) {\r\n context.log('JavaScript queue trigger function processed work item', myQueueItem);\r\n};","readme.md":"# QueueTrigger - JavaScript\r\n\r\nThe `QueueTrigger` makes it incredibly easy to react to new Queues inside of Azure Queue Storage. This sample demonstrates a simple use case of processing data from a given Queue using C#.\r\n\r\n## How it works\r\n\r\nFor a `QueueTrigger` to work, you provide a path which dictates where the queue messages are located inside your container.\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":"sample queue data"},"function":{"disabled":false,"bindings":[{"name":"myQueueItem","type":"queueTrigger","direction":"in","queueName":"js-queue-items","connection":""}]},"metadata":{"defaultFunctionName":"QueueTriggerJS","description":"$QueueTrigger_description","name":"Queue trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"queue","enabledInTryMode":true,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"QueueTrigger-Python","runtime":"2","files":{"readme.md":"# QueueTrigger - Python\r\n\r\nThe `QueueTrigger` makes it incredibly easy to react to new Queues inside of Azure Queue Storage. This sample demonstrates a simple use case of processing data from a given Queue.\r\n\r\n## How it works\r\n\r\nFor a `QueueTrigger` to work, you provide a path which dictates where the queue messages are located inside your container.\r\n\r\n## Learn more\r\n\r\n Documentation\r\n","sample.dat":"sample queue data","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(msg: func.QueueMessage) -> None:\r\n logging.info('Python queue trigger function processed a queue item: %s',\r\n msg.get_body().decode('utf-8'))\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"name":"msg","type":"queueTrigger","direction":"in","queueName":"python-queue-items","connection":""}]},"metadata":{"defaultFunctionName":"QueueTriggerPython","description":"$QueueTrigger_description","name":"Queue trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"queue","enabledInTryMode":true,"userPrompt":["connection","queueName"],"filters":["Python3"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"SendGrid-CSharp","runtime":"2","files":{"run.csx":"// The 'From' and 'To' fields are automatically populated with the values specified by the binding settings.\r\n//\r\n// You can also optionally configure the default From/To addresses globally via host.config, e.g.:\r\n//\r\n// {\r\n// \"sendGrid\": {\r\n// \"to\": \"user@host.com\",\r\n// \"from\": \"Azure Functions \"\r\n// }\r\n// }\r\n#r \"SendGrid\"\r\n\r\nusing System;\r\nusing SendGrid.Helpers.Mail;\r\nusing Microsoft.Azure.WebJobs.Host;\r\n\r\npublic static SendGridMessage Run(Order order, ILogger log)\r\n{\r\n log.LogInformation($\"C# Queue trigger function processed order: {order.OrderId}\");\r\n\r\n SendGridMessage message = new SendGridMessage()\r\n {\r\n Subject = $\"Thanks for your order (#{order.OrderId})!\"\r\n };\r\n\r\n message.AddContent(\"text/plain\", $\"{order.CustomerName}, your order ({order.OrderId}) is being processed!\");\r\n return message;\r\n}\r\npublic class Order\r\n{\r\n public string OrderId { get; set; }\r\n public string CustomerName { get; set; }\r\n public string CustomerEmail { get; set; }\r\n}\r\n","sample.dat":"{ \"OrderId\": 12345, \"CustomerName\": \"Joe Schmoe\", \"CustomerEmail\": \"joeschmoe@foo.com\" }"},"function":{"bindings":[{"type":"queueTrigger","name":"order","direction":"in","queueName":"samples-orders-csharp"},{"type":"sendGrid","name":"$return","direction":"out","apiKey":"SendGridApiKey","from":"Azure Functions ","to":"{CustomerEmail}"}]},"metadata":{"defaultFunctionName":"SendGridCSharp","description":"$SendGrid_description","name":"SendGrid","language":"C#","category":["$temp_category_samples","$temp_category_dataProcessing"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":["to","from","apiKey"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.SendGrid","version":"3.0.0"}]}},{"id":"SendGrid-JavaScript","runtime":"2","files":{"index.js":"var util = require('util');\r\n\r\n// The 'From' and 'To' fields are automatically populated with the values specified by the binding settings.\r\n//\r\n// You can also optionally configure the default From/To addresses globally via host.config, e.g.:\r\n//\r\n// {\r\n// \"sendGrid\": {\r\n// \"to\": \"user@host.com\",\r\n// \"from\": \"Azure Functions \"\r\n// }\r\n// }\r\nmodule.exports = async function (context, order) {\r\n context.log('JavaScript queue trigger function processed order', order.orderId);\r\n\r\n context.bindings.message = {\r\n subject: util.format('Thanks for your order (#%d)!', order.orderId),\r\n content: [{\r\n type: 'text/plain',\r\n value: util.format(\"%s, your order (%d) is being processed!\", order.customerName, order.orderId)\r\n }]\r\n };\r\n}","sample.dat":"{ \"orderId\": 12345, \"customerName\": \"Joe Schmoe\", \"customerEmail\": \"joeschmoe@foo.com\" }"},"function":{"bindings":[{"type":"queueTrigger","name":"order","direction":"in","queueName":"samples-orders"},{"type":"sendGrid","name":"message","direction":"out","apiKey":"SendGridApiKey","from":"Azure Functions ","to":"{customerEmail}","subject":"","text":""}]},"metadata":{"defaultFunctionName":"SendGridJS","description":"$SendGrid_description","name":"SendGrid","language":"JavaScript","category":["$temp_category_samples","$temp_category_dataProcessing"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":["to","from","subject","text","apiKey"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.SendGrid","version":"3.0.0"}]}},{"id":"ServiceBusQueueTrigger-CSharp","runtime":"2","files":{"run.csx":"using System;\r\nusing System.Threading.Tasks;\r\n\r\npublic static void Run(string myQueueItem, ILogger log)\r\n{\r\n log.LogInformation($\"C# ServiceBus queue trigger function processed message: {myQueueItem}\");\r\n}\r\n","sample.dat":"Service Bus Message"},"function":{"disabled":false,"bindings":[{"name":"myQueueItem","type":"serviceBusTrigger","direction":"in","queueName":"myqueue","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusQueueTriggerCSharp","description":"$ServiceBusQueueTrigger_description","name":"Service Bus Queue trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusQueueTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function(context, mySbMsg) {\r\n context.log('JavaScript ServiceBus queue trigger function processed message', mySbMsg);\r\n};","sample.dat":"Service Bus Message"},"function":{"disabled":false,"bindings":[{"name":"mySbMsg","type":"serviceBusTrigger","direction":"in","queueName":"myinputqueue","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusQueueTriggerJS","description":"$ServiceBusQueueTrigger_description","name":"Service Bus Queue trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusQueueTrigger-Python","runtime":"2","files":{"sample.dat":"Service Bus Message","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(msg: func.ServiceBusMessage):\r\n logging.info('Python ServiceBus queue trigger processed message: %s',\r\n msg.get_body().decode('utf-8'))\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"name":"msg","type":"serviceBusTrigger","direction":"in","queueName":"myinputqueue","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusQueueTriggerPython","description":"$ServiceBusQueueTrigger_description","name":"Service Bus Queue trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusTopicTrigger-CSharp","runtime":"2","files":{"run.csx":"using System;\r\nusing System.Threading.Tasks;\r\n\r\npublic static void Run(string mySbMsg, ILogger log)\r\n{\r\n log.LogInformation($\"C# ServiceBus topic trigger function processed message: {mySbMsg}\");\r\n}\r\n","sample.dat":"Service Bus Message"},"function":{"disabled":false,"bindings":[{"name":"mySbMsg","type":"serviceBusTrigger","direction":"in","topicName":"mytopic","subscriptionName":"mysubscription","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusTopicTriggerCSharp","description":"$ServiceBusTopicTrigger_description","name":"Service Bus Topic trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","topicName","subscriptionName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusTopicTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function(context, mySbMsg) {\r\n context.log('JavaScript ServiceBus topic trigger function processed message', mySbMsg);\r\n};","sample.dat":"Service Bus Message"},"function":{"disabled":false,"bindings":[{"name":"mySbMsg","type":"serviceBusTrigger","direction":"in","topicName":"mytopic","subscriptionName":"mysubscription","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusTopicTriggerJS","description":"$ServiceBusTopicTrigger_description","name":"Service Bus Topic trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","topicName","subscriptionName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusTopicTrigger-Python","runtime":"2","files":{"sample.dat":"Service Bus Message","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(msg: func.ServiceBusMessage):\r\n logging.info('Python ServiceBus topic trigger processed message: %s',\r\n msg.get_body().decode('utf-8'))\r\n"},"function":{"disabled":false,"bindings":[{"name":"msg","type":"serviceBusTrigger","direction":"in","topicName":"mytopic","subscriptionName":"mysubscription","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusTopicTriggerPython","description":"$ServiceBusTopicTrigger_description","name":"Service Bus Topic trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","topicName","subscriptionName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"TimerTrigger-CSharp","runtime":"2","files":{"readme.md":"# TimerTrigger - C#\r\n\r\nThe `TimerTrigger` makes it incredibly easy to have your functions executed on a schedule. This sample demonstrates a simple use case of calling your function every 5 minutes.\r\n\r\n## How it works\r\n\r\nFor a `TimerTrigger` to work, you provide a schedule in the form of a [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression)(See the link for full details). A cron expression is a string with 6 separate expressions which represent a given schedule via patterns. The pattern we use to represent every 5 minutes is `0 */5 * * * *`. This, in plain text, means: \"When seconds is equal to 0, minutes is divisible by 5, for any hour, day of the month, month, day of the week, or year\".\r\n\r\n## Learn more\r\n\r\n Documentation","run.csx":"using System;\r\n\r\npublic static void Run(TimerInfo myTimer, ILogger log)\r\n{\r\n log.LogInformation($\"C# Timer trigger function executed at: {DateTime.Now}\");\r\n}\r\n","sample.dat":""},"function":{"disabled":false,"bindings":[{"name":"myTimer","type":"timerTrigger","direction":"in","schedule":"0 */5 * * * *"}]},"metadata":{"defaultFunctionName":"TimerTriggerCSharp","description":"$TimerTrigger_description","name":"Timer trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"timer","enabledInTryMode":true,"userPrompt":["schedule"]}},{"id":"TimerTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, myTimer) {\r\n var timeStamp = new Date().toISOString();\r\n \r\n if(myTimer.isPastDue)\r\n {\r\n context.log('JavaScript is running late!');\r\n }\r\n context.log('JavaScript timer trigger function ran!', timeStamp); \r\n};","readme.md":"# TimerTrigger - JavaScript\r\n\r\nThe `TimerTrigger` makes it incredibly easy to have your functions executed on a schedule. This sample demonstrates a simple use case of calling your function every 5 minutes.\r\n\r\n## How it works\r\n\r\nFor a `TimerTrigger` to work, you provide a schedule in the form of a [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression)(See the link for full details). A cron expression is a string with 6 separate expressions which represent a given schedule via patterns. The pattern we use to represent every 5 minutes is `0 */5 * * * *`. This, in plain text, means: \"When seconds is equal to 0, minutes is divisible by 5, for any hour, day of the month, month, day of the week, or year\".\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":""},"function":{"disabled":false,"bindings":[{"name":"myTimer","type":"timerTrigger","direction":"in","schedule":"0 */5 * * * *"}]},"metadata":{"defaultFunctionName":"TimerTriggerJS","description":"$TimerTrigger_description","name":"Timer trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"timer","enabledInTryMode":true,"userPrompt":["schedule"]}},{"id":"TimerTrigger-Python","runtime":"2","files":{"readme.md":"# TimerTrigger - Python\r\n\r\nThe `TimerTrigger` makes it incredibly easy to have your functions executed on a schedule. This sample demonstrates a simple use case of calling your function every 5 minutes.\r\n\r\n## How it works\r\n\r\nFor a `TimerTrigger` to work, you provide a schedule in the form of a [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression)(See the link for full details). A cron expression is a string with 6 separate expressions which represent a given schedule via patterns. The pattern we use to represent every 5 minutes is `0 */5 * * * *`. This, in plain text, means: \"When seconds is equal to 0, minutes is divisible by 5, for any hour, day of the month, month, day of the week, or year\".\r\n\r\n## Learn more\r\n\r\n Documentation\r\n","sample.dat":"","__init__.py":"import datetime\r\nimport logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(mytimer: func.TimerRequest) -> None:\r\n utc_timestamp = datetime.datetime.utcnow().replace(\r\n tzinfo=datetime.timezone.utc).isoformat()\r\n\r\n if mytimer.past_due:\r\n logging.info('The timer is past due!')\r\n\r\n logging.info('Python timer trigger function ran at %s', utc_timestamp)\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"name":"mytimer","type":"timerTrigger","direction":"in","schedule":"0 */5 * * * *"}]},"metadata":{"defaultFunctionName":"TimerTriggerPython","description":"$TimerTrigger_description","name":"Timer trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"timer","enabledInTryMode":true,"userPrompt":["schedule"],"filters":["Python3"]}}] \ No newline at end of file +[{"id":"BlobTrigger-CSharp","runtime":"2","files":{"readme.md":"# BlobTrigger - C#\r\n\r\nThe `BlobTrigger` makes it incredibly easy to react to new Blobs inside of Azure Blob Storage. This sample demonstrates a simple use case of processing data from a given Blob using C#.\r\n\r\n## How it works\r\n\r\nFor a `BlobTrigger` to work, you provide a path which dictates where the blobs are located inside your container, and can also help restrict the types of blobs you wish to return. For instance, you can set the path to `samples/{name}.png` to restrict the trigger to only the samples path and only blobs with \".png\" at the end of their name.\r\n\r\n## Learn more\r\n\r\n Documentation","run.csx":"public static void Run(Stream myBlob, string name, ILogger log)\r\n{\r\n log.LogInformation($\"C# Blob trigger function Processed blob\\n Name:{name} \\n Size: {myBlob.Length} Bytes\");\r\n}\r\n","sample.dat":"samples-workitems/workitem.txt"},"function":{"disabled":false,"bindings":[{"name":"myBlob","type":"blobTrigger","direction":"in","path":"samples-workitems/{name}","connection":""}]},"metadata":{"defaultFunctionName":"BlobTrigger","description":"$BlobTrigger_description","name":"Azure Blob Storage trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"blob","enabledInTryMode":true,"userPrompt":["connection","path"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"BlobTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, myBlob) {\r\n context.log(\"JavaScript blob trigger function processed blob \\n Name:\", context.bindingData.name, \"\\n Blob Size:\", myBlob.length, \"Bytes\");\r\n};","readme.md":"# BlobTrigger - JavaScript\r\n\r\nThe `BlobTrigger` makes it incredibly easy to react to new Blobs inside of Azure Blob Storage. This sample demonstrates a simple use case of processing data from a given Blob using JavaScript.\r\n\r\n## How it works\r\n\r\nFor a `BlobTrigger` to work, you provide a path which dictates where the blobs are located inside your container, and can also help restrict the types of blobs you wish to return. For instance, you can set the path to `samples/{name}.png` to restrict the trigger to only the samples path and only blobs with \".png\" at the end of their name.\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":"samples-workitems/workitem.txt"},"function":{"disabled":false,"bindings":[{"name":"myBlob","type":"blobTrigger","direction":"in","path":"samples-workitems/{name}","connection":""}]},"metadata":{"defaultFunctionName":"BlobTrigger","description":"$BlobTrigger_description","name":"Azure Blob Storage trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"blob","enabledInTryMode":true,"userPrompt":["connection","path"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"BlobTrigger-Python","runtime":"2","files":{"readme.md":"# BlobTrigger - Python\r\n\r\nThe `BlobTrigger` makes it incredibly easy to react to new Blobs inside of Azure Blob Storage. This sample demonstrates a simple use case of processing data from a given Blob using Python.\r\n\r\n## How it works\r\n\r\nFor a `BlobTrigger` to work, you provide a path which dictates where the blobs are located inside your container, and can also help restrict the types of blobs you wish to return. For instance, you can set the path to `samples/{name}.png` to restrict the trigger to only the samples path and only blobs with \".png\" at the end of their name.\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":"samples-workitems/workitem.txt","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(myblob: func.InputStream):\r\n logging.info(f\"Python blob trigger function processed blob \\n\"\r\n f\"Name: {myblob.name}\\n\"\r\n f\"Blob Size: {myblob.length} bytes\")\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"name":"myblob","type":"blobTrigger","direction":"in","path":"samples-workitems/{name}","connection":""}]},"metadata":{"defaultFunctionName":"BlobTrigger","description":"$BlobTrigger_description","name":"Azure Blob Storage trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"blob","enabledInTryMode":true,"userPrompt":["connection","path"],"filters":["Python3"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"CosmosDBTrigger-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.DocumentDB.Core\"\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing Microsoft.Azure.Documents;\r\n\r\npublic static void Run(IReadOnlyList input, ILogger log)\r\n{\r\n if (input != null && input.Count > 0)\r\n {\r\n log.LogInformation(\"Documents modified \" + input.Count);\r\n log.LogInformation(\"First document Id \" + input[0].Id);\r\n }\r\n}\r\n"},"function":{"bindings":[{"type":"cosmosDBTrigger","name":"input","direction":"in","connectionStringSetting":"","databaseName":"","collectionName":"","leaseCollectionName":"leases","createLeaseCollectionIfNotExists":true}]},"metadata":{"defaultFunctionName":"CosmosTrigger","description":"$CosmosDBTrigger_description","name":"Azure Cosmos DB trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"cosmosDB","enabledInTryMode":false,"userPrompt":["connectionStringSetting","databaseName","collectionName","leaseCollectionName","createLeaseCollectionIfNotExists"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.CosmosDB","version":"3.0.1"}]}},{"id":"CosmosDBTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, documents) {\r\n if (!!documents && documents.length > 0) {\r\n context.log('Document Id: ', documents[0].id);\r\n }\r\n}\r\n","sample.dat":"[\r\n\t{\r\n\t\t\"id\": \"sample\"\r\n\t}\r\n]"},"function":{"bindings":[{"type":"cosmosDBTrigger","name":"documents","direction":"in","leaseCollectionName":"leases","connectionStringSetting":"","databaseName":"","collectionName":"","createLeaseCollectionIfNotExists":true}]},"metadata":{"defaultFunctionName":"CosmosTrigger","description":"$CosmosDBTrigger_description","name":"Azure Cosmos DB trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"cosmosDB","enabledInTryMode":false,"userPrompt":["connectionStringSetting","databaseName","collectionName","leaseCollectionName","createLeaseCollectionIfNotExists"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.CosmosDB","version":"3.0.1"}]}},{"id":"CosmosDBTrigger-Python","runtime":"2","files":{"sample.dat":"[\r\n\t{\r\n\t\t\"id\": \"sample\"\r\n\t}\r\n]","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(documents: func.DocumentList) -> str:\r\n if documents:\r\n logging.info('Document id: %s', documents[0].id)\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"type":"cosmosDBTrigger","name":"documents","direction":"in","leaseCollectionName":"leases","connectionStringSetting":"","databaseName":"","collectionName":"","createLeaseCollectionIfNotExists":true}]},"metadata":{"defaultFunctionName":"CosmosTrigger","description":"$CosmosDBTrigger_description","name":"Azure Cosmos DB trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"cosmosDB","enabledInTryMode":false,"userPrompt":["connectionStringSetting","databaseName","collectionName","leaseCollectionName","createLeaseCollectionIfNotExists"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.CosmosDB","version":"3.0.1"}],"filters":["Python3"]}},{"id":"DurableFunctionsActivity-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.WebJobs.Extensions.DurableTask\"\r\n\r\npublic static string Run(string name)\r\n{\r\n return $\"Hello {name}!\";\r\n}","sample.dat":""},"function":{"bindings":[{"name":"name","type":"activityTrigger","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"Hello","description":"$DurableFunctionsActivity_description","name":"Durable Functions activity","language":"C#","category":["$temp_category_durableFunctions"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.DurableTask","version":"1.6.2"}]}},{"id":"DurableFunctionsHttpStart-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.WebJobs.Extensions.DurableTask\"\r\n#r \"Newtonsoft.Json\"\r\n\r\nusing System.Net;\r\n\r\npublic static async Task Run(\r\n HttpRequestMessage req,\r\n DurableOrchestrationClient starter,\r\n string functionName,\r\n ILogger log)\r\n{\r\n // Function input comes from the request content.\r\n dynamic eventData = await req.Content.ReadAsAsync();\r\n\r\n // Pass the function name as part of the route \r\n string instanceId = await starter.StartNewAsync(functionName, eventData);\r\n\r\n log.LogInformation($\"Started orchestration with ID = '{instanceId}'.\");\r\n\r\n return starter.CreateCheckStatusResponse(req, instanceId);\r\n}"},"function":{"bindings":[{"authLevel":"anonymous","name":"req","type":"httpTrigger","direction":"in","route":"orchestrators/{functionName}","methods":["post","get"]},{"name":"$return","type":"http","direction":"out"},{"name":"starter","type":"orchestrationClient","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"DurableFunctionsHttpStart","description":"$DurableFunctionsHttpStart_description","name":"Durable Functions HTTP starter","language":"C#","category":["$temp_category_durableFunctions"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.DurableTask","version":"1.6.2"}]}},{"id":"DurableFunctionsOrchestrator-CSharp","runtime":"2","files":{"run.csx":"/*\r\n * Before running this sample, please create a Durable Activity function (default name is \"Hello\")\r\n */\r\n\r\n#r \"Microsoft.Azure.WebJobs.Extensions.DurableTask\"\r\n\r\npublic static async Task> Run(DurableOrchestrationContext context)\r\n{\r\n var outputs = new List();\r\n\r\n // Replace \"Hello\" with the name of your Durable Activity Function.\r\n outputs.Add(await context.CallActivityAsync(\"Hello\", \"Tokyo\"));\r\n outputs.Add(await context.CallActivityAsync(\"Hello\", \"Seattle\"));\r\n outputs.Add(await context.CallActivityAsync(\"Hello\", \"London\"));\r\n\r\n // returns [\"Hello Tokyo!\", \"Hello Seattle!\", \"Hello London!\"]\r\n return outputs;\r\n}","sample.dat":""},"function":{"bindings":[{"name":"context","type":"orchestrationTrigger","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"DurableFunctionsOrchestrator","description":"$DurableFunctionsOrchestrator_description","name":"Durable Functions orchestrator","language":"C#","category":["$temp_category_durableFunctions"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.DurableTask","version":"1.6.2"}]}},{"id":"EventGridTrigger-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.EventGrid\"\r\nusing Microsoft.Azure.EventGrid.Models;\r\n\r\npublic static void Run(EventGridEvent eventGridEvent, ILogger log)\r\n{\r\n log.LogInformation(eventGridEvent.Data.ToString());\r\n}\r\n","sample.dat":"{\n \"topic\": \"/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/test/providers/Microsoft.EventHub/namespaces/test\",\n \"subject\": \"eventhubs/test\",\n \"eventType\": \"captureFileCreated\",\n \"eventTime\": \"2017-07-14T23:10:27.7689666Z\",\n \"id\": \"7b11c4ce-1c34-4416-848b-1730e766f126\",\n \"data\": {\n \"fileUrl\": \"https://test.blob.core.windows.net/debugging/testblob.txt\",\n \"fileType\": \"AzureBlockBlob\",\n \"partitionId\": \"1\",\n \"sizeInBytes\": 0,\n \"eventCount\": 0,\n \"firstSequenceNumber\": -1,\n \"lastSequenceNumber\": -1,\n \"firstEnqueueTime\": \"0001-01-01T00:00:00\",\n \"lastEnqueueTime\": \"0001-01-01T00:00:00\"\n },\n \"dataVersion\": \"\",\n \"metadataVersion\": \"1\" \n}\n"},"function":{"bindings":[{"type":"eventGridTrigger","name":"eventGridEvent","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"EventGridTrigger","description":"$EventGridTrigger_description","name":"Azure Event Grid trigger","language":"C#","category":["$temp_category_core","$$temp_category_dataProcessing"],"categoryStyle":"eventGrid","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventGrid","version":"2.0.0"}]}},{"id":"EventGridTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, eventGridEvent) {\r\n context.log(typeof eventGridEvent);\r\n context.log(eventGridEvent);\r\n};","sample.dat":"{\n \"topic\": \"/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/test/providers/Microsoft.EventHub/namespaces/test\",\n \"subject\": \"eventhubs/test\",\n \"eventType\": \"captureFileCreated\",\n \"eventTime\": \"2017-07-14T23:10:27.7689666Z\",\n \"id\": \"7b11c4ce-1c34-4416-848b-1730e766f126\",\n \"data\": {\n \"fileUrl\": \"https://test.blob.core.windows.net/debugging/testblob.txt\",\n \"fileType\": \"AzureBlockBlob\",\n \"partitionId\": \"1\",\n \"sizeInBytes\": 0,\n \"eventCount\": 0,\n \"firstSequenceNumber\": -1,\n \"lastSequenceNumber\": -1,\n \"firstEnqueueTime\": \"0001-01-01T00:00:00\",\n \"lastEnqueueTime\": \"0001-01-01T00:00:00\"\n },\n \"dataVersion\": \"\", \n \"metadataVersion\": \"1\" \n}\n"},"function":{"bindings":[{"type":"eventGridTrigger","name":"eventGridEvent","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"EventGridTrigger","description":"$EventGridTrigger_description","name":"Azure Event Grid trigger","language":"JavaScript","category":["$temp_category_core","$$temp_category_dataProcessing"],"categoryStyle":"eventGrid","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventGrid","version":"2.0.0"}]}},{"id":"EventGridTrigger-Python","runtime":"2","files":{"sample.dat":"{\n 'topic': '/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/test/providers/Microsoft.EventHub/namespaces/test',\n 'subject': 'eventhubs/test',\n 'eventType': 'captureFileCreated',\n 'eventTime': '2017-07-14T23:10:27.7689666Z',\n 'id': '7b11c4ce-1c34-4416-848b-1730e766f126',\n 'data': {\n 'fileUrl': 'https://test.blob.core.windows.net/debugging/testblob.txt',\n 'fileType': 'AzureBlockBlob',\n 'partitionId': '1',\n 'sizeInBytes': 0,\n 'eventCount': 0,\n 'firstSequenceNumber': -1,\n 'lastSequenceNumber': -1,\n 'firstEnqueueTime': '0001-01-01T00:00:00',\n 'lastEnqueueTime': '0001-01-01T00:00:00'\n },\n \"dataVersion\": \"\", \n \"metadataVersion\": \"1\" \n}\n","__init__.py":"import json\r\nimport logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(event: func.EventGridEvent):\r\n result = json.dumps({\r\n 'id': event.id,\r\n 'data': event.get_json(),\r\n 'topic': event.topic,\r\n 'subject': event.subject,\r\n 'event_type': event.event_type,\r\n })\r\n\r\n logging.info('Python EventGrid trigger processed an event: %s', result)\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"type":"eventGridTrigger","name":"event","direction":"in"}]},"metadata":{"defaultFunctionName":"EventGridTrigger","description":"$EventGridTrigger_description","name":"Azure Event Grid trigger","language":"Python","category":["$temp_category_core","$$temp_category_dataProcessing"],"categoryStyle":"eventGrid","enabledInTryMode":false,"userPrompt":[],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventGrid","version":"2.0.0"}]}},{"id":"EventHubTrigger-CSharp","runtime":"2","files":{"run.csx":"using System;\r\n\r\npublic static void Run(string myEventHubMessage, ILogger log)\r\n{\r\n log.LogInformation($\"C# Event Hub trigger function processed a message: {myEventHubMessage}\");\r\n}\r\n","sample.dat":"Test Message"},"function":{"disabled":false,"bindings":[{"type":"eventHubTrigger","name":"myEventHubMessage","direction":"in","eventHubName":"samples-workitems","connection":"","consumerGroup":"$Default"}]},"metadata":{"defaultFunctionName":"EventHubTrigger","description":"$EventHubTrigger_description","name":"Azure Event Hub trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"eventHub","enabledInTryMode":false,"userPrompt":["connection","eventHubName","consumerGroup"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventHubs","version":"3.0.0"}]}},{"id":"EventHubTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, eventHubMessages) {\r\n context.log(`JavaScript eventhub trigger function called for message array ${eventHubMessages}`);\r\n \r\n eventHubMessages.forEach((message, index) => {\r\n context.log(`Processed message ${message}`);\r\n });\r\n};","sample.dat":"\"Test Message\""},"function":{"disabled":false,"bindings":[{"type":"eventHubTrigger","name":"eventHubMessages","direction":"in","eventHubName":"samples-workitems","connection":"","cardinality":"many","consumerGroup":"$Default"}]},"metadata":{"defaultFunctionName":"EventHubTrigger","description":"$EventHubTrigger_description","name":"Azure Event Hub trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"eventHub","enabledInTryMode":false,"userPrompt":["connection","eventHubName","consumerGroup"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventHubs","version":"3.0.0"}]}},{"id":"EventHubTrigger-Python","runtime":"2","files":{"sample.dat":"Test Message","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(event: func.EventHubEvent):\r\n logging.info('Python EventHub trigger processed an event: %s',\r\n event.get_body().decode('utf-8'))\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"type":"eventHubTrigger","name":"event","direction":"in","eventHubName":"samples-workitems","connection":"","cardinality":"many","consumerGroup":"$Default"}]},"metadata":{"defaultFunctionName":"EventHubTrigger","description":"$EventHubTrigger_description","name":"Azure Event Hub trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"eventHub","enabledInTryMode":false,"userPrompt":["connection","eventHubName","consumerGroup"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.EventHubs","version":"3.0.0"}]}},{"id":"HttpTrigger-CSharp","runtime":"2","files":{"readme.md":"# HttpTrigger - C#\r\n\r\nThe `HttpTrigger` makes it incredibly easy to have your functions executed via an HTTP call to your function.\r\n\r\n## How it works\r\n\r\nWhen you call the function, be sure you checkout which security rules you apply. If you're using an apikey, you'll need to include that in your request.\r\n\r\n## Learn more\r\n\r\n Documentation","run.csx":"#r \"Newtonsoft.Json\"\r\n\r\nusing System.Net;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.Extensions.Primitives;\r\nusing Newtonsoft.Json;\r\n\r\npublic static async Task Run(HttpRequest req, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\");\r\n\r\n string name = req.Query[\"name\"];\r\n\r\n string requestBody = await new StreamReader(req.Body).ReadToEndAsync();\r\n dynamic data = JsonConvert.DeserializeObject(requestBody);\r\n name = name ?? data?.name;\r\n\r\n return name != null\r\n ? (ActionResult)new OkObjectResult($\"Hello, {name}\")\r\n : new BadRequestObjectResult(\"Please pass a name on the query string or in the request body\");\r\n}\r\n","sample.dat":"{\r\n \"name\": \"Azure\"\r\n}"},"function":{"disabled":false,"bindings":[{"authLevel":"function","name":"req","type":"httpTrigger","direction":"in","methods":["get","post"]},{"name":"$return","type":"http","direction":"out"}]},"metadata":{"defaultFunctionName":"HttpTrigger","description":"$HttpTrigger_description","name":"HTTP trigger","language":"C#","category":["$temp_category_core","$temp_category_api"],"categoryStyle":"http","enabledInTryMode":true,"userPrompt":["authLevel"]}},{"id":"HttpTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, req) {\r\n context.log('JavaScript HTTP trigger function processed a request.');\r\n\r\n if (req.query.name || (req.body && req.body.name)) {\r\n context.res = {\r\n // status: 200, /* Defaults to 200 */\r\n body: \"Hello \" + (req.query.name || req.body.name)\r\n };\r\n }\r\n else {\r\n context.res = {\r\n status: 400,\r\n body: \"Please pass a name on the query string or in the request body\"\r\n };\r\n }\r\n};","sample.dat":"{\r\n \"name\": \"Azure\"\r\n}"},"function":{"disabled":false,"bindings":[{"authLevel":"function","type":"httpTrigger","direction":"in","name":"req","methods":["get","post"]},{"type":"http","direction":"out","name":"res"}]},"metadata":{"defaultFunctionName":"HttpTrigger","description":"$HttpTrigger_description","name":"HTTP trigger","language":"JavaScript","trigger":"HttpTrigger","category":["$temp_category_core","$temp_category_api"],"categoryStyle":"http","enabledInTryMode":true,"userPrompt":["authLevel"]}},{"id":"HttpTrigger-PowerShell","runtime":"2","files":{"run.ps1":"# Input bindings are passed in via param block.\nparam($req, $TriggerMetadata)\n\n# Write to the Azure Functions Trace-level log stream.\nWrite-Verbose \"PowerShell HTTP trigger function processed a request.\" -Verbose\n\n# Interact with query parameters, the body of the request, etc.\n$name = $req.Query.Name\nif (-not $name) { $name = $req.Body.Name }\n\nif($name) {\n $status = 200\n $body = \"Hello \" + $name\n}\nelse {\n $status = 400\n $body = \"Please pass a name on the query string or in the request body.\"\n}\n\n# Associate values to output bindings by calling 'Push-OutputBinding'.\nPush-OutputBinding -Name res -Value ([HttpResponseContext]@{\n StatusCode = $status\n Body = $body\n})\n","sample.dat":"{\r\n \"name\": \"Azure\"\r\n}\r\n"},"function":{"disabled":false,"bindings":[{"authLevel":"function","type":"httpTrigger","direction":"in","name":"req","methods":["get","post"]},{"type":"http","direction":"out","name":"res"}]},"metadata":{"defaultFunctionName":"HttpTrigger","description":"$HttpTrigger_description","name":"HTTP trigger","language":"PowerShell","trigger":"HttpTrigger","category":["$temp_category_core","$temp_category_api"],"categoryStyle":"http","enabledInTryMode":true,"userPrompt":["authLevel"]}},{"id":"HttpTrigger-Python","runtime":"2","files":{"sample.dat":"{\r\n \"name\": \"Azure\"\r\n}","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(req: func.HttpRequest) -> func.HttpResponse:\r\n logging.info('Python HTTP trigger function processed a request.')\r\n\r\n name = req.params.get('name')\r\n if not name:\r\n try:\r\n req_body = req.get_json()\r\n except ValueError:\r\n pass\r\n else:\r\n name = req_body.get('name')\r\n\r\n if name:\r\n return func.HttpResponse(f\"Hello {name}!\")\r\n else:\r\n return func.HttpResponse(\r\n \"Please pass a name on the query string or in the request body\",\r\n status_code=400\r\n )\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"authLevel":"anonymous","type":"httpTrigger","direction":"in","name":"req","methods":["get","post"]},{"type":"http","direction":"out","name":"$return"}]},"metadata":{"defaultFunctionName":"HttpTrigger","description":"$HttpTrigger_description","name":"HTTP trigger","language":"Python","trigger":"HttpTrigger","category":["$temp_category_core","$temp_category_api"],"categoryStyle":"http","enabledInTryMode":true,"userPrompt":["authLevel"],"filters":["Python3"]}},{"id":"OutlookMessageWebhookCreator-CSharp","runtime":"2","files":{"run.csx":"using System;\r\nusing System.Net;\r\n\r\npublic static HttpResponseMessage run(HttpRequestMessage req, out string clientState, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\");\r\n\tclientState = Guid.NewGuid().ToString();\r\n\treturn new HttpResponseMessage(HttpStatusCode.OK);\r\n}"},"function":{"bindings":[{"name":"req","type":"httpTrigger","direction":"in"},{"type":"graphWebhookSubscription","name":"clientState","direction":"out","action":"create","subscriptionResource":"me/mailFolders('Inbox')/messages","changeTypes":["created"],"identity":"userFromRequest"},{"type":"http","name":"$return","direction":"out"}],"disabled":false},"metadata":{"defaultFunctionName":"OutlookMessageWebhookCreator","description":"$OutlookMessageWebhookCreator_description","name":"Outlook message webhook creator","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]},{"resourceAppId":"00000003-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"570282fd-fa5c-430d-a7fd-fc8dc98a9dca"}]}]}},{"id":"OutlookMessageWebhookDeleter-CSharp","runtime":"2","files":{"run.csx":"#r \"Newtonsoft.Json\"\r\n#r \"Microsoft.Graph\"\r\n\r\nusing Microsoft.Graph;\r\nusing System.Net;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.Extensions.Primitives;\r\nusing Newtonsoft.Json;\r\n\r\npublic static async Task Run(HttpRequest req, Subscription[] existingSubscriptions, IAsyncCollector subscriptionsToDelete, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\");\r\n foreach (var subscription in existingSubscriptions)\r\n {\r\n log.LogInformation($\"Deleting subscription {subscription.Id}\");\r\n await subscriptionsToDelete.AddAsync(subscription.Id);\r\n }\r\n}"},"function":{"bindings":[{"name":"req","type":"httpTrigger","direction":"in"},{"type":"graphWebhookSubscription","name":"existingSubscriptions","direction":"in","filter":"userFromRequest"},{"type":"graphWebhookSubscription","name":"subscriptionsToDelete","direction":"out","action":"delete","identity":"userFromRequest"},{"type":"http","name":"res","direction":"out"}],"disabled":false},"metadata":{"defaultFunctionName":"OutlookMessageWebhookDeleter","description":"$OutlookMessageWebhookDeleter_description","name":"Outlook message webhook deleter","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]},{"resourceAppId":"00000003-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"570282fd-fa5c-430d-a7fd-fc8dc98a9dca"}]}]}},{"id":"OutlookMessageWebhookHandler-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Graph\"\r\nusing Microsoft.Graph;\r\nusing System.Net;\r\n\r\npublic static async Task Run(Message msg, ILogger log) \r\n{\r\n\tlog.LogInformation(\"Microsoft Graph webhook trigger function processed a request.\");\r\n\r\n // Testable by sending an email with the Subject \"[DEMO] Azure Functions\" and some text body\r\n if (msg.Subject.Contains(\"[DEMO] Azure Functions\")) {\r\n log.LogInformation($\"Processed email: {msg.BodyPreview}\");\r\n }\r\n}"},"function":{"bindings":[{"name":"msg","type":"graphWebhookTrigger","direction":"in","resourceType":"#Microsoft.Graph.Message"}],"disabled":false},"metadata":{"defaultFunctionName":"OutlookMessageWebhookHandler","description":"$OutlookMessageWebhookHandler_description","name":"Outlook message webhook handler","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]},{"resourceAppId":"00000003-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"570282fd-fa5c-430d-a7fd-fc8dc98a9dca"}]}]}},{"id":"OutlookMessageWebhookRefresher-CSharp","runtime":"2","files":{"run.csx":"#r \"Microsoft.Azure.WebJobs.Extensions.Tokens\"\r\n#r \"Microsoft.Azure.WebJobs.Extensions.O365\"\r\n\r\nusing System.Net;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.Extensions.Primitives;\r\nusing Microsoft.Azure.WebJobs;\r\n\r\npublic static async Task Run(TimerInfo myTimer, UserSubscription[] existingSubscriptions, IBinder binder, ILogger log)\r\n{\r\n log.LogInformation($\"C# Timer trigger function executed at: {DateTime.Now}\");\r\n foreach (var subscription in existingSubscriptions)\r\n {\r\n // binding in code to allow dynamic identity\r\n var subscriptionsToRefresh = await binder.BindAsync>(\r\n new GraphWebhookSubscriptionAttribute()\r\n {\r\n Action = GraphWebhookSubscriptionAction.Refresh,\r\n Identity = TokenIdentityMode.UserFromId,\r\n UserId = subscription.UserId\r\n }\r\n );\r\n {\r\n log.LogInformation($\"Refreshing subscription {subscription.Id}\");\r\n await subscriptionsToRefresh.AddAsync(subscription.Id);\r\n }\r\n }\r\n}\r\n\r\npublic class UserSubscription {\r\n public string UserId {get; set;}\r\n public string Id {get; set;}\r\n}"},"function":{"bindings":[{"name":"myTimer","type":"timerTrigger","direction":"in","schedule":"0 * * */2 * *"},{"type":"graphWebhookSubscription","name":"existingSubscriptions","direction":"in"}],"disabled":false},"metadata":{"defaultFunctionName":"OutlookMessageWebhookRefresher","description":"$OutlookMessageWebhookRefresher_description","name":"Outlook message webhook refresher","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]},{"resourceAppId":"00000003-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"570282fd-fa5c-430d-a7fd-fc8dc98a9dca"}]}]}},{"id":"ProfilePhotoAPI-CSharp","runtime":"2","files":{"run.csx":"using System.Net; \r\nusing System.Net.Http; \r\nusing System.Net.Http.Headers; \r\n\r\npublic static async Task Run(HttpRequestMessage req, string graphToken, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\"); \r\n HttpClient client = new HttpClient();\r\n client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(\"Bearer\", graphToken);\r\n return await client.GetAsync(\"https://graph.microsoft.com/v1.0/me/photo/$value\");\r\n}"},"function":{"bindings":[{"name":"req","type":"httpTrigger","direction":"in","authLevel":"anonymous","methods":["get"]},{"name":"graphToken","type":"token","direction":"in","resource":"https://graph.microsoft.com","identity":"userFromRequest"},{"name":"$return","type":"http","direction":"out"}],"disabled":false},"metadata":{"defaultFunctionName":"ProfilePhotoAPI","description":"$ProfilePhotoAPI_description","name":"Microsoft Graph profile photo API","trigger":"HttpTrigger","language":"C#","enabledInTryMode":false,"category":["$temp_category_msgraph"],"categoryStyle":"other","extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.AuthTokens","version":"1.0.0-beta6"}],"AADPermissions":[{"resourceAppId":"00000002-0000-0000-c000-000000000000","resourceAccess":[{"type":"Scope","id":"311a71cc-e848-46a1-bdf8-97ff7156d8e6"}]}]}},{"id":"QueueTrigger-CSharp","runtime":"2","files":{"readme.md":"# QueueTrigger - C#\r\n\r\nThe `QueueTrigger` makes it incredibly easy to react to new Queues inside of Azure Queue Storage. This sample demonstrates a simple use case of processing data from a given Queue using C#.\r\n\r\n## How it works\r\n\r\nFor a `QueueTrigger` to work, you must provide a queue name that defines the queue messages will be read from.\r\n\r\n## Learn more\r\n\r\n Documentation","run.csx":"using System;\r\n\r\npublic static void Run(string myQueueItem, ILogger log)\r\n{\r\n log.LogInformation($\"C# Queue trigger function processed: {myQueueItem}\");\r\n}\r\n","sample.dat":"sample queue data"},"function":{"disabled":false,"bindings":[{"name":"myQueueItem","type":"queueTrigger","direction":"in","queueName":"myqueue-items","connection":""}]},"metadata":{"defaultFunctionName":"QueueTrigger","description":"$QueueTrigger_description","name":"Azure Queue Storage trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"queue","enabledInTryMode":true,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"QueueTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, myQueueItem) {\r\n context.log('JavaScript queue trigger function processed work item', myQueueItem);\r\n};","readme.md":"# QueueTrigger - JavaScript\r\n\r\nThe `QueueTrigger` makes it incredibly easy to react to new Queues inside of Azure Queue Storage. This sample demonstrates a simple use case of processing data from a given Queue using C#.\r\n\r\n## How it works\r\n\r\nFor a `QueueTrigger` to work, you provide a path which dictates where the queue messages are located inside your container.\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":"sample queue data"},"function":{"disabled":false,"bindings":[{"name":"myQueueItem","type":"queueTrigger","direction":"in","queueName":"js-queue-items","connection":""}]},"metadata":{"defaultFunctionName":"QueueTrigger","description":"$QueueTrigger_description","name":"Azure Queue Storage trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"queue","enabledInTryMode":true,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"QueueTrigger-Python","runtime":"2","files":{"readme.md":"# QueueTrigger - Python\r\n\r\nThe `QueueTrigger` makes it incredibly easy to react to new Queues inside of Azure Queue Storage. This sample demonstrates a simple use case of processing data from a given Queue.\r\n\r\n## How it works\r\n\r\nFor a `QueueTrigger` to work, you provide a path which dictates where the queue messages are located inside your container.\r\n\r\n## Learn more\r\n\r\n Documentation\r\n","sample.dat":"sample queue data","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(msg: func.QueueMessage) -> None:\r\n logging.info('Python queue trigger function processed a queue item: %s',\r\n msg.get_body().decode('utf-8'))\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"name":"msg","type":"queueTrigger","direction":"in","queueName":"python-queue-items","connection":""}]},"metadata":{"defaultFunctionName":"QueueTrigger","description":"$QueueTrigger_description","name":"Azure Queue Storage trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"queue","enabledInTryMode":true,"userPrompt":["connection","queueName"],"filters":["Python3"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.Storage","version":"3.0.0"}]}},{"id":"SendGrid-CSharp","runtime":"2","files":{"run.csx":"// The 'From' and 'To' fields are automatically populated with the values specified by the binding settings.\r\n//\r\n// You can also optionally configure the default From/To addresses globally via host.config, e.g.:\r\n//\r\n// {\r\n// \"sendGrid\": {\r\n// \"to\": \"user@host.com\",\r\n// \"from\": \"Azure Functions \"\r\n// }\r\n// }\r\n#r \"SendGrid\"\r\n\r\nusing System;\r\nusing SendGrid.Helpers.Mail;\r\nusing Microsoft.Azure.WebJobs.Host;\r\n\r\npublic static SendGridMessage Run(Order order, ILogger log)\r\n{\r\n log.LogInformation($\"C# Queue trigger function processed order: {order.OrderId}\");\r\n\r\n SendGridMessage message = new SendGridMessage()\r\n {\r\n Subject = $\"Thanks for your order (#{order.OrderId})!\"\r\n };\r\n\r\n message.AddContent(\"text/plain\", $\"{order.CustomerName}, your order ({order.OrderId}) is being processed!\");\r\n return message;\r\n}\r\npublic class Order\r\n{\r\n public string OrderId { get; set; }\r\n public string CustomerName { get; set; }\r\n public string CustomerEmail { get; set; }\r\n}\r\n","sample.dat":"{ \"OrderId\": 12345, \"CustomerName\": \"Joe Schmoe\", \"CustomerEmail\": \"joeschmoe@foo.com\" }"},"function":{"bindings":[{"type":"queueTrigger","name":"order","direction":"in","queueName":"samples-orders-"},{"type":"sendGrid","name":"$return","direction":"out","apiKey":"SendGridApiKey","from":"Azure Functions ","to":"{CustomerEmail}"}]},"metadata":{"defaultFunctionName":"SendGrid","description":"$SendGrid_description","name":"SendGrid","language":"C#","category":["$temp_category_samples","$temp_category_dataProcessing"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":["to","from","apiKey"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.SendGrid","version":"3.0.0"}]}},{"id":"SendGrid-JavaScript","runtime":"2","files":{"index.js":"var util = require('util');\r\n\r\n// The 'From' and 'To' fields are automatically populated with the values specified by the binding settings.\r\n//\r\n// You can also optionally configure the default From/To addresses globally via host.config, e.g.:\r\n//\r\n// {\r\n// \"sendGrid\": {\r\n// \"to\": \"user@host.com\",\r\n// \"from\": \"Azure Functions \"\r\n// }\r\n// }\r\nmodule.exports = async function (context, order) {\r\n context.log('JavaScript queue trigger function processed order', order.orderId);\r\n\r\n context.bindings.message = {\r\n subject: util.format('Thanks for your order (#%d)!', order.orderId),\r\n content: [{\r\n type: 'text/plain',\r\n value: util.format(\"%s, your order (%d) is being processed!\", order.customerName, order.orderId)\r\n }]\r\n };\r\n}","sample.dat":"{ \"orderId\": 12345, \"customerName\": \"Joe Schmoe\", \"customerEmail\": \"joeschmoe@foo.com\" }"},"function":{"bindings":[{"type":"queueTrigger","name":"order","direction":"in","queueName":"samples-orders"},{"type":"sendGrid","name":"message","direction":"out","apiKey":"SendGridApiKey","from":"Azure Functions ","to":"{customerEmail}","subject":"","text":""}]},"metadata":{"defaultFunctionName":"SendGrid","description":"$SendGrid_description","name":"SendGrid","language":"JavaScript","category":["$temp_category_samples","$temp_category_dataProcessing"],"categoryStyle":"other","enabledInTryMode":false,"userPrompt":["to","from","subject","text","apiKey"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.SendGrid","version":"3.0.0"}]}},{"id":"ServiceBusQueueTrigger-CSharp","runtime":"2","files":{"run.csx":"using System;\r\nusing System.Threading.Tasks;\r\n\r\npublic static void Run(string myQueueItem, ILogger log)\r\n{\r\n log.LogInformation($\"C# ServiceBus queue trigger function processed message: {myQueueItem}\");\r\n}\r\n","sample.dat":"Service Bus Message"},"function":{"disabled":false,"bindings":[{"name":"myQueueItem","type":"serviceBusTrigger","direction":"in","queueName":"myqueue","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusQueueTrigger","description":"$ServiceBusQueueTrigger_description","name":"Azure Service Bus Queue trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusQueueTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function(context, mySbMsg) {\r\n context.log('JavaScript ServiceBus queue trigger function processed message', mySbMsg);\r\n};","sample.dat":"Service Bus Message"},"function":{"disabled":false,"bindings":[{"name":"mySbMsg","type":"serviceBusTrigger","direction":"in","queueName":"myinputqueue","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusQueueTrigger","description":"$ServiceBusQueueTrigger_description","name":"Azure Service Bus Queue trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusQueueTrigger-Python","runtime":"2","files":{"sample.dat":"Service Bus Message","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(msg: func.ServiceBusMessage):\r\n logging.info('Python ServiceBus queue trigger processed message: %s',\r\n msg.get_body().decode('utf-8'))\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"name":"msg","type":"serviceBusTrigger","direction":"in","queueName":"myinputqueue","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusQueueTrigger","description":"$ServiceBusQueueTrigger_description","name":"Azure Service Bus Queue trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","queueName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusTopicTrigger-CSharp","runtime":"2","files":{"run.csx":"using System;\r\nusing System.Threading.Tasks;\r\n\r\npublic static void Run(string mySbMsg, ILogger log)\r\n{\r\n log.LogInformation($\"C# ServiceBus topic trigger function processed message: {mySbMsg}\");\r\n}\r\n","sample.dat":"Service Bus Message"},"function":{"disabled":false,"bindings":[{"name":"mySbMsg","type":"serviceBusTrigger","direction":"in","topicName":"mytopic","subscriptionName":"mysubscription","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusTopicTrigger","description":"$ServiceBusTopicTrigger_description","name":"Azure Service Bus Topic trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","topicName","subscriptionName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusTopicTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function(context, mySbMsg) {\r\n context.log('JavaScript ServiceBus topic trigger function processed message', mySbMsg);\r\n};","sample.dat":"Service Bus Message"},"function":{"disabled":false,"bindings":[{"name":"mySbMsg","type":"serviceBusTrigger","direction":"in","topicName":"mytopic","subscriptionName":"mysubscription","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusTopicTrigger","description":"$ServiceBusTopicTrigger_description","name":"Azure Service Bus Topic trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","topicName","subscriptionName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"ServiceBusTopicTrigger-Python","runtime":"2","files":{"sample.dat":"Service Bus Message","__init__.py":"import logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(msg: func.ServiceBusMessage):\r\n logging.info('Python ServiceBus topic trigger processed message: %s',\r\n msg.get_body().decode('utf-8'))\r\n"},"function":{"disabled":false,"bindings":[{"name":"msg","type":"serviceBusTrigger","direction":"in","topicName":"mytopic","subscriptionName":"mysubscription","connection":""}]},"metadata":{"defaultFunctionName":"ServiceBusTopicTrigger","description":"$ServiceBusTopicTrigger_description","name":"Azure Service Bus Topic trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"serviceBus","enabledInTryMode":false,"userPrompt":["connection","topicName","subscriptionName"],"extensions":[{"id":"Microsoft.Azure.WebJobs.Extensions.ServiceBus","version":"3.0.0"}]}},{"id":"TimerTrigger-CSharp","runtime":"2","files":{"readme.md":"# TimerTrigger - C#\r\n\r\nThe `TimerTrigger` makes it incredibly easy to have your functions executed on a schedule. This sample demonstrates a simple use case of calling your function every 5 minutes.\r\n\r\n## How it works\r\n\r\nFor a `TimerTrigger` to work, you provide a schedule in the form of a [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression)(See the link for full details). A cron expression is a string with 6 separate expressions which represent a given schedule via patterns. The pattern we use to represent every 5 minutes is `0 */5 * * * *`. This, in plain text, means: \"When seconds is equal to 0, minutes is divisible by 5, for any hour, day of the month, month, day of the week, or year\".\r\n\r\n## Learn more\r\n\r\n Documentation","run.csx":"using System;\r\n\r\npublic static void Run(TimerInfo myTimer, ILogger log)\r\n{\r\n log.LogInformation($\"C# Timer trigger function executed at: {DateTime.Now}\");\r\n}\r\n","sample.dat":""},"function":{"disabled":false,"bindings":[{"name":"myTimer","type":"timerTrigger","direction":"in","schedule":"0 */5 * * * *"}]},"metadata":{"defaultFunctionName":"TimerTrigger","description":"$TimerTrigger_description","name":"Timer trigger","language":"C#","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"timer","enabledInTryMode":true,"userPrompt":["schedule"]}},{"id":"TimerTrigger-JavaScript","runtime":"2","files":{"index.js":"module.exports = async function (context, myTimer) {\r\n var timeStamp = new Date().toISOString();\r\n \r\n if(myTimer.isPastDue)\r\n {\r\n context.log('JavaScript is running late!');\r\n }\r\n context.log('JavaScript timer trigger function ran!', timeStamp); \r\n};","readme.md":"# TimerTrigger - JavaScript\r\n\r\nThe `TimerTrigger` makes it incredibly easy to have your functions executed on a schedule. This sample demonstrates a simple use case of calling your function every 5 minutes.\r\n\r\n## How it works\r\n\r\nFor a `TimerTrigger` to work, you provide a schedule in the form of a [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression)(See the link for full details). A cron expression is a string with 6 separate expressions which represent a given schedule via patterns. The pattern we use to represent every 5 minutes is `0 */5 * * * *`. This, in plain text, means: \"When seconds is equal to 0, minutes is divisible by 5, for any hour, day of the month, month, day of the week, or year\".\r\n\r\n## Learn more\r\n\r\n Documentation","sample.dat":""},"function":{"disabled":false,"bindings":[{"name":"myTimer","type":"timerTrigger","direction":"in","schedule":"0 */5 * * * *"}]},"metadata":{"defaultFunctionName":"TimerTrigger","description":"$TimerTrigger_description","name":"Timer trigger","language":"JavaScript","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"timer","enabledInTryMode":true,"userPrompt":["schedule"]}},{"id":"TimerTrigger-Python","runtime":"2","files":{"readme.md":"# TimerTrigger - Python\r\n\r\nThe `TimerTrigger` makes it incredibly easy to have your functions executed on a schedule. This sample demonstrates a simple use case of calling your function every 5 minutes.\r\n\r\n## How it works\r\n\r\nFor a `TimerTrigger` to work, you provide a schedule in the form of a [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression)(See the link for full details). A cron expression is a string with 6 separate expressions which represent a given schedule via patterns. The pattern we use to represent every 5 minutes is `0 */5 * * * *`. This, in plain text, means: \"When seconds is equal to 0, minutes is divisible by 5, for any hour, day of the month, month, day of the week, or year\".\r\n\r\n## Learn more\r\n\r\n Documentation\r\n","sample.dat":"","__init__.py":"import datetime\r\nimport logging\r\n\r\nimport azure.functions as func\r\n\r\n\r\ndef main(mytimer: func.TimerRequest) -> None:\r\n utc_timestamp = datetime.datetime.utcnow().replace(\r\n tzinfo=datetime.timezone.utc).isoformat()\r\n\r\n if mytimer.past_due:\r\n logging.info('The timer is past due!')\r\n\r\n logging.info('Python timer trigger function ran at %s', utc_timestamp)\r\n"},"function":{"scriptFile":"__init__.py","bindings":[{"name":"mytimer","type":"timerTrigger","direction":"in","schedule":"0 */5 * * * *"}]},"metadata":{"defaultFunctionName":"TimerTrigger","description":"$TimerTrigger_description","name":"Timer trigger","language":"Python","category":["$temp_category_core","$temp_category_dataProcessing"],"categoryStyle":"timer","enabledInTryMode":true,"userPrompt":["schedule"],"filters":["Python3"]}}] \ No newline at end of file