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 void SignIn(string authType) | |
{ | |
// Send an OpenID Connect sign-in request. | |
if (!Request.IsAuthenticated) | |
{ | |
string callbackUrl = Url.Action("SignInCallback", "Account", routeValues: new { authType = authType }, protocol: Request.Url.Scheme); | |
HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = callbackUrl }, | |
authType); | |
} |
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
app.UseOpenIdConnectAuthentication( | |
new OpenIdConnectAuthenticationOptions | |
{ | |
ClientId = clientId, | |
Authority = $"{aadInstanceGov}common", | |
PostLogoutRedirectUri = postLogoutRedirectUri, | |
AuthenticationType = "AADC", | |
TokenValidationParameters = new System.IdentityModel.Tokens.TokenValidationParameters | |
{ | |
// instead of using the default validation (validating against a single issuer value, as we do in line of business apps), |
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
app.UseOpenIdConnectAuthentication( | |
new OpenIdConnectAuthenticationOptions | |
{ | |
ClientId = clientId, | |
Authority = aadInstance + tenantId, | |
PostLogoutRedirectUri = postLogoutRedirectUri, | |
AuthenticationType = "AADC" | |
}); | |
app.UseOpenIdConnectAuthentication( |
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
$Link = "[Full path to where you copied the VHD]" | |
$S = New-AzureVMImageDiskConfigSet | |
Set-AzureVMImageOSDiskConfig -DiskConfig $S -HostCaching ReadWrite -OSState "Generalized" -OS "Linux" -MediaLink $Link | |
$IMGName = "Snapcloud"; | |
Add-AzureVMImage -ImageName $IMGName -Label "SnapCloud" -Description "SnapCloud" -DiskConfig $S -Eula "http://sphere3d.com/snapcloud" -ImageFamily Linux -PublishedDate (Get-Date) -PrivacyUri "http://sphere3d.com/snapcloud" -RecommendedVMSize Small -IconName "Icon01" -SmallIconName "SmallIcon01" -ShowInGui | |
$un = "[User Name]" | |
$pwd = "[Password]" | |
$vmname="[VM Name]" |
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
AzCopy /Source:[Container containing source image with SAS Signature] /Dest:[Path to Container in Azure G Storage Account] /DestKey:[My Key] /pattern:[Name of VHD] |
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
$data = Get-Content c:\temp\pwd.txt | |
$secretvalue = $data | ConvertTo-SecureString | |
$creds = New-Object System.Management.Automation.PSCredential ('<<ApplicationID>>', $secretvalue ) | |
Login-AzureRmAccount -Credential $creds -ServicePrincipal -TenantId <<TenantID GUID>> |
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
$Password = '<<my password>>' | |
Login-AzureRmAccount | |
$azureAdApplication = New-AzureRmADApplication -DisplayName "MyPoshApp" -HomePage "https://www.contoso.org" -IdentifierUris "https://www.contoso.org/example" -Password $Password | |
$azureAdApplication | |
DisplayName : MyPoshApp | |
Type : Application |
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 vm = await HttpContext.Application.CacheAside("Home-IndexViewModel", 60, | |
async () => | |
{ | |
make temp | |
return tmp; | |
}); | |
return View(vm); |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using System.Web; | |
namespace BrewSite.Util | |
{ | |
public static class HttpApplicationStateBaseExtension | |
{ |
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 System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace EFUnary |