Skip to content

Instantly share code, notes, and snippets.

View syron's full-sized avatar
🏠
Working from home

Robert Mayer syron

🏠
Working from home
View GitHub Profile
@syron
syron / logic_app_trigger_output_body.wdl
Created April 16, 2015 14:10
Example of trigger content WDL
@triggers().outputs.body.Content
#SQLCMD -S SERVER\INSTANCE -E -i yourscript.sql -o output.txt
[string]$instance = $args[0]
[string]$scriptFile = $args[1]
[string]$outputFile = $args[2]
if ($instance -eq "") {
Write-Output "No SQL instance provided";
return;
}
if ($scriptFile -eq "") {
{
"fromEmail": "robert.mayer@afconsult.com",
"toEmail": "robert.mayer@afconsult.com",
"subject": "Email Test",
"message": "Hello World - email sent using Azure Function App, by Robert Mayer - consultant at ÅF",
"isImportant": true
}
bool isImportantEmail = false;
string fromEmail = "robert.mayer@afconsult.com";
string toEmail = "robert.mayer@afconsult.com";
int smtpPort = 587;
bool smtpEnableSsl = true;
string smtpHost = "";
string smtpUser = "";
string smtpPass = "";
string subject = "";
string message = "";
/FunctionName01
/function.json
/run.csx
/FunctionName02
/function.json
/run.csx
/FunctionName03
/function.json
/run.csx
/host.json
string connectionString = ConfigurationManager.AppSettings["StorageConnectionString"];
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
CloudTable table = tableClient.GetTableReference("AzureFunctionsLogTable");
TableQuery<DynamicTableEntity> query = new TableQuery<DynamicTableEntity>();
foreach (var t in table.ExecuteQuery(query))
static void Main()
{
System.ServiceProcess.ServiceBase[] ServicesToRun;
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service1() };
System.ServiceProcess.ServiceBase.Run(ServicesToRun);
}
static void Main()
{
#if (!DEBUG)
System.ServiceProcess.ServiceBase[] ServicesToRun;
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service1() };
System.ServiceProcess.ServiceBase.Run(ServicesToRun);
#else
Service1 service = new Service1();
service.Init();
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
@syron
syron / gist:a7009128e44ca5f1f23eb89aa5395c38
Created September 24, 2016 08:13
API Response - multiple data object
{
"data": [
{
"_self": "http://myapiurl/data/3",
"id": 3,
"name": "Test3",
"description": "Hello MA"
},
{
"_self": "http://myapiurl/data/4",
@syron
syron / gist:cc50fb6ba76cd831962955f27acf1a78
Last active September 24, 2016 08:14
API Response - single data object
{
"data": {
"_self": "http://myapiurl/data/1",
"id": 1,
"name": "Test",
"description": "Hello World"
}
}