This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SourceServer = "tcp:servername-s1.database.windows.net" | |
$SourceUserName = "username-u1@servername-s1" | |
$SourcePassword = "password-p1" | |
$TargetServer = "tcp:servername-s2.database.windows.net" | |
$TargetUserName = "username-u2@servername-s2" | |
$TargetPassword = "password-p2" | |
$database = "database-name" # Kept same for simplicity. | |
$bckDirectory = "D:\DataMigration\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function InitSync() { | |
var remote, repo, count, fileNames, fileContent; | |
nodegit.Repository.open(repoFolder) | |
.then(function (repoResult) { | |
repo = repoResult | |
count = 0; | |
fileNames = []; | |
fileContent = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function CloneRepo() { | |
var cloneOptions = { | |
fetchOpts: { callbacks: credentialsCallback } | |
}; | |
nodegit.Clone(url, dir, cloneOptions).then(function (repo) { | |
debug.verbose("Cloned " + path.basename(url) + " to " + repo.workdir()); | |
}).catch(function (err) { | |
debug.verbose(err); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
"options": { | |
"privateKey": "<pathToPrivateKey>/MyKeyFile", | |
"publicKey": "<pathToPublicKey>/MyKeyFile.pub", | |
"passphrase": "Y0ur.P@5$p#rAse.G0e5.H3rE!", | |
"twoWaySync": true, | |
"sshUrl": "<get_this_sshUrl_from_git>", | |
"signature_name": "Someone's Name", | |
"signature_email": "SomeoneWho@isMakingThisCommit.dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const debug = ""; //Import your Logger here or use Console just in case. | |
const nodegit = require("nodegit"); | |
const fs = require('fs'); | |
const path = require("path"); | |
const fse = require("fs-extra"); | |
const dir = `./backup/` | |
const repoFolder = `${dir}.git`; | |
var privateKey, publicKey, passphrase, twoWaySync, url, credentialsCallback, signature_name, signature_email; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Http; | |
using Microsoft.Extensions.Logging; | |
using System; | |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
namespace execFuncApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -outputtype consoleapplication -outputassembly helloworld.exe 'public class helloworld{public static void Main(){System.Console.WriteLine("hello world");}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var file_url = 'https://downloadurl.com/files/my_zip_file.zip'; | |
var AdmZip = require('adm-zip'); //Reference: https://www.npmjs.com/package/adm-zip | |
var https = require('https'); | |
var fs = require('fs') | |
https.get(file_url, function (res) { | |
var data = [], dataLen = 0; | |
res.on('data', function (chunk) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let client = appInsights.defaultClient; | |
client.trackEvent({name: "my custom event", properties: {customProperty: "custom property value"}}); | |
client.trackException({exception: new Error("handled exceptions can be logged with this method")}); | |
client.trackMetric({name: "custom metric", value: 3}); | |
client.trackTrace({message: "trace message"}); | |
client.trackDependency({target:"http://dbname", name:"select customers proc", data:"SELECT * FROM Customers", duration:231, resultCode:0, success: true, dependencyTypeName: "ZSQL"}); | |
client.trackRequest({name:"GET /customers", url:"http://myserver/customers", duration:309, resultCode:200, success:true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const appInsights = require("applicationinsights") | |
let client = appInsights.defaultClient; | |
// this config part should be set in ENVIRONMENT VARIABLES | |
let config = { | |
Id: "xxxxxxxx-xxxx-xxxx-xxxx-26728f1bb4e9", | |
Name: "Server-Q12", | |
applicationInsightsKey: "xxxxxxxx-xxxx-xxxx-xxxx-d7a116b10831" | |
} |
NewerOlder