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
// utilising RestSharp and Json.NET - get via Nuget. | |
private WorkItem GetWorkItem(string workItemIdentifier) | |
{ | |
var restClient = new RestClient("https://account.visualstudio.com/defaultcollection"); | |
restClient.Authenticator = new HttpBasicAuthenticator("username", "password"); | |
// code removed here | |
var changes = GetWorkItemHistoryComments(restClient, workItemIdentifier); |
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
# Based on the August 2014 PowerShell Cmdlets (v2.4 of Azure SDK) | |
Import-Module "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1" | |
Function ForceShutdownVM($virtualMachine) | |
{ | |
Write-Host "Looking at host" $_.Name -ForegroundColor Yellow | |
if($_.Status -ne "StoppedDeallocated") | |
{ | |
if($_.InstanceName -Like "*_IN_*") | |
{ |
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
# Helper Method from: https://github.com/guangyang/azure-powershell-samples/blob/master/create-azure-sql.ps1 | |
# You can download this file as part of this repository: https://github.com/sjwaight/uha-azure-sample/ | |
# Create a PSCrendential object from plain text password. | |
# The PS Credential object will be used to create a database context, which will be used to create database. | |
Function New-PSCredentialFromPlainText | |
{ | |
Param( | |
[String]$UserName, |
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
# You can download this file as part of this repository: https://github.com/sjwaight/uha-azure-sample/ | |
if($args.Count -eq 0) | |
{ | |
Write-Host "ERROR: you must supply a unique traffic manager DNS prefix" | |
Exit 1 | |
} | |
$tmDomain = "{0}.trafficmanager.net" -f $args[0] |
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
# You can download this file as part of this repository: https://github.com/sjwaight/uha-azure-sample/ | |
Function New-DeploymentRegion | |
{ | |
Param( | |
[String]$RegionName | |
) | |
#### |
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
# You can download this file as part of this repository: https://github.com/sjwaight/uha-azure-sample/ | |
Function New-AzureCloudServiceDeployment | |
{ | |
Param( | |
[String]$RegionName, | |
[String]$DeploymentPathPackage, | |
[String]$DeploymentPathConfig | |
) |
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
public class ContosoCustomDatabaseInitializer : IDatabaseInitializer<SchoolContext> | |
{ | |
public void InitializeDatabase(SchoolContext context) | |
{ | |
if (context.Database.Exists()) | |
{ | |
if (!context.Database.CompatibleWithModel(true)) | |
{ | |
context.Database.Delete(); | |
} |
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
# Script assumes you have setup your subscription and | |
# have a default storage account in West US. | |
# You should change these to values you want. | |
$cloudService = "{cloudservice}" | |
$hostname = "{dockermanagementhost}" | |
$linuxUser = "{linxuser}" | |
$linuxPass = "{linxpasswd}" | |
$location = "West US" |
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
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
# pull down the necessary bits to install node | |
curl -sL https://rpm.nodesource.com/setup | bash - |
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
"osProfile": { | |
"computername": "[variables('vmName')]", | |
"adminUsername": "[parameters('adminUsername')]", | |
"adminPassword": "[parameters('adminPassword')]" | |
} |
OlderNewer