This is a guide on how to set up the Azure Functions CLI to debug functions locally.
🚧 WARNING - This is very experimental and not yet very easy. I'm writing up this guide for the brave few. WARNING 🚧
🐲 Beyond here be dragons. 🐲
| requests | |
| | where timestamp > ago(30m) | |
| | summarize percentiles(duration, 50, 95, 99) by bin(timestamp, 1m) | |
| | render timechart |
| { | |
| "$schema": "http://schemas.management.azure.com/schemas/2015-01-01-preview/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "appName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the function app that you wish to create." | |
| } | |
| }, |
| <?xml version="1.0" encoding="utf-8"?> | |
| <key name="Software"> | |
| <key name="ConEmu"> | |
| <key name=".Vanilla" modified="2017-01-25 22:48:35" build="161206"> | |
| <value name="StartType" type="hex" data="02"/> | |
| <value name="CmdLine" type="string" data=""/> | |
| <value name="StartTasksFile" type="string" data=""/> | |
| <value name="StartTasksName" type="string" data="{Shells::PowerShell}"/> | |
| <value name="StartFarFolders" type="hex" data="00"/> | |
| <value name="StartFarEditors" type="hex" data="00"/> |
This is super hacky, but just wanted to leave the notes somewhere reusable that isn't official documentation. This isn't "recommended", but it is possible. :)
{function app name}.scm.azurewebsites.net -> DebugConsole -> cd ./site -> click on the "download" button for wwwroot| var request = require('request'); | |
| var uuid = require('node-uuid'); | |
| /* Requires a Cognitive Services Text Analytics */ | |
| /* Be sure to install the request and node-uuid packages and add the "COG_URL" and "COG_KEY" App Settings before running */ | |
| module.exports = function(context, req) { | |
| context.log('Node.js HTTP trigger function processed a request. RequestUri=%s', req.originalUrl); | |
| // Make a call out to Cognitive Services |
| using System.Net; | |
| using Microsoft.Bot.Connector; | |
| public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
| { | |
| log.Verbose($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}"); | |
| var msg = await req.Content.ReadAsAsync<Message>(); |
| module.exports = function(context, req) { | |
| var method = req.method.toLowerCase(); | |
| context.log(JSON.stringify(req, null, " ")); | |
| if(methods[method]){ | |
| methods[method](context, req); | |
| } else { | |
| context.res = { | |
| status: 404, | |
| body: "No route found for VERB: " + req.method | |
| } |
| { | |
| "frameworks": { | |
| "net46":{ | |
| "dependencies": { | |
| "ChatWork.Api": "0.4.0" | |
| } | |
| } | |
| } | |
| } |
| <!-- | |
| To change this template, choose Tools | Templates | |
| and open the template in the editor. | |
| --> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| </head> |