Managing your Azure resources using Powershell scripting

cls$ResourceGroupName = "MyWebAppGroup"
$Name = "MyWebApp"
"Stopping web application " + $Name"ResourceGroupName: " + $ResourceGroupName
"Name: " + $Name
$SubscriptionId = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
"SubscriptionId is: " + $SubscriptionId
# from the Azure AD app registration
$clientSecret = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
$azureAplicationId = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
$azureTenantId= "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
$azurePassword = ConvertTo-SecureString $clientSecret -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential($azureAplicationId , $azurePassword)
# login to Azure and set the current context
Connect-AzAccount -Credential $psCred -TenantId $azureTenantId -ServicePrincipal
Set-AzContext -Subscription $SubscriptionId
Stop-AzWebApp -ResourceGroupName $ResourceGroupName -Name $Name"Finished"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dominic Burford

A father, cyclist, vegetarian, atheist, geek and multiple award winning technical author. Loves real ale, fine wine and good music. All round decent chap.