Skip to content

Instantly share code, notes, and snippets.

View jeffhollan's full-sized avatar
❄️
Working

Jeff Hollan jeffhollan

❄️
Working
View GitHub Profile
{
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2015-08-01-preview/workflowdefinition.json#",
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"type": "Manual"
}
},
module.exports = function (context, data) {
context.log('Webhook was triggered!');
var message = data.message;
var rx = /(<\?xml.*>)/g;
var xml = rx.exec(message)[1];
context.res = {
body: xml
};
module.exports = function (context, data) {
context.log('Webhook was triggered!');
var buffer = new Buffer(data.body, 'base64');
context.res = {
status: 200,
body: buffer.toString('utf8')
}
context.done();
Param(
[string] $ResourceGroupName = 'YourResourceGroup',
[string] $ResourceLocation = 'Region | eastus | westus | ...',
[string] $ConnectionName = 'SalesforceSandbox',
[string] $subscriptionId = 'xxxxxxxx-xxxx-xxxx-xxxx-9250f1c8ab03',
[bool] $createConnection = $true,
[bool] $isSandbox = $true
)
#r "Newtonsoft.Json"
using System;
using System.Net;
using Newtonsoft.Json;
public static async Task<object> Run(HttpRequestMessage req, TraceWriter log)
{
log.Verbose($"Webhook was triggered!");
@json(substring(base64toString(triggerBody()['ContentData']), indexof(base64toString(triggerBody()['ContentData']), '{'), sub(lastindexofof(base64toString(triggerBody()['ContentData']), '}'), indexof(base64toString(triggerBody()['ContentData']), '{'))))
@jeffhollan
jeffhollan / SwaggerGenerator.ps1
Created March 3, 2017 18:20
PowerShell to grab swagger for Logic app
Param(
[string]$subscriptionId = "80d4fe69-xxxx-xxxx-xxxx-9250f1c8ab03",
[string]$resourceGroup = "name-of-resource-group",
[string]$logicAppName = "name-of-logic-app",
[string]$triggerName = "manual"
)
Function Get-Folder()
{
{
"properties": {
"request": {
"properties": {
"inDialog": {
"type": "boolean"
},
"intent": {
"properties": {
"name": {
#r "Microsoft.WindowsAzure.Storage"
using Microsoft.WindowsAzure.Storage.Table;
using System.Net;
public static HttpResponseMessage Run(HttpRequestMessage req, IQueryable<Person> oncallTable, TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
var startOfWeek = DateTimeExtension.StartOfWeek(DateTime.Now, DayOfWeek.Monday);
@jeffhollan
jeffhollan / retrieveSecret.cs
Last active November 23, 2017 04:30
Azure Funciton Service Principal
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Azure.WebJobs.Host;
using Newtonsoft.Json.Linq;
using Microsoft.Azure.Services.AppAuthentication;
using Microsoft.Azure.KeyVault;