Category Archives: Azure

Azure: Deploy a WebApp with PowerShell

A quick runthrough on using PowerShell to deploy a new WebApp. ASP.NET code for the website has been zipped up (into myapp.zip) and this code snippet will upload it to a new WebApp, hosted in a new App Service Plan and a new Resource Group.

From a local PowerShell session use Connect-AZAccount before running this code to sign-in to Azure. Alternatively this code can be run (with the exception of the upload itself) from the Cloud Shell directly in the Azure Portal.

The code also writes out the URL of the resulting WebApp and the PowerShell necessary to tear down the resources when they are no longer required.

#Set some parameters
$location="UK South"
$resourceGroupName= “rsg-myapp”
$webAppName=”web-myapp”
$appServicePlanName=”asp-myapp”
$codeZIPPath=”C:\myapp.zip”

#Create Resource Group
"-- Creating Resource Group"
New-AzResourceGroup -Location $location -Name $resourceGroupName -tag $Tags

#Create ServicePlan
"-- Creating Service Plan"
New-AzAppServicePlan -ResourceGroupName $resourceGroupName -Name $appServicePlanName -Location $location -Tier Free

#Create Web App
"-- Creating Web App"
New-AzWebApp -ResourceGroupName $resourceGroupName -Name $webAppName -Location $location -AppServicePlan $appServicePlanName

#Upload the web code
"-- Uploading Web App Code"
Publish-AzWebApp -ResourceGroupName $resourceGroupName -Name $webAppName -ArchivePath $codeZIPPath –Force

#Show user code to destroy this (useful for testing)
#  and the website that has been created.
"-- Tidy Up Code: "
" Remove-AzResourceGroup -Name $resourceGroupName"
"-- Website: "
"-- https://$WebAppName.azurewebsites.net"

"-- Done"

The resulting website can be viewed just by pointing a browser at the given URL. The created resources can be checked in the Azure portal:

image

Microsoft Azure Fundamentals

Earlier this week I took and passed the Microsoft AZ-900 exam- the requirement for the Microsoft Azure Fundamentals badge. Whilst this is the entry-level cert and not a requirement for the more advanced ones in the pathways, it is still useful for experienced techies moving into the Azure space, perhaps from other cloud platforms or on-premises architectures.

I had some prior experience dabbling in Azure, so wasn’t coming into this green. This was coupled with my general experience in server and cloud technologies so the generic concepts weren’t new to me. But I personally found working to the certification a useful way of ensuring I have a good grounding in the platform and specific terminologies before moving onto other things.

azure-fundamentals-600x600

Learning Materials

There’s plenty of material out there, including a new book, but I studied by going through the free online “Azure fundamentals” learning path from Microsoft: https://docs.microsoft.com/en-us/learn/paths/azure-fundamentals/

This is a series of articles, short videos, and mini-tests with a couple of practical exercises in the Azure Portal thrown in. It covers everything from the basics (what is cloud computing etc.) through to some of the specific Azure products which are in the exam syllabus.

I coupled this learning pathway with some further exploration and experimentation in the Azure Portal and associated documentation.

The Exam

The exam itself- once all the pre-ramble, surveys, and commenting sections are removed – is 60 minutes and my test had (IIRC) 44 questions. The first 5/6 questions were in a separate section where I couldn’t revisit them once I’d answered and moved on, but for the remainder I was able to go back and forth and review as necessary.

Question Styles

No, I’m not going to reveal what questions I was asked, but knowing the way the questions can be asked in advance is helpful. It’s been some years since I took a Microsoft exam and question styles change.

My particular test (and remember, they’re all different) had a mixture of multiple choice (sometimes just one of four answers, sometimes more than one may have been required) and drag-and-drop answers. Within the multiple choice there were also a number of questions where I was given a statement and had to replace (if necessary) the words given in bold. For example (and this is obviously not a real AZ-900 question!)

The Microsoft Solitaire game was first released with Windows 95 to help introduce the graphical user interface.

Review the text in bold. If it makes the statement correct select “No change needed”, otherwise select the answer which makes the statement correct.

  • A-No change needed
  • B-Windows 3.0
  • C-Windows Bob
  • D-OS X

Correct Answer- B

Check out the “Exam formats and question types” videos from Microsoft for more detail.

Subjects Covered

The subjects are fully covered in the “Skills Measured” section of the exam webpage and I felt there was a good match between these lists and the questions I was posed on the day.

Going into this with a firm background in the generic cloud concepts the trickiest part for me was matching up which Azure product does what and remembering the names. I’d recommend making sure you’ve remembered as many as possible of these from the core offerings- and also be prepared to spot fake product names in the multiple choice (I’m pretty sure I saw a few of these). For example (and again, not a real AZ-900 question!)

In Microsoft Windows 10, which application could you use to assign local administrator rights to an Active Directory user.

  • A-Active Directory Users and Computers
  • B-Local Users and Groups
  • C-Windows Administrator Control
  • D-Microsoft Rights Manager

Correct Answer- B. As far as I know C and D don’t exist.

Conclusion

I’m obviously happy with my pass, and I’d recommend looking at this to anyone starting out on an Azure journey, possibly from scratch or by transitioning from other technologies. The exam isn’t compulsory, but it does validate your learning- either to yourself or your employer.