├── .gitignore ├── iaas ├── aks │ ├── azure-vote.yaml │ └── create-aks.ps1 ├── batch │ └── cli │ │ ├── batch.ps1 │ │ ├── stdout.txt │ │ └── stdout0.txt └── docker │ ├── .dockerignore │ ├── commands.ps1 │ ├── create-webapp.ps1 │ ├── dockerfile │ └── webapp │ ├── Controllers │ └── HomeController.cs │ ├── Models │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Privacy.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _CookieConsentPartial.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── webapp.csproj │ └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── paas ├── functions │ └── queuetrigger │ │ ├── .gitignore │ │ ├── Order.cs │ │ ├── ProcessOrders.cs │ │ ├── functions.csproj │ │ ├── host.json │ │ ├── local.settings.json │ │ ├── order1.json │ │ └── setup.ps1 ├── mobile │ ├── la70532ma.sln │ └── la70532ma │ │ ├── AppDelegate.cs │ │ ├── Info.plist │ │ ├── Main.cs │ │ ├── MainStoryboard_iPad.storyboard │ │ ├── MainStoryboard_iPhone.storyboard │ │ ├── QSTodoListViewController.cs │ │ ├── QSTodoListViewController.designer.cs │ │ ├── QSTodoService.cs │ │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Landscape.png │ │ ├── Default-Landscape@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-72.png │ │ ├── Icon-72@2x.png │ │ ├── Icon.png │ │ └── Icon@2x.png │ │ ├── ToDoItem.cs │ │ ├── la70532ma.csproj │ │ └── packages.config └── webapps │ ├── deploy-from-dockerhub.ps1 │ └── deploy-from-github.ps1 ├── secure-monitor-optimize ├── aicore │ ├── Controllers │ │ └── HomeController.cs │ ├── Models │ │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _CookieConsentPartial.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── create-ai.ps1 │ ├── publish │ │ ├── Microsoft.AI.DependencyCollector.dll │ │ ├── Microsoft.AI.PerfCounterCollector.dll │ │ ├── Microsoft.AI.ServerTelemetryChannel.dll │ │ ├── Microsoft.AI.WindowsServer.dll │ │ ├── Microsoft.ApplicationInsights.AspNetCore.dll │ │ ├── Microsoft.ApplicationInsights.TraceListener.dll │ │ ├── Microsoft.ApplicationInsights.dll │ │ ├── Microsoft.Extensions.PlatformAbstractions.dll │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── web.Views.dll │ │ ├── web.Views.pdb │ │ ├── web.config │ │ ├── web.deps.json │ │ ├── web.dll │ │ ├── web.pdb │ │ ├── web.runtimeconfig.json │ │ └── wwwroot │ │ │ ├── css │ │ │ └── site.css │ │ │ ├── favicon.ico │ │ │ ├── js │ │ │ └── site.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ ├── css │ │ │ │ ├── bootstrap-grid.css │ │ │ │ ├── bootstrap-grid.css.map │ │ │ │ ├── bootstrap-grid.min.css │ │ │ │ ├── bootstrap-grid.min.css.map │ │ │ │ ├── bootstrap-reboot.css │ │ │ │ ├── bootstrap-reboot.css.map │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ │ └── js │ │ │ │ ├── bootstrap.bundle.js │ │ │ │ ├── bootstrap.bundle.js.map │ │ │ │ ├── bootstrap.bundle.min.js │ │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.js.map │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── bootstrap.min.js.map │ │ │ ├── jquery-validation-unobtrusive │ │ │ ├── LICENSE.txt │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ ├── additional-methods.js │ │ │ │ ├── additional-methods.min.js │ │ │ │ ├── jquery.validate.js │ │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ ├── LICENSE.txt │ │ │ └── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ ├── web.csproj │ └── wwwroot │ │ ├── css │ │ └── site.css │ │ ├── favicon.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── bloblog │ ├── configbloblogging │ │ ├── Program.cs │ │ └── configlogging.csproj │ ├── deploy.ps1 │ └── webbloblogging │ │ ├── Controllers │ │ └── HomeController.cs │ │ ├── Models │ │ └── ErrorViewModel.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _CookieConsentPartial.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── deploy.ps1 │ │ ├── publish.zip │ │ ├── publish │ │ ├── Microsoft.Extensions.Logging.AzureAppServices.dll │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── web.config │ │ ├── webbloblogging.Views.dll │ │ ├── webbloblogging.Views.pdb │ │ ├── webbloblogging.deps.json │ │ ├── webbloblogging.dll │ │ ├── webbloblogging.pdb │ │ ├── webbloblogging.runtimeconfig.json │ │ └── wwwroot │ │ │ ├── css │ │ │ └── site.css │ │ │ ├── favicon.ico │ │ │ ├── js │ │ │ └── site.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ ├── css │ │ │ │ ├── bootstrap-grid.css │ │ │ │ ├── bootstrap-grid.css.map │ │ │ │ ├── bootstrap-grid.min.css │ │ │ │ ├── bootstrap-grid.min.css.map │ │ │ │ ├── bootstrap-reboot.css │ │ │ │ ├── bootstrap-reboot.css.map │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ │ └── js │ │ │ │ ├── bootstrap.bundle.js │ │ │ │ ├── bootstrap.bundle.js.map │ │ │ │ ├── bootstrap.bundle.min.js │ │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.js.map │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── bootstrap.min.js.map │ │ │ ├── jquery-validation-unobtrusive │ │ │ ├── LICENSE.txt │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ ├── additional-methods.js │ │ │ │ ├── additional-methods.min.js │ │ │ │ ├── jquery.validate.js │ │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ ├── LICENSE.txt │ │ │ └── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ │ ├── webbloblogging.csproj │ │ └── wwwroot │ │ ├── css │ │ └── site.css │ │ ├── favicon.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── ddm │ └── config.ps1 ├── kvsecrets │ ├── Program.cs │ ├── configure.ps1 │ └── secrets.csproj ├── sas │ ├── bleu.jpg │ └── create-sas.ps1 ├── spmsi │ └── scripts.ps1 └── storage │ ├── Program.cs │ ├── configure.ps1 │ └── storage.csproj ├── storage ├── blobs │ ├── Blob.txt │ ├── Blob_DOWNLOADED.txt │ ├── Blobs.cs │ ├── Program.cs │ ├── blobs.csproj │ └── config.ps1 ├── cosmosdb │ ├── Program.cs │ ├── config.ps1 │ ├── cosmosdb.csproj │ └── data │ │ ├── andersen.json │ │ └── wakefield.json └── tables │ ├── Gamer.cs │ ├── Program.cs │ ├── Tables.cs │ ├── config.ps1 │ └── tables.csproj └── thirdparty ├── eventgrid ├── Controllers │ ├── HomeController.cs │ └── UpdatesController.cs ├── Hubs │ └── GridEventsHub.cs ├── Models │ ├── CloudEvent.cs │ ├── ErrorViewModel.cs │ └── GridEvent.cs ├── Program.cs ├── Startup.cs ├── Views │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ ├── Index.cshtml │ │ └── Privacy.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _CookieConsentPartial.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── appsettings.Development.json ├── appsettings.json ├── bundleconfig.json ├── config.ps1 ├── testfile.txt ├── viewer.csproj └── wwwroot │ ├── css │ ├── site.css │ └── site.min.css │ ├── favicon.ico │ ├── images │ ├── banner1.svg │ ├── banner2.svg │ ├── banner3.svg │ ├── banner4.svg │ └── eventgrid.png │ ├── js │ ├── site.js │ └── site.min.js │ └── lib │ ├── bootstrap │ ├── .bower.json │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ ├── jquery-validation-unobtrusive │ ├── .bower.json │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── .bower.json │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ ├── jquery │ ├── .bower.json │ ├── LICENSE.txt │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map │ └── signalr.min.js ├── logic ├── bleu.jpg ├── logicapp.json └── setup.ps1 ├── search └── console │ ├── Hotel.cs │ ├── Program.cs │ ├── appsettings.json │ ├── config.ps1 │ └── search.csproj └── servicebus ├── Program.cs ├── create.ps1 └── sb.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.*~ 3 | project.lock.json 4 | .DS_Store 5 | *.pyc 6 | 7 | # Visual Studio Code 8 | .vscode 9 | 10 | # User-specific files 11 | *.suo 12 | *.user 13 | *.userosscache 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | build/ 24 | bld/ 25 | [Bb]in/ 26 | [Oo]bj/ 27 | msbuild.log 28 | msbuild.err 29 | msbuild.wrn 30 | 31 | # Visual Studio 2015 32 | .vs/ 33 | -------------------------------------------------------------------------------- /iaas/aks/azure-vote.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: azure-vote-back 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: azure-vote-back 10 | template: 11 | metadata: 12 | labels: 13 | app: azure-vote-back 14 | spec: 15 | containers: 16 | - name: azure-vote-back 17 | image: redis 18 | resources: 19 | requests: 20 | cpu: 100m 21 | memory: 128Mi 22 | limits: 23 | cpu: 250m 24 | memory: 256Mi 25 | ports: 26 | - containerPort: 6379 27 | name: redis 28 | --- 29 | apiVersion: v1 30 | kind: Service 31 | metadata: 32 | name: azure-vote-back 33 | spec: 34 | ports: 35 | - port: 6379 36 | selector: 37 | app: azure-vote-back 38 | --- 39 | apiVersion: apps/v1 40 | kind: Deployment 41 | metadata: 42 | name: azure-vote-front 43 | spec: 44 | replicas: 1 45 | selector: 46 | matchLabels: 47 | app: azure-vote-front 48 | template: 49 | metadata: 50 | labels: 51 | app: azure-vote-front 52 | spec: 53 | containers: 54 | - name: azure-vote-front 55 | image: microsoft/azure-vote-front:v1 56 | resources: 57 | requests: 58 | cpu: 100m 59 | memory: 128Mi 60 | limits: 61 | cpu: 250m 62 | memory: 256Mi 63 | ports: 64 | - containerPort: 80 65 | env: 66 | - name: REDIS 67 | value: "azure-vote-back" 68 | --- 69 | apiVersion: v1 70 | kind: Service 71 | metadata: 72 | name: azure-vote-front 73 | spec: 74 | type: LoadBalancer 75 | ports: 76 | - port: 80 77 | selector: 78 | app: azure-vote-front -------------------------------------------------------------------------------- /iaas/aks/create-aks.ps1: -------------------------------------------------------------------------------- 1 | $rg = "aksdemos" 2 | $cluster = "akscluster" 3 | 4 | az group create -n $rg ` 5 | -l westus 6 | 7 | az aks create -g $rg ` 8 | -n $cluster ` 9 | --node-count 1 ` 10 | --generate-ssh-keys ` 11 | --enable-addons monitoring 12 | 13 | az aks get-credentials ` 14 | -g $rg ` 15 | -n $cluster 16 | 17 | kubectl get nodes 18 | 19 | kubectl apply -f azure-vote.yaml 20 | 21 | kubectl get service azure-vote-front ` 22 | --watch 23 | -------------------------------------------------------------------------------- /iaas/batch/cli/batch.ps1: -------------------------------------------------------------------------------- 1 | $rgName = "batch" 2 | $stgAcctName = "laaz203batchsa" 3 | $location = "westus" 4 | $batchAcctName = "laaz203batchacct" 5 | $poolName = "myPool" 6 | 7 | az group create ` 8 | -l $location ` 9 | -n $rgName 10 | 11 | az storage account create ` 12 | -g $rgName ` 13 | -n $stgAcctName ` 14 | -l $location ` 15 | --sku Standard_LRS 16 | 17 | az batch account create ` 18 | -n $batchAcctName ` 19 | --storage-account $stgAcctName ` 20 | -g $rgName ` 21 | -l $location 22 | 23 | az batch account login ` 24 | -n $batchAcctName ` 25 | -g $rgName ` 26 | --shared-key-auth 27 | 28 | az batch pool create ` 29 | --id $poolName ` 30 | --vm-size Standard_A1_v2 ` 31 | --target-dedicated-nodes 2 ` 32 | --image ` 33 | canonical:ubuntuserver:16.04-LTS ` 34 | --node-agent-sku-id ` 35 | "batch.node.ubuntu 16.04" 36 | 37 | az batch pool show ` 38 | --pool-id $poolName ` 39 | --query "allocationState" 40 | 41 | az batch job create ` 42 | --id myjob ` 43 | --pool-id $poolName 44 | 45 | for ($i=0; $i -lt 4; $i++) { 46 | az batch task create ` 47 | --task-id mytask$i ` 48 | --job-id myjob ` 49 | --command-line "/bin/bash -c 'printenv | grep AZ_BATCH; sleep 90s'" 50 | } 51 | 52 | az batch task show ` 53 | --job-id myjob ` 54 | --task-id mytask1 55 | 56 | az batch task file list ` 57 | --job-id myjob ` 58 | --task-id mytask1 ` 59 | --output table 60 | 61 | az batch task file download ` 62 | --job-id myjob ` 63 | --task-id mytask0 ` 64 | --file-path stdout.txt ` 65 | --destination ./stdout0.txt 66 | 67 | az batch pool delete -n $poolName 68 | az group delete -n $rgName -------------------------------------------------------------------------------- /iaas/batch/cli/stdout.txt: -------------------------------------------------------------------------------- 1 | AZ_BATCH_TASK_DIR=/mnt/batch/tasks/workitems/myjob/job-1/mytask1 2 | AZ_BATCH_NODE_STARTUP_DIR=/mnt/batch/tasks/startup 3 | AZ_BATCH_CERTIFICATES_DIR=/mnt/batch/tasks/workitems/myjob/job-1/mytask1/certs 4 | AZ_BATCH_ACCOUNT_URL=https://laaz203batchacct.westus.batch.azure.com/ 5 | AZ_BATCH_TASK_WORKING_DIR=/mnt/batch/tasks/workitems/myjob/job-1/mytask1/wd 6 | AZ_BATCH_NODE_SHARED_DIR=/mnt/batch/tasks/shared 7 | AZ_BATCH_TASK_USER=_azbatch 8 | AZ_BATCH_NODE_ROOT_DIR=/mnt/batch/tasks 9 | AZ_BATCH_NODE_IS_DEDICATED=true 10 | AZ_BATCH_JOB_ID=myjob 11 | AZ_BATCH_NODE_ID=tvm-1219235766_1-20190125t044940z 12 | AZ_BATCH_POOL_ID=myPool 13 | AZ_BATCH_TASK_ID=mytask1 14 | AZ_BATCH_ACCOUNT_NAME=laaz203batchacct 15 | AZ_BATCH_TASK_USER_IDENTITY=PoolNonAdmin 16 | -------------------------------------------------------------------------------- /iaas/batch/cli/stdout0.txt: -------------------------------------------------------------------------------- 1 | AZ_BATCH_TASK_DIR=/mnt/batch/tasks/workitems/myjob/job-1/mytask0 2 | AZ_BATCH_NODE_STARTUP_DIR=/mnt/batch/tasks/startup 3 | AZ_BATCH_CERTIFICATES_DIR=/mnt/batch/tasks/workitems/myjob/job-1/mytask0/certs 4 | AZ_BATCH_ACCOUNT_URL=https://laaz203batchacct.westus.batch.azure.com/ 5 | AZ_BATCH_TASK_WORKING_DIR=/mnt/batch/tasks/workitems/myjob/job-1/mytask0/wd 6 | AZ_BATCH_NODE_SHARED_DIR=/mnt/batch/tasks/shared 7 | AZ_BATCH_TASK_USER=_azbatch 8 | AZ_BATCH_NODE_ROOT_DIR=/mnt/batch/tasks 9 | AZ_BATCH_NODE_IS_DEDICATED=true 10 | AZ_BATCH_JOB_ID=myjob 11 | AZ_BATCH_NODE_ID=tvm-1219235766_2-20190125t044940z 12 | AZ_BATCH_POOL_ID=myPool 13 | AZ_BATCH_TASK_ID=mytask0 14 | AZ_BATCH_ACCOUNT_NAME=laaz203batchacct 15 | AZ_BATCH_TASK_USER_IDENTITY=PoolNonAdmin 16 | -------------------------------------------------------------------------------- /iaas/docker/.dockerignore: -------------------------------------------------------------------------------- 1 | bin\ 2 | obj\ -------------------------------------------------------------------------------- /iaas/docker/commands.ps1: -------------------------------------------------------------------------------- 1 | docker image ls 2 | docker build -t webapp . 3 | docker run -d -p 8080:80 --name myapp webapp 4 | docker ps -a 5 | -------------------------------------------------------------------------------- /iaas/docker/create-webapp.ps1: -------------------------------------------------------------------------------- 1 | mkdir webapp 2 | cd webapp 3 | dotnet new mvc 4 | dotnet build 5 | dotnet run -------------------------------------------------------------------------------- /iaas/docker/dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env 2 | WORKDIR /app 3 | 4 | # Copy csproj and restore as distinct layers 5 | COPY webapp/*.csproj ./ 6 | RUN dotnet restore 7 | 8 | # Copy everything else and build 9 | COPY ./webapp ./ 10 | RUN dotnet publish -c Release -o out 11 | 12 | # Build runtime image 13 | FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 14 | WORKDIR /app 15 | COPY --from=build-env /app/out . 16 | ENTRYPOINT ["dotnet", "webapp.dll"] 17 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using webapp.Models; 8 | 9 | namespace webapp.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult Privacy() 19 | { 20 | return View(); 21 | } 22 | 23 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 24 | public IActionResult Error() 25 | { 26 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace webapp.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /iaas/docker/webapp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace webapp 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:61107", 7 | "sslPort": 44336 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "webapp": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /iaas/docker/webapp/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.AspNetCore.HttpsPolicy; 9 | using Microsoft.AspNetCore.Mvc; 10 | using Microsoft.Extensions.Configuration; 11 | using Microsoft.Extensions.DependencyInjection; 12 | 13 | namespace webapp 14 | { 15 | public class Startup 16 | { 17 | public Startup(IConfiguration configuration) 18 | { 19 | Configuration = configuration; 20 | } 21 | 22 | public IConfiguration Configuration { get; } 23 | 24 | // This method gets called by the runtime. Use this method to add services to the container. 25 | public void ConfigureServices(IServiceCollection services) 26 | { 27 | services.Configure(options => 28 | { 29 | // This lambda determines whether user consent for non-essential cookies is needed for a given request. 30 | options.CheckConsentNeeded = context => true; 31 | options.MinimumSameSitePolicy = SameSiteMode.None; 32 | }); 33 | 34 | 35 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); 36 | } 37 | 38 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 39 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 40 | { 41 | if (env.IsDevelopment()) 42 | { 43 | app.UseDeveloperExceptionPage(); 44 | } 45 | else 46 | { 47 | app.UseExceptionHandler("/Home/Error"); 48 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 49 | app.UseHsts(); 50 | } 51 | 52 | app.UseHttpsRedirection(); 53 | app.UseStaticFiles(); 54 | app.UseCookiePolicy(); 55 | 56 | app.UseMvc(routes => 57 | { 58 | routes.MapRoute( 59 | name: "default", 60 | template: "{controller=Home}/{action=Index}/{id?}"); 61 | }); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - webapp 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 |
22 | 41 |
42 |
43 | 44 |
45 | @RenderBody() 46 |
47 |
48 | 49 |
50 |
51 | © 2019 - webapp - Privacy 52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 66 | 72 | 73 | 74 | 75 | @RenderSection("Scripts", required: false) 76 | 77 | 78 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using webapp 2 | @using webapp.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /iaas/docker/webapp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /iaas/docker/webapp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /iaas/docker/webapp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /iaas/docker/webapp/webapp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /iaas/docker/webapp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /iaas/docker/webapp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/iaas/docker/webapp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /iaas/docker/webapp/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /iaas/docker/webapp/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /iaas/docker/webapp/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /iaas/docker/webapp/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /iaas/docker/webapp/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /iaas/docker/webapp/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /paas/functions/queuetrigger/Order.cs: -------------------------------------------------------------------------------- 1 | namespace linuxacademy.az203.paas.functions 2 | { 3 | public class Order 4 | { 5 | public string PartitionKey { get; set; } 6 | public string RowKey { get; set; } 7 | public string Description { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /paas/functions/queuetrigger/ProcessOrders.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Azure.WebJobs; 3 | using Microsoft.Azure.WebJobs.Host; 4 | using Microsoft.Extensions.Logging; 5 | using Microsoft.WindowsAzure.Storage.Queue; 6 | using Microsoft.WindowsAzure.Storage.Table; 7 | using Newtonsoft.Json; 8 | 9 | namespace linuxacademy.az203.paas.functions 10 | { 11 | public static class OrderProcessor 12 | { 13 | [FunctionName("ProcessOrders")] 14 | public static void ProcessOrders( 15 | [QueueTrigger("incoming-orders", 16 | Connection = "AzureWebJobsStorage")] 17 | CloudQueueMessage queueItem, 18 | [Table("Orders", 19 | Connection = "AzureWebJobsStorage")] 20 | ICollector tableBindings, 21 | ILogger log) 22 | { 23 | log.LogInformation($"Processing Order (mesage Id): {queueItem.Id}"); 24 | log.LogInformation($"Processing at: {DateTime.UtcNow}"); 25 | log.LogInformation($"Queue Insertion Time: {queueItem.InsertionTime}"); 26 | log.LogInformation($"Queue Insertion Time: {queueItem.ExpirationTime}"); 27 | log.LogInformation($"Data: {queueItem.AsString}"); 28 | tableBindings.Add(JsonConvert.DeserializeObject( 29 | queueItem.AsString)); 30 | } 31 | 32 | [FunctionName("ProcessOrders-Poison")] 33 | public static void ProcessFailedOrders( 34 | [QueueTrigger("incoming-orders-poison", 35 | Connection = "AzureWebJobsStorage")] 36 | CloudQueueMessage queueItem, 37 | ILogger log) 38 | { 39 | log.LogInformation($"C# Queue trigger function processed: {queueItem}"); 40 | log.LogInformation($"Data: {queueItem.AsString}"); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /paas/functions/queuetrigger/functions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp2.1 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | PreserveNewest 14 | 15 | 16 | PreserveNewest 17 | Never 18 | 19 | 20 | -------------------------------------------------------------------------------- /paas/functions/queuetrigger/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /paas/functions/queuetrigger/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 6 | }, 7 | "ConnectionStrings": {} 8 | } -------------------------------------------------------------------------------- /paas/functions/queuetrigger/order1.json: -------------------------------------------------------------------------------- 1 | { 2 | "PartitionKey": "Computer", 3 | "RowKey": "Disk", 4 | "Description": "NVMe SSD" 5 | } -------------------------------------------------------------------------------- /paas/functions/queuetrigger/setup.ps1: -------------------------------------------------------------------------------- 1 | $acct = "laaz203functionssa" 2 | $rg = "functions" 3 | $queue = "incoming-orders" 4 | 5 | az group create -n $rg -l westus 6 | 7 | az storage account create ` 8 | -n $acct ` 9 | -g $rg ` 10 | -l westus ` 11 | --sku Standard_LRS ` 12 | --kind StorageV2 ` 13 | --access-tier Hot 14 | 15 | $key = $(az storage account keys list ` 16 | --account-name $acct ` 17 | -g $rg ` 18 | --query "[0].value" ` 19 | --output tsv) 20 | 21 | az storage queue create ` 22 | -n $queue ` 23 | --account-name $acct ` 24 | --account-key $key 25 | 26 | az storage account show-connection-string ` 27 | -n $acct ` 28 | --query "connectionString" 29 | 30 | 31 | $order1json = Get-Content -Path order1.json 32 | 33 | az storage message put ` 34 | --account-name $acct ` 35 | --account-key $key ` 36 | --queue-name $queue ` 37 | --content $order1json 38 | 39 | az group delete -n $rg -y 40 | 41 | 42 | -------------------------------------------------------------------------------- /paas/mobile/la70532ma.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "la70532ma", "la70532ma\la70532ma.csproj", "{07F1CD1B-626F-4BE5-9840-97B44CBB94C9}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|iPhone = Debug|iPhone 11 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 12 | Release|iPhone = Release|iPhone 13 | Release|iPhoneSimulator = Release|iPhoneSimulator 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhone.ActiveCfg = Debug|iPhone 17 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhone.Build.0 = Debug|iPhone 18 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhone.Deploy.0 = Debug|iPhone 19 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 20 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 21 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhoneSimulator.Deploy.0 = Debug|iPhoneSimulator 22 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhone.ActiveCfg = Release|iPhone 23 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhone.Build.0 = Release|iPhone 24 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhone.Deploy.0 = Release|iPhone 25 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 26 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 27 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhoneSimulator.Deploy.0 = Release|iPhoneSimulator 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | GlobalSection(MonoDevelopProperties) = preSolution 33 | StartupItem = la70532ma\la70532ma.csproj 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /paas/mobile/la70532ma/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Foundation; 5 | using UIKit; 6 | 7 | namespace la70532ma 8 | { 9 | // The UIApplicationDelegate for the application. This class is responsible for launching the 10 | // User Interface of the application, as well as listening (and optionally responding) to 11 | // application events from iOS. 12 | [Register ("AppDelegate")] 13 | public partial class AppDelegate : UIApplicationDelegate 14 | { 15 | // class-level declarations 16 | public override UIWindow Window {get; set;} 17 | 18 | // needed for authorization 19 | public static Func ResumeWithURL; 20 | 21 | public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options) 22 | { 23 | return ResumeWithURL != null && ResumeWithURL(url); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | 20 | UIMainStoryboardFile 21 | MainStoryboard_iPhone 22 | UIMainStoryboardFile~ipad 23 | MainStoryboard_iPad 24 | MinimumOSVersion 25 | 11.3 26 | CFBundleIconFiles 27 | 28 | Icon.png 29 | Icon@2x.png 30 | Icon-72.png 31 | Icon-72@2x.png 32 | Default.png 33 | Default@2x.png 34 | Default-568h@2x.png 35 | Default-Landscape.png 36 | Default-Landscape@2x.png 37 | Default-Portrait.png 38 | Default-Portrait@2x.png 39 | 40 | CFBundleDisplayName 41 | la70532ma 42 | CFBundleIdentifier 43 | net.azure-mobile.la70532ma 44 | CFBundleVersion 45 | 1.0 46 | NSMainNibFile 47 | 48 | NSMainNibFile~ipad 49 | 50 | CFBundleName 51 | la70532ma 52 | CFBundleURLTypes 53 | 54 | 55 | CFBundleURLName 56 | la70532ma 57 | CFBundleURLSchemes 58 | 59 | la70532ma 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Foundation; 5 | using UIKit; 6 | 7 | namespace la70532ma 8 | { 9 | public class Application 10 | { 11 | // This is the main entry point of the application. 12 | static void Main (string[] args) 13 | { 14 | // if you want to use a different Application Delegate class from "AppDelegate" 15 | // you can specify it here. 16 | UIApplication.Main (args, null, "AppDelegate"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /paas/mobile/la70532ma/QSTodoListViewController.designer.cs: -------------------------------------------------------------------------------- 1 | // WARNING 2 | // 3 | // This file has been generated automatically by Visual Studio from the outlets and 4 | // actions declared in your storyboard file. 5 | // Manual changes to this file will not be maintained. 6 | // 7 | using Foundation; 8 | using System; 9 | using System.CodeDom.Compiler; 10 | using UIKit; 11 | 12 | namespace la70532ma 13 | { 14 | [Register ("QSTodoListViewController")] 15 | partial class QSTodoListViewController 16 | { 17 | [Outlet] 18 | UIKit.UITextField itemText { get; set; } 19 | 20 | [Action ("OnAdd:")] 21 | [GeneratedCode ("iOS Designer", "1.0")] 22 | partial void OnAdd (UIKit.UIButton sender); 23 | 24 | void ReleaseDesignerOutlets () 25 | { 26 | if (itemText != null) { 27 | itemText.Dispose (); 28 | itemText = null; 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Default-Landscape.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Default-Landscape@2x.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Default.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Default@2x.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Icon-72.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Icon-72@2x.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Icon.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/Resources/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/paas/mobile/la70532ma/Resources/Icon@2x.png -------------------------------------------------------------------------------- /paas/mobile/la70532ma/ToDoItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace la70532ma 5 | { 6 | public class ToDoItem 7 | { 8 | public string Id { get; set; } 9 | 10 | [JsonProperty(PropertyName = "text")] 11 | public string Text { get; set; } 12 | 13 | [JsonProperty(PropertyName = "complete")] 14 | public bool Complete { get; set; } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /paas/webapps/deploy-from-dockerhub.ps1: -------------------------------------------------------------------------------- 1 | $rg = "webapps" 2 | $planname = "dockerhubdeployasp" 3 | $appname = "laaz203dockerhubdeploy" 4 | $container = "microsoft/dotnet-samples:aspnetapp" 5 | 6 | az group create -n $rg -l westus 7 | az appservice plan create ` 8 | -n $planname ` 9 | -g $rg ` 10 | --sku B1 ` 11 | --is-linux 12 | 13 | az webapp create ` 14 | -n $appname ` 15 | -g $rg ` 16 | --plan $planname ` 17 | --deployment-container-image-name $container 18 | 19 | az webapp config appsettings set ` 20 | -g $rg ` 21 | -n $appname ` 22 | --settings WEBSITES_PORT=80 23 | 24 | az webapp show -n $appname -g $rg 25 | az webapp show -n $appname -g $rg --query "defaultHostName" -o tsv 26 | az group delete -n $rg --yes 27 | -------------------------------------------------------------------------------- /paas/webapps/deploy-from-github.ps1: -------------------------------------------------------------------------------- 1 | $rg = "webapps" 2 | $planname = "githubdeployasp" 3 | $appname = "laaz203githubdeploy" 4 | $repourl = "https://github.com/Azure-Samples/php-docs-hello-world" 5 | 6 | az group create ` 7 | -n $rg -l westus 8 | 9 | az appservice plan create ` 10 | -n $planname ` 11 | -g $rg ` 12 | --sku FREE 13 | 14 | az webapp create ` 15 | -n $appname ` 16 | -g $rg ` 17 | --plan $planname 18 | 19 | az webapp deployment source config ` 20 | -n $appname ` 21 | -g $rg ` 22 | --repo-url $repourl ` 23 | --branch master ` 24 | --manual-integration 25 | 26 | az webapp deployment source show ` 27 | -n $appname ` 28 | -g $rg 29 | 30 | az webapp show ` 31 | -n $appname ` 32 | -g $rg 33 | 34 | az webapp show ` 35 | -n $appname ` 36 | -g $rg ` 37 | --query "defaultHostName" -o tsv 38 | 39 | az webapp deployment source sync -n $appname -g $rg 40 | az group delete -n $rg --yes 41 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using web.Models; 8 | 9 | namespace web.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | Trace.TraceInformation("In HomeController.Index"); 16 | return View(); 17 | } 18 | 19 | public IActionResult Privacy() 20 | { 21 | return View(); 22 | } 23 | 24 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 25 | public IActionResult Error() 26 | { 27 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace web.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | using Microsoft.ApplicationInsights.AspNetCore; 11 | using Microsoft.ApplicationInsights.AspNetCore.Logging; 12 | using Microsoft.ApplicationInsights.TraceListener; 13 | using System.Diagnostics; 14 | 15 | namespace web 16 | { 17 | public class Program 18 | { 19 | public static void Main(string[] args) 20 | { 21 | CreateWebHostBuilder(args).Build().Run(); 22 | } 23 | 24 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 25 | WebHost.CreateDefaultBuilder(args) 26 | .UseStartup(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:16950", 7 | "sslPort": 44310 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "web": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Diagnostics; 6 | 7 | using Microsoft.AspNetCore.Builder; 8 | using Microsoft.AspNetCore.Hosting; 9 | using Microsoft.AspNetCore.Http; 10 | using Microsoft.AspNetCore.HttpsPolicy; 11 | using Microsoft.AspNetCore.Mvc; 12 | using Microsoft.Extensions.Configuration; 13 | using Microsoft.Extensions.DependencyInjection; 14 | using Microsoft.ApplicationInsights.AspNetCore; 15 | using Microsoft.ApplicationInsights.TraceListener; 16 | 17 | namespace web 18 | { 19 | public class Startup 20 | { 21 | public Startup(IConfiguration configuration) 22 | { 23 | Configuration = configuration; 24 | } 25 | 26 | public IConfiguration Configuration { get; } 27 | 28 | // This method gets called by the runtime. Use this method to add services to the container. 29 | public void ConfigureServices(IServiceCollection services) 30 | { 31 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); 32 | services.AddApplicationInsightsTelemetry("3b27a78a-f2a3-4567-b66b-d0db3dabcaa1"); 33 | Trace.Listeners.Add(new ApplicationInsightsTraceListener()); 34 | } 35 | 36 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 37 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 38 | { 39 | if (env.IsDevelopment()) 40 | { 41 | app.UseDeveloperExceptionPage(); 42 | } 43 | else 44 | { 45 | app.UseExceptionHandler("/Home/Error"); 46 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 47 | app.UseHsts(); 48 | } 49 | 50 | app.UseStaticFiles(); 51 | app.UseCookiePolicy(); 52 | 53 | app.UseMvc(routes => 54 | { 55 | routes.MapRoute( 56 | name: "default", 57 | template: "{controller=Home}/{action=Index}/{id?}"); 58 | }); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - web 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 |
22 | 41 |
42 |
43 | 44 |
45 | @RenderBody() 46 |
47 |
48 | 49 |
50 |
51 | © 2019 - web - Privacy 52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 66 | 72 | 73 | 74 | 75 | @RenderSection("Scripts", required: false) 76 | 77 | 78 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using web 2 | @using web.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/create-ai.ps1: -------------------------------------------------------------------------------- 1 | $resourceGroup = "appinsights" 2 | $appInsightsName = "laaz203aisample" 3 | az group create -n $resourceGroup -l eastus 4 | 5 | $propsFile = "props.json" 6 | '{"Application_Type":"web"}' | Out-File $propsFile 7 | az resource create ` 8 | -g $resourceGroup -n $appInsightsName ` 9 | --resource-type "Microsoft.Insights/components" ` 10 | --properties "@$propsFile" 11 | Remove-Item $propsFile 12 | 13 | az resource show -g $resourceGroup -n $appInsightsName ` 14 | --resource-type "Microsoft.Insights/components" ` 15 | --query "properties.InstrumentationKey" -o tsv 16 | 17 | az group delete -n $resourceGroup -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/Microsoft.AI.DependencyCollector.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/Microsoft.AI.DependencyCollector.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/Microsoft.AI.PerfCounterCollector.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/Microsoft.AI.PerfCounterCollector.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/Microsoft.AI.ServerTelemetryChannel.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/Microsoft.AI.ServerTelemetryChannel.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/Microsoft.AI.WindowsServer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/Microsoft.AI.WindowsServer.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/Microsoft.ApplicationInsights.AspNetCore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/Microsoft.ApplicationInsights.AspNetCore.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/Microsoft.ApplicationInsights.TraceListener.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/Microsoft.ApplicationInsights.TraceListener.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/Microsoft.ApplicationInsights.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/Microsoft.ApplicationInsights.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/Microsoft.Extensions.PlatformAbstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/Microsoft.Extensions.PlatformAbstractions.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "ApplicationInsights": { 10 | "InstrumentationKey": "e15e9696-f7a8-4755-a65b-277796f5c256" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "ApplicationInsights": { 9 | "InstrumentationKey": "e15e9696-f7a8-4755-a65b-277796f5c256" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/web.Views.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/web.Views.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/web.Views.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/web.Views.pdb -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/web.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/web.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/web.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/web.pdb -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/web.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.2", 4 | "framework": { 5 | "name": "Microsoft.AspNetCore.App", 6 | "version": "2.2.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/publish/wwwroot/favicon.ico -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/publish/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp2.2 4 | InProcess 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/aicore/wwwroot/favicon.ico -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /secure-monitor-optimize/aicore/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/configbloblogging/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | using System.Net.Http; 5 | using System.Threading.Tasks; 6 | using Microsoft.Azure; 7 | using Microsoft.Azure.Management.WebSites; 8 | using Microsoft.Azure.Management.WebSites.Models; 9 | using Microsoft.Azure.Management.ResourceManager; 10 | using Microsoft.Azure.Management.ResourceManager.Models; 11 | using Microsoft.Azure.Management.ResourceManager.Fluent; 12 | using Microsoft.Azure.Common; 13 | using Microsoft.Rest; 14 | using Microsoft.Rest.Azure; 15 | using Microsoft.Rest.Azure.Authentication; 16 | using Microsoft.IdentityModel.Clients.ActiveDirectory; 17 | 18 | namespace configlogging 19 | { 20 | class Program 21 | { 22 | static void Main(string[] args) 23 | { 24 | runAsync().Wait(); 25 | } 26 | 27 | private static async Task runAsync() 28 | { 29 | var resourceGroupName = "monitorwebapps"; 30 | var webSiteName = "laaz203bloblog"; 31 | 32 | var clientId = "e6f36702-fecf-4182-a0f0-974b93d0485f"; 33 | var clientSecret = "8a13f374-d0e7-4099-9d2b-9bb56ae271ad"; 34 | var subscriptionId = "298c6f7d-4dac-465f-b7e4-65e216d1dbe9"; 35 | var tenantId = "8c7d3a28-a492-4475-866a-f54c96d0f7d7"; 36 | var sasUrl = "https://laaz20bloglogstg.blob.core.windows.net/logs?sv=2018-03-28&si=logpolicy&sr=c&sig=xy4YdzNIFlkCv7QZue5WdjlfUSLdTX0p15ym/V2Rn04%3D"; 37 | 38 | var serviceCredentials = 39 | await ApplicationTokenProvider.LoginSilentAsync( 40 | tenantId, clientId, clientSecret); 41 | var client = new WebSiteManagementClient( 42 | serviceCredentials); 43 | client.SubscriptionId = subscriptionId; 44 | 45 | var appSettings = new StringDictionary( 46 | name: "properties", 47 | properties: new Dictionary { 48 | { "DIAGNOSTICS_AZUREBLOBCONTAINERSASURL", sasUrl }, 49 | { "DIAGNOSTICS_AZUREBLOBRETENTIONINDAYS", "30" }, 50 | } 51 | ); 52 | client.WebApps.UpdateApplicationSettings( 53 | resourceGroupName: resourceGroupName, 54 | name: webSiteName, 55 | appSettings: appSettings 56 | ); 57 | 58 | Console.WriteLine("done"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/configbloblogging/configlogging.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/deploy.ps1: -------------------------------------------------------------------------------- 1 | Push-Location ../aicore 2 | $publishDir = "publish" 3 | $package = "publish.zip" 4 | if (Test-path $publishDir) {Remove-Item -Recurse -Force $publishDir} 5 | if (Test-path $package) {Remove-item $package} 6 | dotnet publish -c release -o $publishDir web.csproj 7 | Compress-Archive -Path $publishDir/* -DestinationPath $package -Force 8 | Move-Item -Path $package -Destination ../bloglog -Force 9 | Pop-Location 10 | 11 | # create a new webapp 12 | $planName="laaz203bloblog" 13 | $resourceGroup = "monitorwebapps" 14 | $appName="laaz203bloblog" 15 | $location="westus" 16 | $stgacct = "laaz20bloglogstg" 17 | 18 | az group create -n $resourceGroup -l $location 19 | 20 | az appservice plan create -n $planName -g $resourceGroup -l $location --sku B1 21 | az webapp create -n $appName -g $resourceGroup --plan $planName 22 | 23 | # deploy publish.zip using the kudu zip api 24 | az webapp deployment source config-zip -n $appName -g $resourceGroup --src $package 25 | 26 | # launch the site in a browser 27 | $site = az webapp show -n $appName -g $resourceGroup --query "defaultHostName" -o tsv 28 | Start-Process https://$site 29 | 30 | az storage account create ` 31 | -g $resourceGroup ` 32 | -n $stgacct ` 33 | -l $location ` 34 | --sku Standard_LRS 35 | 36 | $key = $(az storage account keys list ` 37 | --account-name $stgacct ` 38 | -g $resourceGroup ` 39 | --query "[0].value" ` 40 | --output tsv) 41 | $key 42 | 43 | az storage container create ` 44 | --name logs ` 45 | --account-name $stgacct ` 46 | --account-key $key 47 | 48 | az storage container list ` 49 | --account-name $stgacct ` 50 | --account-key $key 51 | 52 | az storage container policy list ` 53 | -c logs ` 54 | --account-name $stgacct ` 55 | --account-key $key 56 | 57 | $today = Get-Date 58 | $tomorrow = $today.AddDays(1) 59 | $today.ToString("yyyy-MM-dd") 60 | $tomorrow.ToString("yyyy-MM-dd") 61 | 62 | az storage container policy create ` 63 | -c logs ` 64 | --name "logpolicy" ` 65 | --start $today.ToString("yyyy-MM-dd") ` 66 | --expiry $tomorrow.ToString("yyyy-MM-dd") ` 67 | --permissions lwrd ` 68 | --account-name $stgacct ` 69 | --account-key $key 70 | 71 | $sas = az storage container generate-sas ` 72 | --name logs ` 73 | --policy-name logpolicy ` 74 | --account-name $stgacct ` 75 | --account-key $key ` 76 | -o tsv 77 | $sas 78 | 79 | $containerSasUrl = "https://$stgacct.blob.core.windows.net/logs?$sas" 80 | $containerSasUrl 81 | 82 | az ad sp list --display-name LaAz203WebSiteManager 83 | az ad sp delete --id "a7520b14-40f8-466f-90a5-372c789781bc" 84 | 85 | $sp = az ad sp create-for-rbac --name LaAz203WebSiteManager | ConvertFrom-Json 86 | 87 | $subid = az account show --query "id" -o tsv 88 | $tenantid = az account show --query "tenantId" -o tsv 89 | 90 | $clientId = $sp.appId 91 | $clientSecret = $sp.password 92 | "var clientId = `"$clientId`";" 93 | "var clientSecret = `"$clientSecret`";" 94 | "var subscriptionId = `"$subid`";" 95 | "var tenantId = `"$tenantid`";" 96 | "var sasUrl = `"$containerSasUrl`";" 97 | 98 | az webapp log config -n $appName -g $resourceGroup --level information --application-logging true 99 | 100 | az webapp log show -n $appName -g $resourceGroup 101 | 102 | 103 | az webapp delete -g $resourceGroup -n $appName 104 | az group delete -g $resourceGroup --yes 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using webbloblogging.Models; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace webbloblogging.Controllers 11 | { 12 | public class HomeController : Controller 13 | { 14 | private ILogger _logger = null; 15 | 16 | public HomeController(ILogger logger) 17 | { 18 | _logger = logger; 19 | _logger.LogInformation("In HomeController.HomeController"); 20 | } 21 | 22 | public IActionResult Index() 23 | { 24 | _logger.LogInformation("In HomeController.Index"); 25 | return View(); 26 | } 27 | 28 | public IActionResult Privacy() 29 | { 30 | _logger.LogInformation("In HomeController.Privacy"); 31 | return View(); 32 | } 33 | 34 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 35 | public IActionResult Error() 36 | { 37 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace webbloblogging.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | using Microsoft.Extensions.Logging.AzureAppServices; 11 | 12 | namespace webbloblogging 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateWebHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 22 | WebHost.CreateDefaultBuilder(args) 23 | .ConfigureLogging(logging => 24 | { 25 | logging.AddAzureWebAppDiagnostics(); 26 | }) 27 | .UseStartup(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64984", 7 | "sslPort": 44301 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "webbloblogging": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.AspNetCore.HttpsPolicy; 9 | using Microsoft.AspNetCore.Mvc; 10 | using Microsoft.Extensions.Configuration; 11 | using Microsoft.Extensions.DependencyInjection; 12 | 13 | namespace webbloblogging 14 | { 15 | public class Startup 16 | { 17 | public Startup(IConfiguration configuration) 18 | { 19 | Configuration = configuration; 20 | } 21 | 22 | public IConfiguration Configuration { get; } 23 | 24 | // This method gets called by the runtime. Use this method to add services to the container. 25 | public void ConfigureServices(IServiceCollection services) 26 | { 27 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); 28 | } 29 | 30 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 31 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 32 | { 33 | if (env.IsDevelopment()) 34 | { 35 | app.UseDeveloperExceptionPage(); 36 | } 37 | else 38 | { 39 | app.UseExceptionHandler("/Home/Error"); 40 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 41 | app.UseHsts(); 42 | } 43 | 44 | app.UseHttpsRedirection(); 45 | app.UseStaticFiles(); 46 | app.UseCookiePolicy(); 47 | 48 | app.UseMvc(routes => 49 | { 50 | routes.MapRoute( 51 | name: "default", 52 | template: "{controller=Home}/{action=Index}/{id?}"); 53 | }); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - webbloblogging 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 |
22 | 41 |
42 |
43 | 44 |
45 | @RenderBody() 46 |
47 |
48 | 49 |
50 |
51 | © 2019 - webbloblogging - Privacy 52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 66 | 72 | 73 | 74 | 75 | @RenderSection("Scripts", required: false) 76 | 77 | 78 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using webbloblogging 2 | @using webbloblogging.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/deploy.ps1: -------------------------------------------------------------------------------- 1 | # create a new webapp 2 | $planName="laaz203bloblog" 3 | $resourceGroup = "monitorwebapps" 4 | $appName="laaz203bloblog" 5 | $location="westus" 6 | $stgacct = "laaz20bloglogstg" 7 | 8 | # create app service plan and app service 9 | az group create -n $resourceGroup -l $location 10 | az appservice plan create -n $planName ` 11 | -g $resourceGroup -l $location --sku B1 12 | az webapp create -n $appName -g $resourceGroup --plan $planName 13 | 14 | az webapp log config ` 15 | -n $appName ` 16 | -g $resourceGroup ` 17 | --level information ` 18 | --application-logging true 19 | 20 | # build web app package 21 | $publishDir = "publish" 22 | $package = "publish.zip" 23 | if (Test-path $publishDir) {Remove-Item -Recurse -Force $publishDir} 24 | if (Test-path $package) {Remove-item $package} 25 | dotnet publish -c release -o $publishDir webbloblogging.csproj 26 | Compress-Archive -Path $publishDir/* -DestinationPath $package -Force 27 | 28 | # deploy publish.zip using the kudu zip api 29 | az webapp deployment source config-zip ` 30 | -n $appName ` 31 | -g $resourceGroup ` 32 | --src $package 33 | 34 | # launch the site in a browser 35 | $site = az webapp show -n $appName -g $resourceGroup --query "defaultHostName" -o tsv 36 | Start-Process https://$site 37 | 38 | # tail the logs 39 | az webapp log tail --n $appName -g $resourceGroup 40 | 41 | # configure storage account 42 | az storage account create ` 43 | -g $resourceGroup ` 44 | -n $stgacct ` 45 | -l $location ` 46 | --sku Standard_LRS 47 | 48 | $key = $(az storage account keys list ` 49 | --account-name $stgacct ` 50 | -g $resourceGroup ` 51 | --query "[0].value" ` 52 | --output tsv) 53 | $key 54 | 55 | az storage container create ` 56 | --name logs ` 57 | --account-name $stgacct ` 58 | --account-key $key 59 | 60 | az storage container list ` 61 | --account-name $stgacct ` 62 | --account-key $key 63 | 64 | az storage container policy list ` 65 | -c logs ` 66 | --account-name $stgacct ` 67 | --account-key $key 68 | 69 | $today = Get-Date 70 | $tomorrow = $today.AddDays(1) 71 | $today.ToString("yyyy-MM-dd") 72 | $tomorrow.ToString("yyyy-MM-dd") 73 | 74 | az storage container policy create ` 75 | -c logs ` 76 | --name "logpolicy" ` 77 | --start $today.ToString("yyyy-MM-dd") ` 78 | --expiry $tomorrow.ToString("yyyy-MM-dd") ` 79 | --permissions lwrd ` 80 | --account-name $stgacct ` 81 | --account-key $key 82 | 83 | $sas = az storage container generate-sas ` 84 | --name logs ` 85 | --policy-name logpolicy ` 86 | --account-name $stgacct ` 87 | --account-key $key ` 88 | -o tsv 89 | $sas 90 | 91 | $containerSasUrl = "https://$stgacct.blob.core.windows.net/logs?$sas" 92 | $containerSasUrl 93 | 94 | az ad sp list --display-name LaAz203WebSiteManager 95 | az ad sp delete --id "a7520b14-40f8-466f-90a5-372c789781bc" 96 | 97 | $sp = az ad sp create-for-rbac --name LaAz203WebSiteManager | ConvertFrom-Json 98 | 99 | $subid = az account show --query "id" -o tsv 100 | $tenantid = az account show --query "tenantId" -o tsv 101 | 102 | $clientId = $sp.appId 103 | $clientSecret = $sp.password 104 | "var clientId = `"$clientId`";" 105 | "var clientSecret = `"$clientSecret`";" 106 | "var subscriptionId = `"$subid`";" 107 | "var tenantId = `"$tenantid`";" 108 | "var sasUrl = `"$containerSasUrl`";" 109 | 110 | 111 | az webapp log show -n $appName -g $resourceGroup 112 | 113 | 114 | az webapp delete -g $resourceGroup -n $appName 115 | az group delete -g $resourceGroup --yes 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/bloblog/webbloblogging/publish.zip -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/Microsoft.Extensions.Logging.AzureAppServices.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/bloblog/webbloblogging/publish/Microsoft.Extensions.Logging.AzureAppServices.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.Views.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.Views.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.Views.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.Views.pdb -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.dll -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.pdb -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/webbloblogging.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.2", 4 | "framework": { 5 | "name": "Microsoft.AspNetCore.App", 6 | "version": "2.2.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/favicon.ico -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/publish/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/webbloblogging.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp2.2 4 | InProcess 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/bloblog/webbloblogging/wwwroot/favicon.ico -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /secure-monitor-optimize/bloblog/webbloblogging/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /secure-monitor-optimize/ddm/config.ps1: -------------------------------------------------------------------------------- 1 | $rgName="sql" 2 | $location="westus" 3 | $serverName="laaz203sqlserver" 4 | $adminLogin="ServerAdmin" 5 | $adminPassword="Change!Me!Please" 6 | $dbName="masking" 7 | 8 | az group create -n $rgName -l $location 9 | az sql server create -g $rgName -l $location -n $serverName ` 10 | --admin-user $adminLogin --admin-password $adminPassword 11 | 12 | az sql db create ` 13 | -g $rgName ` 14 | -s $serverName ` 15 | -n $dbName ` 16 | --service-objective S0 17 | 18 | <# 19 | CREATE TABLE dbo.Users ( 20 | UserId int NOT NULL, 21 | AccountCode varchar(50) NOT NULL, 22 | Pin varchar(10) NOT NULL, 23 | Name varchar(50) NOT NULL 24 | ) 25 | 26 | INSERT INTO Users VALUES(1, '123-4567-89', 'ABCD', 'Mike') 27 | SELECT * FROM Users; 28 | #> 29 | 30 | New-AzureRmSqlDatabaseDataMaskingRule ` 31 | -ResourceGroupName $rgName ` 32 | -ServerName $serverName ` 33 | -DatabaseName $dbName ` 34 | -SchemaName "dbo" ` 35 | -TableName "Users" ` 36 | -ColumnName "AccountCode" ` 37 | -MaskingFunction Text ` 38 | -SuffixSize 2 ` 39 | -ReplacementString "xxxxxxxx" 40 | 41 | <# 42 | USE masking; 43 | GO 44 | CREATE USER user1 WITHOUT LOGIN; 45 | GRANT SELECT ON OBJECT::dbo.Users TO user1; 46 | GO 47 | 48 | USE masking; 49 | EXECUTE AS USER = 'user1'; 50 | SELECT * FROM Users; 51 | REVERT; 52 | #> 53 | 54 | Remove-AzureRmSqlDatabaseDataMaskingRule ` 55 | -ResourceGroupName $rgName ` 56 | -ServerName $serverName ` 57 | -DatabaseName $dbName ` 58 | -SchemaName "dbo" ` 59 | -TableName "Users" ` 60 | -ColumnName "AccountCode" 61 | 62 | New-AzureRmSqlDatabaseDataMaskingRule ` 63 | -ResourceGroupName $rgName ` 64 | -ServerName $serverName ` 65 | -DatabaseName $dbName ` 66 | -SchemaName "dbo" ` 67 | -TableName "Users" ` 68 | -ColumnName "AccountCode" ` 69 | -MaskingFunction Text ` 70 | -PrefixSize 2 ` 71 | -ReplacementString "xxxxxxxx" 72 | 73 | -------------------------------------------------------------------------------- /secure-monitor-optimize/kvsecrets/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Azure.Services.AppAuthentication; 4 | using Microsoft.Azure.KeyVault; 5 | 6 | namespace secrets 7 | { 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | RunAsync().Wait(); 13 | } 14 | 15 | private static async Task RunAsync() 16 | { 17 | var azureServiceTokenProvider1 = 18 | new AzureServiceTokenProvider(); 19 | var kvc = new KeyVaultClient( 20 | new KeyVaultClient.AuthenticationCallback( 21 | azureServiceTokenProvider1.KeyVaultTokenCallback)); 22 | 23 | var kvBaseUrl = "https://laaz203kvsecrets.vault.azure.net/"; 24 | var secret = await kvc.GetSecretAsync( 25 | kvBaseUrl, "connectionString"); 26 | System.Console.WriteLine(secret.Value); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /secure-monitor-optimize/kvsecrets/configure.ps1: -------------------------------------------------------------------------------- 1 | $location = "westus" 2 | $rgname = "kvsecrets" 3 | $kvname = "laaz203kvsecrets" 4 | $spname = "LaAz203WebAppSecrets" 5 | 6 | az group create --n $rgname -l $location 7 | 8 | az keyvault create ` 9 | -n $kvname ` 10 | -g $rgname ` 11 | --sku standard 12 | 13 | az keyvault secret set ` 14 | --vault-name $kvname ` 15 | --name "connectionString" ` 16 | --value "this is the connection string" 17 | 18 | az keyvault secret show ` 19 | --vault-name $kvname ` 20 | --name connectionString 21 | 22 | # run the app 23 | 24 | $sp = az ad sp create-for-rbac --name $spname | ConvertFrom-Json 25 | $sp 26 | 27 | $tenantid = az account show --query tenantId -o tsv 28 | az login --service-principal ` 29 | --username $sp.appId ` 30 | --password $sp.password ` 31 | --tenant $tenantid 32 | 33 | az keyvault secret show ` 34 | --vault-name $kvname ` 35 | --name connectionString 36 | 37 | # run the app - no access to secret 38 | 39 | az login #back to main account 40 | 41 | az keyvault set-policy ` 42 | --name $kvname ` 43 | --spn $sp.Name ` 44 | --secret-permissions get 45 | 46 | az login --service-principal --username $sp.appId --password $sp.password --tenant $tenantid 47 | 48 | az keyvault secret show ` 49 | --vault-name $kvname ` 50 | --name connectionString 51 | 52 | # run the app 53 | 54 | az ad sp delete --id $sp.appId 55 | az keyvault delete --name $kvname 56 | 57 | az group delete -n $rgname --yes 58 | -------------------------------------------------------------------------------- /secure-monitor-optimize/kvsecrets/secrets.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.2 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /secure-monitor-optimize/sas/bleu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/secure-monitor-optimize/sas/bleu.jpg -------------------------------------------------------------------------------- /secure-monitor-optimize/sas/create-sas.ps1: -------------------------------------------------------------------------------- 1 | $stgacctname = "laaz203blobsas" 2 | $container = "images" 3 | $rgname = "blobsas" 4 | $location = "westus" 5 | 6 | az group create -n $rgname -l $location 7 | 8 | az storage account create ` 9 | -g $rgName ` 10 | -n $stgacctname ` 11 | -l $location ` 12 | --sku Standard_LRS 13 | 14 | $stgacctkey = $(az storage account keys list ` 15 | -g $rgname ` 16 | --account-name $stgacctname ` 17 | --query "[0].value" ` 18 | --output tsv) 19 | $stgacctkey 20 | 21 | az storage container create ` 22 | --account-name $stgacctname ` 23 | --account-key $stgacctkey ` 24 | --name $container 25 | 26 | az storage blob upload ` 27 | --account-name $stgacctname ` 28 | --account-key $stgacctkey ` 29 | --file bleu.jpg ` 30 | --container-name $container ` 31 | --name bleu.jpg 32 | 33 | az storage blob url ` 34 | --account-name $stgacctname ` 35 | --account-key $stgacctkey ` 36 | --container-name $container ` 37 | --name bleu.jpg 38 | 39 | $now = [DateTime]::UtcNow 40 | $now 41 | 42 | $start = $now.ToString('yyyy-MM-ddTHH:mmZ') 43 | $end = $now.AddMinutes(5).ToString('yyyy-MM-ddTHH:mmZ') 44 | $start 45 | $end 46 | 47 | $sas = az storage blob generate-sas ` 48 | --account-name $stgacctname ` 49 | --account-key $stgacctkey ` 50 | --container-name $container ` 51 | --name bleu.jpg ` 52 | --permissions r ` 53 | --start $start ` 54 | --expiry $end 55 | $sas 56 | 57 | az storage blob url ` 58 | --account-name $stgacctname ` 59 | --account-key $stgacctkey ` 60 | --container-name $container ` 61 | --name bleu.jpg ` 62 | --sas $sas ` 63 | -o tsv 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /secure-monitor-optimize/spmsi/scripts.ps1: -------------------------------------------------------------------------------- 1 | $spname = "LaAz203SampleWebAppPrincipal" 2 | 3 | $sp = az ad sp create-for-rbac --name $spname | ConvertFrom-Json 4 | $sp 5 | az ad sp delete --id $sp.appId 6 | 7 | az ad sp show --id $sp.appId 8 | az ad sp list --display-name $spname 9 | 10 | az role assignment list --assignee $sp.appId 11 | 12 | az role definition list --output json ` 13 | --query '[].{"roleName":roleName, "description":description}' 14 | az role definition list --custom-role-only false --output json --query '[].{"roleName":roleName, "description":description, "roleType":roleType}' 15 | az role definition list --name "Contributor" 16 | az role definition list --name "Contributor" ` 17 | --output json --query '[].{"actions":permissions[0].actions, "notActions":permissions[0].notActions}' 18 | 19 | $webappname = "laaz203samplewebapp" 20 | $webapprgname = "laaz203samplewebapprg" 21 | $webappplanname = "laaz203samplewebappplan" 22 | $location = "westus" 23 | 24 | az group create -n $webapprgname -l $location 25 | 26 | az appservice plan create ` 27 | -n $webappplanname ` 28 | -g $webapprgname ` 29 | --sku FREE 30 | 31 | # create web app 32 | az webapp create ` 33 | -g $webapprgname ` 34 | --plan $webappplanname ` 35 | -n $webappname 36 | 37 | # make this SP able to publish to a web site 38 | $sampleweb = az webapp show ` 39 | --name $webappname ` 40 | -g $webapprgname | ConvertFrom-Json 41 | $sampleweb.id 42 | 43 | az role assignment create ` 44 | --role "Website Contributor" ` 45 | --assignee $sp.appId ` 46 | --scope $sampleweb.id 47 | 48 | az role assignment delete --assignee $sp.appId --role "Contributor" 49 | 50 | # enable MSI on web app (system assigned id) 51 | $sysid = az webapp identity assign ` 52 | -g $webapprgname ` 53 | -n $webappname 54 | $sysid 55 | 56 | az webapp identity show ` 57 | -n $webappname -g $webapprgname 58 | 59 | az webapp delete -n $webappname -g $webapprgname 60 | az ad sp delete --id $sp.appId 61 | 62 | az group delete -n $webapprgname --yes 63 | 64 | -------------------------------------------------------------------------------- /secure-monitor-optimize/storage/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Azure.Services.AppAuthentication; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Blob; 6 | using Microsoft.WindowsAzure.Storage.Shared; 7 | using Microsoft.WindowsAzure.Storage.Auth; 8 | 9 | namespace storage 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | runAsync().Wait(); 16 | } 17 | 18 | private static async Task runAsync() 19 | { 20 | var azureServiceTokenProvider = 21 | new AzureServiceTokenProvider(); 22 | var tokenCredential = new TokenCredential( 23 | await azureServiceTokenProvider 24 | .GetAccessTokenAsync("https://storage.azure.com/")); 25 | var storageCredentials = 26 | new StorageCredentials(tokenCredential); 27 | 28 | try 29 | { 30 | var cloudStorageAccount = new CloudStorageAccount( 31 | storageCredentials, 32 | useHttps: true, 33 | accountName: "laaz203rbacmsistg", 34 | endpointSuffix: "core.windows.net"); 35 | var cloudBlobClient = 36 | cloudStorageAccount.CreateCloudBlobClient(); 37 | 38 | var cref = cloudBlobClient 39 | .GetContainerReference("contribapp"); 40 | cref.CreateIfNotExists(); 41 | } 42 | catch (Exception ex) 43 | { 44 | System.Console.WriteLine(ex.Message); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /secure-monitor-optimize/storage/configure.ps1: -------------------------------------------------------------------------------- 1 | $location = "westus" 2 | $rgname = "rbacmsistg" 3 | $stgacct = "laaz203rbacmsistg" 4 | 5 | az group create --n $rgname -l $location 6 | 7 | az storage account create ` 8 | -g $rgname ` 9 | -n $stgacct ` 10 | -l $location ` 11 | --sku Standard_LRS 12 | 13 | $sp = az ad sp create-for-rbac ` 14 | -n LaAz203StgSp | ConvertFrom-Json 15 | 16 | az role assignment list --assignee $sp.appId 17 | 18 | az role assignment delete ` 19 | --assignee $sp.appId --role Contributor 20 | 21 | az role assignment list --assignee $sp.appId 22 | 23 | $tenantid = az account show ` 24 | --query tenantId -o tsv 25 | 26 | az login --service-principal ` 27 | --username $sp.appId ` 28 | --password $sp.password ` 29 | --tenant $tenantid 30 | 31 | az role assignment create ` 32 | --assignee $sp.appId --role Reader 33 | 34 | az login --service-principal ` 35 | --username $sp.appId ` 36 | --password $sp.password ` 37 | --tenant $tenantid 38 | 39 | az storage container list ` 40 | --account-name $stgacct 41 | 42 | # run code 43 | 44 | $stgacctid = az storage account show ` 45 | -n $stgacct --query id -o tsv 46 | $spobjid = az ad sp show ` 47 | --id $sp.appId --query objectId -o tsv 48 | $stgacctid 49 | $spobjid 50 | 51 | az login 52 | 53 | az role assignment create ` 54 | --role "Storage Account Contributor" ` 55 | --assignee-object-id $spobjid ` 56 | --scope $stgacctid 57 | 58 | az login --service-principal ` 59 | --username $sp.appId ` 60 | --password $sp.password ` 61 | --tenant $tenantid 62 | 63 | az storage container create ` 64 | --name contribcli ` 65 | --account-name $stgacct 66 | 67 | az storage container list ` 68 | --account-name $stgacct 69 | 70 | # run program 71 | 72 | az login 73 | 74 | az ad sp delete --id $sp.appId 75 | az group delete -y -n $rgname 76 | 77 | -------------------------------------------------------------------------------- /secure-monitor-optimize/storage/storage.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /storage/blobs/Blob.txt: -------------------------------------------------------------------------------- 1 | New Content -------------------------------------------------------------------------------- /storage/blobs/Blob_DOWNLOADED.txt: -------------------------------------------------------------------------------- 1 | Hello, World! -------------------------------------------------------------------------------- /storage/blobs/Blobs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Threading.Tasks; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Blob; 6 | 7 | namespace linuxacademy.az203.storage.blobs 8 | { 9 | public class Blobs 10 | { 11 | public static string _connectionString = 12 | "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=laaz203blobs;AccountKey=3A1YdQ11kVDHJZy+V6lEw4ejKmPxLyUbKf86DCpffYV+/Ctt/vdLhG4/bKvs8vmgbJZHk4PORqB48H55BQpNlw=="; 13 | public static async Task RunAsync() 14 | { 15 | var storageAccount = CloudStorageAccount 16 | .Parse(_connectionString); 17 | var cloudBlobClient = storageAccount 18 | .CreateCloudBlobClient(); 19 | 20 | var cloudBlobContainer = cloudBlobClient 21 | .GetContainerReference("mycontainer"); 22 | await cloudBlobContainer.CreateAsync(); 23 | 24 | var permissions = new BlobContainerPermissions { 25 | PublicAccess = BlobContainerPublicAccessType.Blob 26 | }; 27 | await cloudBlobContainer.SetPermissionsAsync(permissions); 28 | 29 | var localFileName = "Blob.txt"; 30 | File.WriteAllText(localFileName, "Hello, World!"); 31 | 32 | var cloudBlockBlob = cloudBlobContainer 33 | .GetBlockBlobReference(localFileName); 34 | await cloudBlockBlob.UploadFromFileAsync(localFileName); 35 | 36 | // List the blobs in the container. 37 | Console.WriteLine("Listing blobs in container."); 38 | BlobContinuationToken blobContinuationToken = null; 39 | do { 40 | var results = await cloudBlobContainer 41 | .ListBlobsSegmentedAsync(null, 42 | blobContinuationToken); 43 | blobContinuationToken = results.ContinuationToken; 44 | foreach (var item in results.Results) { 45 | Console.WriteLine(item.Uri); 46 | } 47 | } while (blobContinuationToken != null); 48 | 49 | var destinationFile = localFileName.Replace(".txt", "_DOWNLOADED.txt"); 50 | await cloudBlockBlob.DownloadToFileAsync( 51 | destinationFile, FileMode.Create); 52 | 53 | var leaseId = Guid.NewGuid().ToString(); 54 | 55 | File.WriteAllText(localFileName, "New Content"); 56 | 57 | cloudBlockBlob.AcquireLease( 58 | TimeSpan.FromSeconds(30), 59 | leaseId); 60 | 61 | try 62 | { 63 | await cloudBlockBlob.UploadFromFileAsync(localFileName); 64 | } 65 | catch (StorageException ex) 66 | { 67 | System.Console.WriteLine(ex.Message); 68 | if (ex.InnerException != null) System.Console.WriteLine(ex.InnerException.Message); 69 | } 70 | 71 | await Task.Delay(TimeSpan.FromSeconds(5)); 72 | 73 | await cloudBlockBlob.UploadFromFileAsync(localFileName); 74 | 75 | // or release it 76 | await cloudBlockBlob.ReleaseLeaseAsync( 77 | new AccessCondition() 78 | { 79 | LeaseId = leaseId 80 | }); 81 | 82 | await cloudBlobContainer.DeleteIfExistsAsync(); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /storage/blobs/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace linuxacademy.az203.storage.blobs 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Blobs.RunAsync().Wait(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /storage/blobs/blobs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /storage/blobs/config.ps1: -------------------------------------------------------------------------------- 1 | $rg = "blobs" 2 | $location = "westus" 3 | $acct = "laaz203blobs" 4 | 5 | az group create -n $rg -l $location 6 | 7 | az storage account create ` 8 | -g $rg ` 9 | -n $acct ` 10 | -l $location ` 11 | --sku Standard_LRS 12 | 13 | az storage account show-connection-string ` 14 | -n $acct ` 15 | --query "connectionString" 16 | -------------------------------------------------------------------------------- /storage/cosmosdb/config.ps1: -------------------------------------------------------------------------------- 1 | $resourceGroupName = "cosmosdb" 2 | $location = "westus" 3 | $accountName= "laaz203cosmosdb" 4 | $databaseName = "myDatabase" 5 | 6 | az group create ` 7 | -n $resourceGroupName ` 8 | -l $location 9 | 10 | # Create a SQL API Cosmos DB account with session consistency and multi-master enabled 11 | az cosmosdb create ` 12 | -g $resourceGroupName ` 13 | --name $accountName ` 14 | --kind GlobalDocumentDB ` 15 | --locations "West US=0" "North Central US=1" ` 16 | --default-consistency-level Strong ` 17 | --enable-multiple-write-locations true ` 18 | --enable-automatic-failover true 19 | 20 | # Create a database 21 | az cosmosdb database create ` 22 | -g $resourceGroupName ` 23 | --name $accountName ` 24 | --db-name $databaseName 25 | 26 | # List account keys 27 | az cosmosdb list-keys ` 28 | --name $accountName ` 29 | -g $resourceGroupName 30 | 31 | # List account connection strings 32 | az cosmosdb list-connection-strings ` 33 | --name $accountName ` 34 | -g $resourceGroupName 35 | 36 | az cosmosdb show ` 37 | --name $accountName ` 38 | -g $resourceGroupName ` 39 | --query "documentEndpoint" 40 | 41 | # Clean up 42 | az group delete -y -g $resourceGroupName 43 | -------------------------------------------------------------------------------- /storage/cosmosdb/cosmosdb.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /storage/cosmosdb/data/andersen.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "AndersenFamily", 3 | "lastName": "Andersen", 4 | "parents": [ 5 | { "firstName": "Thomas" }, 6 | { "firstName": "Mary Kay"} 7 | ], 8 | "children": [ 9 | { 10 | "firstName": "Henriette Thaulow", 11 | "gender": "female", 12 | "grade": 5, 13 | "pets": [{ "givenName": "Fluffy" }] 14 | } 15 | ], 16 | "address": { "state": "WA", "county": "King", "city": "seattle" } 17 | } -------------------------------------------------------------------------------- /storage/cosmosdb/data/wakefield.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "WakefieldFamily", 3 | "parents": [ 4 | { "familyName": "Wakefield", "givenName": "Robin" }, 5 | { "familyName": "Miller", "givenName": "Ben" } 6 | ], 7 | "children": [ 8 | { 9 | "familyName": "Merriam", 10 | "givenName": "Jesse", 11 | "gender": "female", "grade": 1, 12 | "pets": [ 13 | { "givenName": "Goofy" }, 14 | { "givenName": "Shadow" } 15 | ] 16 | }, 17 | { 18 | "familyName": "Miller", 19 | "givenName": "Lisa", 20 | "gender": "female", 21 | "grade": 8 } 22 | ], 23 | "address": { "state": "NY", "county": "Manhattan", "city": "NY" } 24 | } -------------------------------------------------------------------------------- /storage/tables/Gamer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.WindowsAzure.Storage.Table; 6 | 7 | namespace linuxacademy.az203.storage.tables 8 | { 9 | public class Gamer : TableEntity 10 | { 11 | public string Region { get { return this.PartitionKey; }} 12 | public string Email { get { return this.RowKey; }} 13 | public string Name { get; set; } 14 | public string Phone { get; set; } 15 | 16 | public Gamer() {} 17 | public Gamer(string email, string region, 18 | string name, string phone = null) 19 | { 20 | this.PartitionKey = region; 21 | this.RowKey = email; 22 | this.Name = name; 23 | this.Phone = phone; 24 | } 25 | 26 | public override string ToString() 27 | { 28 | return $"Region(pk):{Region} Email(rk):{Email} Name:{Name} Phone:{Phone}"; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /storage/tables/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace linuxacademy.az203.storage.tables 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Tables.runDemoAsync().Wait(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /storage/tables/config.ps1: -------------------------------------------------------------------------------- 1 | $rg = "tables" 2 | $location = "westus" 3 | $acct = "laaz203tables" 4 | 5 | az group create -n $rg -l $location 6 | 7 | az storage account create ` 8 | -g $rg ` 9 | -n $acct ` 10 | -l $location ` 11 | --sku Standard_LRS 12 | 13 | az storage account show-connection-string ` 14 | -n $acct ` 15 | --query "connectionString" 16 | 17 | az group delete -n $rg 18 | -------------------------------------------------------------------------------- /storage/tables/tables.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using viewer.Models; 8 | 9 | namespace viewer.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult About() 19 | { 20 | ViewData["Message"] = "Your application description page."; 21 | 22 | return View(); 23 | } 24 | 25 | public IActionResult Contact() 26 | { 27 | ViewData["Message"] = "Your contact page."; 28 | 29 | return View(); 30 | } 31 | 32 | public IActionResult Privacy() 33 | { 34 | return View(); 35 | } 36 | 37 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 38 | public IActionResult Error() 39 | { 40 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Hubs/GridEventsHub.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.SignalR; 2 | 3 | namespace viewer.Hubs 4 | { 5 | public class GridEventsHub: Hub 6 | { 7 | public GridEventsHub() 8 | { 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /thirdparty/eventgrid/Models/CloudEvent.cs: -------------------------------------------------------------------------------- 1 |  2 | using Newtonsoft.Json; 3 | 4 | namespace viewer.Models 5 | { 6 | public class CloudEvent where T : class 7 | { 8 | [JsonProperty("eventID")] 9 | public string EventId { get; set; } 10 | 11 | [JsonProperty("cloudEventsVersion")] 12 | public string CloudEventVersion { get; set; } 13 | 14 | [JsonProperty("eventType")] 15 | public string EventType { get; set; } 16 | 17 | [JsonProperty("eventTypeVersion")] 18 | public string EventTypeVersion { get; set; } 19 | 20 | [JsonProperty("source")] 21 | public string Source { get; set; } 22 | 23 | [JsonProperty("eventTime")] 24 | public string EventTime { get; set; } 25 | 26 | [JsonProperty("data")] 27 | public T Data { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace viewer.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /thirdparty/eventgrid/Models/GridEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace viewer.Models 4 | { 5 | public class GridEvent where T: class 6 | { 7 | public string Id { get; set;} 8 | public string EventType { get; set;} 9 | public string Subject {get; set;} 10 | public DateTime EventTime { get; set; } 11 | public T Data { get; set; } 12 | public string Topic { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace viewer 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using viewer.Hubs; 8 | 9 | namespace viewer 10 | { 11 | public class Startup 12 | { 13 | public Startup(IConfiguration configuration) 14 | { 15 | Configuration = configuration; 16 | } 17 | 18 | public IConfiguration Configuration { get; } 19 | 20 | // This method gets called by the runtime. Use this method to add services to the container. 21 | public void ConfigureServices(IServiceCollection services) 22 | { 23 | services.Configure(options => 24 | { 25 | // This lambda determines whether user consent for non-essential cookies is needed for a given request. 26 | options.CheckConsentNeeded = context => true; 27 | options.MinimumSameSitePolicy = SameSiteMode.None; 28 | }); 29 | 30 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); 31 | 32 | // Awwww yeah! 33 | services.AddSignalR(); 34 | } 35 | 36 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 37 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 38 | { 39 | if (env.IsDevelopment()) 40 | { 41 | app.UseDeveloperExceptionPage(); 42 | } 43 | else 44 | { 45 | app.UseExceptionHandler("/Home/Error"); 46 | app.UseHsts(); 47 | } 48 | 49 | app.UseHttpsRedirection(); 50 | app.UseStaticFiles(); 51 | app.UseCookiePolicy(); 52 | 53 | // Add SignalR hub routes 54 | app.UseSignalR(routes => 55 | { 56 | routes.MapHub("/hubs/gridevents"); 57 | }); 58 | 59 | app.UseMvc(routes => 60 | { 61 | routes.MapRoute( 62 | name: "default", 63 | template: "{controller=Home}/{action=Index}/{id?}"); 64 | }); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Azure Event Grid Viewer"; 3 | } 4 | 5 |
6 |

7 | Azure Event Grid 8 | Azure Event Grid Viewer 9 |

10 |

11 | 14 |

15 |
16 |
17 |


18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
 Event TypeSubject
27 | 28 | 46 | 47 | @section scripts { 48 | 49 | 50 | 51 | 52 | 53 | 54 | 101 | 102 | } -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 22 |

23 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 33 | 41 | } -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] 7 | 8 | 9 | 10 | 11 |
12 | @RenderBody() 13 |
14 | 15 | 16 | 17 | @RenderSection("Scripts", required: false) 18 | 19 | 20 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using viewer 2 | @using viewer.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/config.ps1: -------------------------------------------------------------------------------- 1 | $rgname = "eventgrid" 2 | $location = "westus" 3 | $stgacctname = "laaz203egsa" 4 | 5 | az group create -n $rgname -l $location 6 | 7 | az storage account create ` 8 | -n $stgacctname ` 9 | -g $rgname ` 10 | -l $location ` 11 | --sku Standard_LRS ` 12 | --kind StorageV2 13 | 14 | $stgacctkey = $(az storage account keys list ` 15 | -g $rgName ` 16 | --account-name $stgacctname ` 17 | --query "[0].value" ` 18 | --output tsv) 19 | $stgacctkey 20 | 21 | # run local web app and this in another terminal window 22 | ngrok http -host-header=localhost 5000 23 | 24 | $funcappdns = "209f0a2d.ngrok.io" 25 | $viewerendpoint = "https://$funcappdns/api/updates" 26 | 27 | $storageid = $(az storage account show ` 28 | -n $stgacctname ` 29 | -g $rgname ` 30 | --query id ` 31 | --output tsv) 32 | $storageid 33 | 34 | az eventgrid event-subscription create ` 35 | --source-resource-id $storageid ` 36 | --name storagesubscription ` 37 | --endpoint-type WebHook ` 38 | --endpoint $viewerendpoint ` 39 | --included-event-types "Microsoft.Storage.BlobCreated" ` 40 | --subject-begins-with "/blobServices/default/containers/testcontainer/" 41 | 42 | az storage container create ` 43 | --account-name $stgacctname ` 44 | --account-key $stgacctkey ` 45 | --name testcontainer 46 | 47 | touch testfile.txt 48 | az storage blob upload ` 49 | --account-name $stgacctname ` 50 | --account-key $stgacctkey ` 51 | --file testfile.txt ` 52 | --container-name testcontainer ` 53 | --name testfile.txt 54 | 55 | az storage blob delete ` 56 | --account-name $stgacctname ` 57 | --account-key $stgacctkey ` 58 | --container-name testcontainer ` 59 | --name testfile.txt 60 | 61 | az eventgrid event-subscription delete ` 62 | --resource-id $storageid ` 63 | --name storagesubscription 64 | 65 | az group delete -n $rgname --yes 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/testfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/eventgrid/testfile.txt -------------------------------------------------------------------------------- /thirdparty/eventgrid/viewer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Carousel */ 14 | .carousel-caption p { 15 | font-size: 20px; 16 | line-height: 1.4; 17 | } 18 | 19 | /* Make .svg files in the carousel display properly in older browsers */ 20 | .carousel-inner .item img[src$=".svg"] { 21 | width: 100%; 22 | } 23 | 24 | /* QR code generator */ 25 | #qrCode { 26 | margin: 15px; 27 | } 28 | 29 | /* Hide/rearrange for smaller screens */ 30 | @media screen and (max-width: 767px) { 31 | /* Hide captions */ 32 | .carousel-caption { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/eventgrid/wwwroot/favicon.ico -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/images/eventgrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/eventgrid/wwwroot/images/eventgrid.png -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your JavaScript code. 2 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/eventgrid/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /thirdparty/eventgrid/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /thirdparty/logic/bleu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxacademy/content-az203-files/a022e2012cac5a931cabaa53185f748bb7c3eea5/thirdparty/logic/bleu.jpg -------------------------------------------------------------------------------- /thirdparty/logic/setup.ps1: -------------------------------------------------------------------------------- 1 | $rgName = "logicapps" 2 | $stgAcctName = "laaz203lasa" 3 | $location = "westus" 4 | $queueName = "toarchive" 5 | $containerName = "images" 6 | 7 | az group create -n $rgName -l $location 8 | 9 | az storage account create ` 10 | -g $rgName ` 11 | -n $stgAcctName ` 12 | -l $location ` 13 | --sku Standard_LRS 14 | 15 | $key = $(az storage account keys list ` 16 | --account-name $stgAcctName ` 17 | -g $rgName ` 18 | --query "[0].value" ` 19 | --output tsv) 20 | $key 21 | 22 | az storage queue create ` 23 | --name $queueName ` 24 | --account-name $stgAcctName ` 25 | --account-key $key 26 | 27 | az storage container create ` 28 | --name $containerName ` 29 | --account-name $stgAcctName ` 30 | --account-key $key 31 | 32 | az storage blob upload ` 33 | --container-name $containerName ` 34 | --name bleu.jpg ` 35 | --file bleu.jpg ` 36 | --account-name $stgAcctName ` 37 | --account-key $key 38 | 39 | az storage message peek ` 40 | --queue-name $queueName ` 41 | --account-name $stgAcctName ` 42 | --account-key $key ` 43 | --num-messages 10 44 | 45 | az group delete --name $rgName --yes 46 | 47 | -------------------------------------------------------------------------------- /thirdparty/search/console/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "SearchServiceName": "laaz203search", 3 | "SearchServiceAdminApiKey": "EA9A5F160047538DE68FAFFF0DABB3A4", 4 | "SearchServiceQueryApiKey": "B8CA165E335D63DEC1F5D297DC682340" 5 | } -------------------------------------------------------------------------------- /thirdparty/search/console/config.ps1: -------------------------------------------------------------------------------- 1 | $rg = "search" 2 | $location = "westus" 3 | $serviceName = "laaz203search" 4 | 5 | az group create -n $rg -l $location 6 | 7 | az search service create ` 8 | --name $serviceName ` 9 | -g $rg ` 10 | --sku free 11 | 12 | az search admin-key show ` 13 | --service-name $serviceName ` 14 | -g $rg ` 15 | --query "primaryKey" 16 | 17 | az search query-key list ` 18 | --service-name $serviceName ` 19 | -g $rg ` 20 | --query "[0].key" 21 | 22 | az group delete -n $rg --yes 23 | -------------------------------------------------------------------------------- /thirdparty/search/console/search.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | PreserveNewest 14 | 15 | 16 | -------------------------------------------------------------------------------- /thirdparty/servicebus/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using Microsoft.Azure.ServiceBus; 8 | 9 | namespace linuxacademy.az203.thirparty.servicebus 10 | { 11 | class Program { 12 | static void Main(string[] args) { 13 | RunAsync().Wait(); 14 | } 15 | 16 | static async Task RunAsync() 17 | { 18 | const string serviceBusConnectionString = 19 | "Endpoint=sb://laaz203sb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=QaWhbl9Qq6JiFCSXalz3YAgeSdsoc00hAdKIxBYkvyE="; 20 | const string queueName = "testqueue"; 21 | const int delay = 2000; 22 | const int numMessageToSend = 10; 23 | 24 | var queueClient = new QueueClient( 25 | serviceBusConnectionString, 26 | queueName); 27 | 28 | // Register the function that will process messages 29 | queueClient.RegisterMessageHandler( 30 | async (message, cancellationToken) => { 31 | Console.WriteLine($"Received message: SequenceNumber:{message.SystemProperties.SequenceNumber} Body:{Encoding.UTF8.GetString(message.Body)}"); 32 | if (delay > 0) await Task.Delay(delay); 33 | await queueClient.CompleteAsync( 34 | message.SystemProperties.LockToken); 35 | }, 36 | new MessageHandlerOptions( 37 | exception => { 38 | Console.WriteLine($"Message handler encountered an exception {exception.Exception}."); 39 | var context = exception.ExceptionReceivedContext; 40 | Console.WriteLine($"- Endpoint: {context.Endpoint}"); 41 | Console.WriteLine($"- Entity Path: {context.EntityPath}"); 42 | Console.WriteLine($"- Executing Action: {context.Action}"); 43 | return Task.CompletedTask; 44 | } 45 | ) 46 | { 47 | MaxConcurrentCalls = 5, 48 | AutoComplete = false 49 | } 50 | ); 51 | 52 | for (var i = 0; i < numMessageToSend; i++) { 53 | var messageBody = $"Message {i}"; 54 | var message = new Message( 55 | Encoding.UTF8.GetBytes(messageBody)); 56 | 57 | Console.WriteLine($"Sending message: {messageBody}"); 58 | 59 | await queueClient.SendAsync(message); 60 | } 61 | 62 | Task.Delay(30000).Wait(); 63 | 64 | await queueClient.CloseAsync(); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /thirdparty/servicebus/create.ps1: -------------------------------------------------------------------------------- 1 | az group create -n servicebus -l westus 2 | 3 | az servicebus namespace create --n laaz203sb -g servicebus 4 | 5 | az servicebus namespace authorization-rule keys list ` 6 | -g servicebus ` 7 | --namespace-name laaz203sb ` 8 | --name RootManageSharedAccessKey ` 9 | --query primaryConnectionString 10 | 11 | az servicebus queue create ` 12 | --namespace-name laaz203sb ` 13 | -g servicebus ` 14 | -n testqueue 15 | 16 | New-AzureRmServiceBusQueue ` 17 | -ResourceGroupName servicebus ` 18 | -NamespaceName laaz203sb ` 19 | -name testqueue ` 20 | -EnablePartitioning $false -------------------------------------------------------------------------------- /thirdparty/servicebus/sb.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.2 6 | 7 | 8 | 9 | 10 | 11 | --------------------------------------------------------------------------------