View web.2.0.config
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"> |
View web.4.5.1.config
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/" /> |
View connectionStrings.config
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> |
View RetrieveWorkItemHistory.cs
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); |
View ShutdownAllVms.ps1
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_*") | |
{ |
View 01-Setup-Azure-SQL.ps1
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, |
View 04-Setup-TrafficManager.ps1
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] |
View 02-Setup-CloudServices.ps1
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 | |
) | |
#### |
View 03-Deploy-WebRoles.ps1
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 | |
) |
View ContosoCustomDatabaseInitializer.cs
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