Featured resource
Tech Upskilling Playbook 2025
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Learn more
  • Labs icon Lab
  • Cloud
Azure icon
Labs

Creating a Web App and Deploying Code from GitHub Using PowerShell

In this hands-on lab, you will create an Azure web app and insert configuration information into that web app using the code from a GitHub repository — all using PowerShell. PowerShell is a powerful scripting and automation engine that can be used to provision and automate a lot of tasks in Azure.

Azure icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 45m
Last updated
Clock icon Sep 02, 2025

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Log in to the Linux VM

    1. Open a new terminal.

    2. Copy the public IP address provided with this hands-on lab.

    3. In the terminal, connect to the VM:

      ssh cloud_user@<PUBLIC_IP_OF_THE_VM>
      
    4. Once logged in, start the PowerShell prompt:

      pwsh 
      
  2. Challenge

    Install the Az Module and Connect to Azure

    1. Install the module:

      Install-Module -Name Az -AllowClobber -Scope CurrentUser
      
    2. Enter Y to continue installing from the PowerShell gallery.

    3. From the PowerShell prompt, connect to Azure:

      Connect-AzAccount -UseDeviceAuthentication
      
    4. Go to https://microsoft.com/devicelogin and enter the code provided in the terminal.

    5. Enter the Azure Portal username and password provided with this hands-on lab.

  3. Challenge

    Create the Azure App Service Plan and Web App

    1. Create the following variables (replacing <UNIQUE_WEB_APP_NAME> with a globally unique name):

      $gitrepo = "https://github.com/chadmcrowell/app-service-web-dotnet-get-started.git"
      $webappname = "<UNIQUE_WEB_APP_NAME>"
      $location = "West US"
      $resourceGroup = '<RESOURCE_GROUP_PROVISIONED_WITH_LAB>'
      
    2. Create the app service plan:

      New-AzAppServicePlan -Name $webappname -Location $location -ResourceGroupName $resourceGroup -Tier Free
      
    3. Create the web app:

      New-AzWebApp -Name $webappname -Location $location -AppServicePlan $webappname -ResourceGroupName $resourceGroup
      
  4. Challenge

    Create and Apply the Configuration to the Web App

    1. Create the variable for the GitHub configuration:

      $PropertiesObject = @{
        repoUrl = "$gitrepo";
        branch = "master";
        isManualIntegration = "true";
      }
      
    2. Apply the configuration to the web app:

      Set-AzResource -PropertyObject $PropertiesObject `
        -ResourceGroupName $resourceGroup `
        -ResourceType Microsoft.Web/sites/sourcecontrols `
        -ResourceName $webappname/web `
        -ApiVersion 2015-08-01 `
        -Force
      

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.