(How to configure resources in Azure using a declarative syntax with JSON and ARM)
*powershell
*learn powershell
*automation
*learn automation
*infrastucture as code
*IaC
*Azure Resource manager and powershell
*ARM and Json
*json files and Azure resource Manager
*automatic deployment
*automatic installations
*configuration as code
Code :
#connect to azure.
param(
[Parameter(Mandatory=$false)][String] $rgGroupname = "demo_rg"
)
Connect-AzAccount
$context = (Get-AzSubscription).id
Set-AzContext $context
try {
$rg = Get-AzResourceGroup -ResourceGroupName $rgGroupname -ErrorAction Stop
}
catch {
Write-Error "Could not find the resource group with name $rgGroupname, make sure it exists and try again"
exit -1
}
Set-AzDefault -ResourceGroupName $rgGroupname
$CWD = Split-Path $MyInvocation.MyCommand.Definition
$templateFile = "$CWD\part1.json"
$today = Get-Date -Format "MM-dd-yyyy-hh-mm-ss"
$deploymentName = "simpletemplate$today"
New-AzResourceGroupDeployment -Name $deploymentName -TemplateFile $templateFile
Watch video Azure JSON and ARM online, duration hours minute second in high quality that is uploaded to the channel Mr Automation 19 August 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 621 times and liked it 8 visitors.