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
# escape=` | |
# Image with NET CORE installation to extract executables for final image | |
FROM microsoft/aspnetcore:2.0.0-nanoserver As CoreBuild | |
# Middleware image used to extract ASP.NET core module | |
From microsoft/iis as WindowsBuild | |
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"] | |
# Installing NET CORE webhosting in middleware image so latest module and configuration schema is extracted for final image | |
ADD https://download.microsoft.com/download/B/1/D/B1D7D5BF-3920-47AA-94BD-7A6E48822F18/DotNetCore.2.0.0-WindowsHosting.exe ".\hosting.exe" |
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
services.Configure<IISOptions>(options => { | |
options.AutomaticAuthentication = true; | |
}); | |
services.AddAuthentication(Microsoft.AspNetCore.Server.IISIntegration.IISDefaults.AuthenticationScheme); | |
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 Program | |
{ | |
public static void Main(string[] args) | |
{ | |
BuildWebHost(args).Run(); | |
} | |
public static IWebHost BuildWebHost(string[] args) => | |
WebHost.CreateDefaultBuilder(args) | |
.UseIISIntegration() |
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
[Authorize(Roles = "Domain Admins")] | |
public IActionResult Windows() | |
{ | |
return Content ("You are " + User.Identity.Name + "; Authentication Type:" + User.Identity.AuthenticationType ); | |
} | |
[Authorize(Roles = "Domain Users")] | |
public IActionResult Users() | |
{ | |
return Content("You are " + User.Identity.Name + "; Authentication Type:" + User.Identity.AuthenticationType); | |
} |
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
# escape=` | |
# Image with NET CORE installation to extract executables for final image | |
FROM microsoft/aspnetcore:2.0.0-nanoserver As CoreBuild | |
# Image with SDK to build .NET Core application from source | |
FROM microsoft/aspnetcore-build:2.0.0-nanoserver As builder | |
WORKDIR /source/ | |
COPY source/iis . |
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
.UseHttpSys(options => | |
{ | |
options.Authentication.Schemes = AuthenticationSchemes.Negotiate | AuthenticationSchemes.NTLM; | |
options.Authentication.AllowAnonymous = true; | |
options.UrlPrefixes.Add("http://+:80/"); | |
}) |
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
# escape=` | |
# Image with SDK to build .NET Core application from source | |
FROM microsoft/aspnetcore-build:2.0.0-nanoserver As builder | |
WORKDIR /source/ | |
COPY source . | |
RUN dotnet restore; dotnet publish -c Release | |
FROM microsoft/aspnetcore:2.0.0-nanoserver | |
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"] |
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.Net; | |
using System.Net.Http; | |
using System.Security.Claims; | |
using System.Threading.Tasks; | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Info("C# HTTP trigger function processed a request."); | |
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
PS C:\Windows\system32> get-wmiobject -ComputerName 172.19.173.92 -Class win32_computersystem | |
Domain : ad.local | |
Manufacturer : Microsoft Corporation | |
Model : Virtual Machine | |
Name : CONTAINERHOST | |
PrimaryOwnerName : | |
TotalPhysicalMemory : 4105752576 |
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
WORKDIR prep | |
RUN Invoke-WebRequest "https://go.microsoft.com/fwlink/?linkid=517856" -UseBasicParsing -OutFile appinsights.msi; ` | |
Start-Process -filepath "appinsights.msi" -ArgumentList "/quiet" -PassThru | Wait-Process; ` | |
Remove-Item .\* -recurse -force -Verbose | |
RUN Import-Module 'C:\Program Files\Microsoft Application Insights\Status Monitor\PowerShell\Microsoft.Diagnostics.Agent.StatusMonitor.PowerShell.dll'; ` | |
Start-ApplicationInsightsMonitoring -Name 'default web site' -InstrumentationKey '3c069cb6-fc1a-4bab-974c-0a4245ae7f1b' |