A resource group is a logical container that will be throughout the rest of this workshop.
- Login to the Azure Portal with your company email address.
- Click on "Cloud Shell" Icon at the top right of the Azure portal
- Select PowerShell as your default language.
- Select a subscription to store cloud shell data (less than 5 MB of data will be stored).
- After a few seconds Cloud Shell will initialize.
- Click into Cloud Shell and enter the command:
az group create --name RG-<yourname> --location central-us
and hit enter
- The command will return json if sucessfull ###Verify Resource Group Creation
- On the left menu bar click the
Resource Groups
button and search for your Resource Group
A Virtual Machine is the core resource of Infrastructure as a Service (IaaS). Let's create a Windows Server VM using the Azure Portal. You could also do this using Cloud Shell code here or ARM Template.
- Click on the
+ New Resource
- Search for
Windows Server
- Select
Server 2019 Datacenter
and click Create - Chose the following options:
VM Name:
VM-<yourname>
Administartor name:<yourname>
Password:This is a strong password!
Inbound ports: HTTP, HTTPS, RDP - Click
Review and Create
and thenCreate
- Click
Resource Groups
on the left, then click your Resource Group (RG-<yourname>
) - Click on the Virtual Machine (note the computer icon to the left of the VM)
- Find the VM's Publick IP
- On your laptop open Remote Desktop Connection
- Enter your VM's public IP into the "Computer" text box of the Remote Desktop Connection box
- On the username/password screen choose More Options and select "Other account"
- Login with the admin username and password you created before
- Open cloud shell
- Type in the following (Please remember to change VMName and ResourceGroupName):
Set-AzVMExtension `
-ResourceGroupName "RG-sdoshi" `
-VMName "VM-sdoshi" `
-ExtensionName "IIS" `
-Location "CentralUS" `
-Publisher Microsoft.Compute `
-ExtensionType CustomScriptExtension `
-TypeHandlerVersion 1.8 `
-SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}'
- Find the VM's public IP
- Open a new tab and go to
http://<publicip>
Firewall rules in Azure are easy to create and manage. Let's go back and block port 80 on the VM we created earlier.
- Click on Resource Groups in the left, and click on your Resource Group, then find the network security group for your VM
vm-<yourname>-nsg
- Click on Inbound Security Rules
- Click on HTTP 80 to view the rules
- Flip the rule from
ALLOW
toDENY
and click save - Now try to hit your VM's website again and it will be inaccessible.
An Azure Web App is serverless way to quickly deploy applications to the web. Let's deploy a simple, static site.
- Click
+ New Resource
and search for Web App and click create - Select the following options
Instance Name:
WA-<yourname>
Type: ASP Net 2.0 - Click on Resource Groups in the left, click your Resource Group and click on
WA-<yourname>
- Click on Deployment Center to setup content for your site
- Select External Git as your repository and click continue
- Click continue (select kude console)
- For the repository enter
https://github.com/SameerDoshi/CloudWorkshop.git
and branchmaster
- Click save
- Click Overview in the left and find the site's URL
- Open the URL in a new window
- Open CloudShell
- First grab an admin/password:
$cred = Get-Credential
- Create a new VM
New-AzVm `
-ResourceGroupName "RG-sdoshi" `
-Name "VM-sdoshi" `
-Location "Central US" `
-VirtualNetworkName "VM-sdoshi-vnet" `
-SubnetName "mySubnet" `
-SecurityGroupName "VM-sdoshi-nsg" `
-PublicIpAddressName "VM-sdoshi-pip" `
-OpenPorts 80,443,3389 `
-Credential $cred