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
<?xml version="1.0"?> | |
<configuration> | |
<appSettings /> | |
<connectionStrings> | |
<!-- you'll need to change this to match your server - the one below is using the default local instance with Windows Auth. --> | |
<add name="aspnetmembers" connectionString="server=.;initial catalog=AuthDemoApp;Integrated Security=SSPI"/> | |
</connectionStrings> | |
<system.web> | |
<compilation debug="true"/> | |
<authentication mode="Forms"> |
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
<?xml version="1.0"?> | |
<configuration> | |
<configSections> | |
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> | |
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> | |
</configSections> | |
<appSettings> | |
<add key="ida:FederationMetadataLocation" value="https://localhost/idsrv/FederationMetadata/2007-06/FederationMetadata.xml" /> | |
<add key="ida:Realm" value="https://localhost/authdemoapp/secured/" /> | |
<add key="ida:AudienceUri" value="https://localhost/authdemoapp/secured/" /> |
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
<connectionStrings> | |
<!-- configuration data like endpoints, protocol config, relying parties etc... --> | |
<add name="IdentityServerConfiguration" | |
connectionString="server=.;initial catalog=IdentityServerConfiguration;Integrated Security=SSPI" | |
providerName="System.Data.SqlClient" /> | |
<!-- user database --> | |
<add name="ProviderDB" | |
connectionString="server=.;initial catalog=AuthDemoApp;Integrated Security=SSPI" | |
providerName="System.Data.SqlClient" /> | |
</connectionStrings> |
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(); | |
} |
OlderNewer