Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en" class="bg">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="stylesheet.css">
<link rel="icon" type="image/x-icon" href="MSicon.png">
<title>MicroHack Demo Page</title>
</head>

<body>
<div class="topnav">
<div class="logo">
<a href="#home"><img src="MSLogo.png"></a>
</div>
<div class="menu">
<a href="https://github.com/microsoft/MicroHack" target="_blank" rel="noopener noreferrer"><img src="GitHub_Logo.png"></a>
</div>
</div>


<div class="center">
<div>
<h1 class="heading">MicroHack<br>Demo Page</h1>
<h2 class="heading2">Current Hostname: <HOSTNAME></h2>

</div>
</div>

<div class="footer">
&copy Microsoft 2024
</div>

</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
body, html {
height: 100%;
margin: 0;
padding: 0;
}

.bg {
background-image: linear-gradient(-70deg, #0976D5, #9E3DB0, #6F3F95, #2C4470);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
background-attachment: fixed;
}

.footer {
height: 50px; /* Adjust the height as needed */
width: 100%;
background-color: #f2f2f2;
overflow: hidden;
z-index: 1;
position: absolute;
bottom: 0;
text-align: center;
}

.topnav {
background-color: white;
overflow: hidden;
z-index: 1;
position: fixed;
width: 100%;
top: 0
}

.topnav .logo {
float: left;
padding: 25px;
}

.topnav .menu {
float: right;
padding: 25px;
}

img {
max-height: 30px;
width: auto;
object-fit:contain;
background-color: white;
vertical-align:middle
}

img:hover {
background-color: #ddd;
color: black;
}

.heading {
font-size: 80px;
}

.heading2 {
font-size: 40px;
font-weight: bold;
}

.heading, .heading2 {
color: white;
opacity: 90%;
font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
}

.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
padding: 20px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Setting Variables
$pathToRepo = "https://raw.githubusercontent.com/microsoft/MicroHack/main/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/resources/demopage"
$pathToIndex = "C:\inetpub\wwwroot\index.html"
$replaceText = "<HOSTNAME>"
$hostname = $env:computername

# Remove Default contents of wwwroot
Remove-Item -Path "C:\inetpub\wwwroot\*.*"

# Download files from repository
Invoke-WebRequest -Uri "$pathToRepo/index.html" -OutFile C:\inetpub\wwwroot\index.html
Invoke-WebRequest -Uri "$pathToRepo/GitHub_Logo.png" -OutFile C:\inetpub\wwwroot\GitHub_Logo.png
Invoke-WebRequest -Uri "$pathToRepo/MSLogo.png" -OutFile C:\inetpub\wwwroot\MSLogo.png
Invoke-WebRequest -Uri "$pathToRepo/MSicon.png" -OutFile C:\inetpub\wwwroot\MSicon.png
Invoke-WebRequest -Uri "$pathToRepo/github-mark.png" -OutFile C:\inetpub\wwwroot\github-mark.png
Invoke-WebRequest -Uri "$pathToRepo/stylesheet.css" -OutFile C:\inetpub\wwwroot\stylesheet.css

# Replace Hostname placeholter with actual Hostname
(Get-Content -path $pathToIndex -Raw).replace($replaceText, $hostname) | Set-Content -Path $pathToIndex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ param secretsPermissions array = [
@description('GUID to be used in Password creation')
param guidValue string = newGuid()

param deploymentScriptUrl string = 'https://raw.githubusercontent.com/microsoft/MicroHack/main/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/resources/deploy.ps1'

// Variables
@description('Admin user variable')
var adminUsername = '${prefix}${deployment}-${userName}'
Expand Down Expand Up @@ -227,7 +229,7 @@ resource vm1 'Microsoft.Compute/virtualMachines@2022-03-01' = {
vmSize: 'Standard_D2s_v5'
}
osProfile: {
computerName: vm1Name
computerName: 'fe1'
adminUsername: adminUsername
adminPassword: adminPassword
}
Expand Down Expand Up @@ -272,7 +274,8 @@ resource vm1Extension 'Microsoft.Compute/virtualMachines/extensions@2022-03-01'
typeHandlerVersion: '1.10'
autoUpgradeMinorVersion: true
settings: {
commandToExecute: 'powershell -ExecutionPolicy Unrestricted Add-WindowsFeature Web-Server -IncludeManagementTools; powershell -ExecutionPolicy Unrestricted Add-Content -Path "C:\\inetpub\\wwwroot\\Default.htm" -Value $($env:computername)'
commandToExecute: 'powershell -ExecutionPolicy Unrestricted Add-WindowsFeature Web-Server -IncludeManagementTools; powershell -ExecutionPolicy Unrestricted -File deploy.ps1'
fileUris: [deploymentScriptUrl]
}
protectedSettings: {
}
Expand Down Expand Up @@ -322,7 +325,7 @@ resource vm2 'Microsoft.Compute/virtualMachines@2022-03-01' = {
vmSize: 'Standard_D2s_v5'
}
osProfile: {
computerName: vm2Name
computerName: 'fe2'
adminUsername: adminUsername
adminPassword: adminPassword
}
Expand Down Expand Up @@ -368,7 +371,8 @@ resource vm2Extension 'Microsoft.Compute/virtualMachines/extensions@2022-03-01'
typeHandlerVersion: '1.10'
autoUpgradeMinorVersion: true
settings: {
commandToExecute: 'powershell -ExecutionPolicy Unrestricted Add-WindowsFeature Web-Server -IncludeManagementTools; powershell -ExecutionPolicy Unrestricted Add-Content -Path "C:\\inetpub\\wwwroot\\Default.htm" -Value $($env:computername)'
commandToExecute: 'powershell -ExecutionPolicy Unrestricted Add-WindowsFeature Web-Server -IncludeManagementTools; powershell -ExecutionPolicy Unrestricted -File deploy.ps1'
fileUris: [deploymentScriptUrl]
}
protectedSettings: {
}
Expand Down