Skip to content

Instantly share code, notes, and snippets.

Avatar
🪐
Making the Cosmos (DB) better

Christopher Anderson christopheranderson

🪐
Making the Cosmos (DB) better
View GitHub Profile
View ConEmuSettings.xml
<?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"/>
@christopheranderson
christopheranderson / readme.md
Last active Jan 13, 2017
How to debug Node Azure Functions locally
View readme.md

How to debug Node Azure Functions locally

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. 🐲

Requirements

@christopheranderson
christopheranderson / readme.md
Last active Nov 21, 2017
Use Functions in Visual Studio
View readme.md

How to use Functions in Visual Studio

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. :)

  1. Create your Functions via the Azure Functions portal UX is the easiest way. Otherwise, just follow the file format rules on the Azure Functions located here.
  2. Download them via your scm site - {function app name}.scm.azurewebsites.net -> DebugConsole -> cd ./site -> click on the "download" button for wwwroot
  3. Open Visual Studio, create a new Website, choose your unzipped wwwroot folder.
  4. Now you should see all your Functions in a directory in your Visual Studio. You can edit them here. etc.
  5. To Publish - Just right-click->publish on the project, choose an existing Web App (even though it's a function app, it speaks Web App apis, so it shows up here). Then publish with your changes. If might fail, just click on the "
@christopheranderson
christopheranderson / index.js
Last active Nov 6, 2017
Functions with Cognitive Services
View index.js
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
@christopheranderson
christopheranderson / FunctionBotRun.csx
Last active Oct 22, 2022 — forked from ahelland/FunctionBotRun.csx
An Azure Function implementing the Microsoft Bot Framework to return random quotes
View FunctionBotRun.csx
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>();
@christopheranderson
christopheranderson / index.js
Created Apr 19, 2016
Simple verb routing for Azure Functions HTTP Trigger
View index.js
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
}
@christopheranderson
christopheranderson / project.json
Created Apr 4, 2016
Example Project.json for Azure Functions
View project.json
{
"frameworks": {
"net46":{
"dependencies": {
"ChatWork.Api": "0.4.0"
}
}
}
}
View cheap and dirty notsettlers
<!--
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>