Hello,
Today, I am excited to share my recent journey into the world of Azure, where I carried out the creation of an Azure Virtual Network and an IIS Server to host a website. In this journey, I realized the immense power of Azure PowerShell, a tool that not only simplifies complex configurations but also makes it easy to control exactly what you want to deploy.
The Advantage of Azure PowerShell: Azure PowerShell stands as a powerful command-line interface, transforming the management of Azure resources. Its strength lies in its ability to automate tasks and offer a consistent approach, making it useful for network configuration, among other things. This is especially noticeable if you have been continuously configuring services using the GUI and then shift on to using Powershell.
Project Overview: Setting Up an Azure Virtual Network and IIS Server My goal was to establish a complete environment in Azure, which saw the creation of an Azure Virtual Network and an IIS Server to facilitate website hosting. Let’s delve into the technical aspects, keeping things straightforward.
Project Execution: Step-by-Step Progress To begin, I employed a series of PowerShell commands to lay the groundwork. I initiated by crafting a ‘Resource Group’ named ‘RG03’ and pinpointing its location as ‘Southeast Asia’. The next steps revolved around configuring ‘Subnets’ for both front-end (‘fesubnet’) and back-end (‘besubnet’) purposes within the ‘Azure Virtual Network’ named ‘Vnet03’. The back-end subnet was created solely for the purpose of deploying the Azure Firewall which I had set up later on.
Powershell:
$rgName = 'RG03'
$location = 'southeast asia'
New-AzResourceGroup -Name $rgName -Location $location
$fesubnet = New-AzVirtualNetworkSubnetConfig -Name 'subnet1' -AddressPrefix '192.168.10.0/26'
$besubnet = New-AzVirtualNetworkSubnetConfig -Name 'AzureFirewallSubnet' -AddressPrefix '192.168.10.128/26'
$vnet = New-AzVirtualNetwork -ResourceGroupName $rgName -Name 'Vnet03' -AddressPrefix '192.168.10.0/24' -Location $location -Subnet $fesubnet, $besubnet
With the foundation set, I ventured into Azure Virtual Machine which will host the website and configuring the IIS Server through PowerShell.
Powershell:
New-AzVm `
-ResourceGroupName "RG03" `
-Name "Webserver" `
-Location "Southeast Asia" `
-VirtualNetworkName "Vnet03" `
-SubnetName "subnet1" `
-PublicIpAddressName "vm1pubip" `
-OpenPorts 3389, 80, 443 `
-Image "Win2012R2Datacenter" `
-Size "Standard_DS1"
This PowerShell script uses the New-AzVm
command to create a new Azure virtual machine named “Webserver”. It specifies the resource group, location, virtual network, subnet, public IP address, open ports, image, and size for the virtual machine. The following code involved the installation of the ‘Web-Server’ feature alongside management tools.
Powershell:
Install-WindowsFeature -name Web-Server -IncludeManagementTools
As the project progressed, I took the time to configure the Azure Firewall and Routing Table using a graphical user interface, increasing network security and routing efficiency.
Other Key Insights Gained:
- Virtual Network Dynamics: Azure’s ‘Vnet03’ featuring distinct ‘Subnets’ created an organized ecosystem for streamlined data flow and specialized functionality.
- Visualizing the Network: Through Network Watcher, I gained valuable insights into the network layout, akin to visualizing a network blueprint.
- Remote Accessibility: Leveraging the Firewall Public IP, controlled remote access to the network was established, ensuring secure interactions from remote locations.
- Hosting Websites: The integration of the IIS Server enabled me to effectively host websites within the environment, establishing a prominent online presence.
- Network Device Insight: Monitoring connected devices within the Virtual Network provided invaluable insights into network activity.
Why Azure PowerShell Triumphs Over GUI: Azure PowerShell provides a centralized command-line platform that provides the capability to automate routine tasks. This not only makes sure of consistency, but also allows me to script configurations for future use, increasing efficiency and precision.
In Conclusion: A Glimpse into the Future In a nutshell, my journey through Azure PowerShell was a revelation. It showcased the potential of automation, consistency, and enhanced control, paving the way for more streamlined and effective project executions.
Stay tuned for further insights and technical explorations on my platform – mustafacs.tech – as I continue my deep dive into the dynamic realm of technology.