Skip to content

Instantly share code, notes, and snippets.

View sirkirby's full-sized avatar
:octocat:

Chris Kirby sirkirby

:octocat:
View GitHub Profile
@sirkirby
sirkirby / sampleAzurePublishProfile.xml
Created July 7, 2015 20:37
Sample Azure Web App Publish Profile
<?xml version="1.0" encoding="UTF-8"?>
<publishData>
<publishProfile profileName="mySiteSlot - Web Deploy" publishMethod="MSDeploy" publishUrl="mySiteSlot.scm.azurewebsites.net:443" msdeploySite="mySiteSlot" userName="$mySiteSlot" userPWD="mySuperSecretPassword" destinationAppUrl="http://mySiteSlot.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
<databases />
</publishProfile>
<publishProfile profileName="mySiteSlot - FTP" publishMethod="FTP" publishUrl="ftp://waws-prod-ch1-009.ftp.azurewebsites.windows.net/site/wwwroot" ftpPassiveMode="True" userName="mySiteSlot\$mySiteSlot" userPWD="mySuperSecretPassword" destinationAppUrl="http:/mySiteSlot.azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
<databases />
</publishProfile>
</publishData>
@sirkirby
sirkirby / WebJobs_BuildBasicAuthHttpRequest.cs
Last active August 29, 2015 14:24
HttpClient request to WebJobs API with Basic Auth
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://mysiteslot.scm.azurewebsites.net/api/");
// the creds from my .publishsettings file
var byteArray = Encoding.ASCII.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
// POST to the run action for my job
var response = await client.PostAsync("triggeredwebjobs/moJobName/run", null)
@sirkirby
sirkirby / jobHistory.json
Created July 7, 2015 21:21
WebJob history JSON
{
"runs":[
{
"id":"00000000000000000",
"name":"201507062203536167",
"status":"Success",
"start_time":"2015-07-06T22:03:53.6167675Z",
"end_time":"2015-07-06T22:08:30.7575007Z",
"duration":"00:04:37.1407332",
"output_url":"https://mySiteSlot.scm.azurewebsites.net/vfs/data/jobs/triggered/MyWebJob/201507062203536167/output_log.txt",
@sirkirby
sirkirby / curlWinCMDSlackNotification.bat
Created September 22, 2015 19:37
Send a slack notification from a windows command prompt using curl
curl -k -g -X POST -d "payload={\"text\":\"my important bot notification\", \"channel\":\"#monitoring\", \"username\":\"computer-bot\", \"icon_emoji\":\":computer:\"}" https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XxXxXxXxXXXxxXXXxxx
darthv = Darth Vader <[email protected]>
anakins = Anakin Skywalker <[email protected]>
@sirkirby
sirkirby / hubalias.ps1
Created December 16, 2015 15:47
Add hub PowerShell alias
# When I use Git, call Hub instead
Set-Alias git hub
@sirkirby
sirkirby / hubalias.bat
Created December 16, 2015 15:55
Add hub Console alias
@echo off
doskey git=hub
@sirkirby
sirkirby / azure-eayapi-expressapp1.js
Created May 13, 2016 15:38
Azure easy api app.js w express middleware
var express = require('express'),
azureMobileApps = require('azure-mobile-apps'),
bodyParser = require('body-parser'), // npm install body-parser --save
multer = require('multer'); // npm install multer --save
// Set up a standard Express app
var app = express();
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
@sirkirby
sirkirby / azure-easyap-slackcommand-sb.js
Created May 13, 2016 16:04
Consume a slack command and send a message to service bus
var azure = require('azure-sb');
module.exports = {
"post": function (req, res, next) {
var p = req.body;
var serviceBus = azure.createServiceBusService();
var queue = "lunchsearch";
if (p.token && p.token === "myslackcommandtoken") {
// build the body of the brokered message with info I want to pass to my Function
@sirkirby
sirkirby / azure-function-sbtrigger-csharp.json
Created May 13, 2016 16:30
Azure function definition that uses sb queue trigger
{
"bindings":[
{
"name":"myQueueItem",
"type":"serviceBusTrigger",
"direction":"in",
"queueName":"lunchsearch",
"connection":"LunchConnection",
"accessRights":"Manage"
}