Tasks 1 and 2: Create a Resource Group using the Portal
GOAL: To create a resource group called“MOD02STOR“ in the“East US” region using the Azure portal
Azure Portal → Create a resource → Resource Group → Create → Create
Name: MOD02STOR
Location: East US
Task 3: Create a Resource Group using the Cloud Shell and Azure CLI
GOAL: To explore Azure CLI in the Azure Cloud Shell and to use it create a Resource Group called“MOD02APPS“ in the“East US” region
Browse to “shell.azure.com” → Bash → Create storage account
[code language=”bash”]
az –help
# we have groups and subgroups
# subgroups includes different azure resources, services or components
az group –help
# shows the actions/commands that we can perform on this subgroup
az group create –help
# shows the different arguments, global arguments and examples
az group list –help
az group list
az group create –name MOD02APPS –location eastus
az group list
[/code]
Exercise 2: Deploy a Minimal Template
Task 1: Deploy a Storage Account ARM Template
GOAL: To deploy a randomly named Storage Account to the existing“MOD02STOR“ resource group using an ARM Template
Azure Portal → Create a resource → Template deployment → Create → Build your own template in the editor → Paste content below → Save → Agree to terms → Purchase
GOAL: To review the deployment details of the Azure ARM template using the Azure portal
Azure Portal → Resource groups →“MOD02STOR” → Settings → Deployments → Click on“Microsoft.Template” deployment → Click“Operation details” next to the deployment
Exercise 3: Deploy a Simple Template
Task 1: View ARM Template
GOAL: To review an ARM Template that is located on our lab VM(F:\Mod02\Labfiles\Starter\deploy.json)
Lab VM → This PC → F:\Mod02\Labfiles\Starter\deploy.json → Open with Code(CNTR+ to zoom in)
Task 2: Deploy App Service ARM Template
GOAL: To deploy an Azure function App(in an App Service Plan) using the ARM template that we reviewed earlier to the existing“MOD02APPS“ resource group using the Azure portal
Azure Functions runs in two different modes: Consumption plan and Azure App Service plan. We’ll be deploying using the“Azure App Service plan” mode in this task
Three resources will be created
A storage account that will be the“web jobs” storage for our function app
An app service plan that we will deploy our Azure function app into“Microsoft.Web/serverfarms”
The function app itself(“Microsoft.Web/sites” → Kind: functionapp)
Using the plan that we created earlier
Azure Portal → Create a resource → Template deployment → Create → Build your own template in the editor → Load file → F:\Mod02\Labfiles\Starter\deploy.json → Save → Agree to terms → Purchase
Resource Group: Use Existing →“MOD02APPS”
Function App Name: Enter something unique(I recommend to add random numbers at the end E.g. dofunc020918)
View function app URL after the deployment completes
Task 3: View Deployment Metadata
GOAL: To review the deployment details of the Azure ARM template using the Azure portal
Azure Portal → Resource groups →“MOD02APPS” → Settings → Deployments → Click on“Microsoft.Template” deployment → Click“Operation details” next to the deployment
Exercise 4: Cleanup Subscription
GOAL: To delete the two resource groups(“MOD02STOR“ and“MOD02APPS“) that were created in this module
–no-wait: means don’t wait at the shell for the delete operation to finish. Start the action and allow us to move on
–yes: means to not be prompted for confirmation
[code language=”bash”]
az group delete –help
# shows the arguments that we can use when deleting a resource group
az group delete –name MOD02STOR –no-wait –yes
az group delete –name MOD02APPS –no-wait –yes
[/code]