Bird
Raised Fist0
Azurecloud~20 mins

Creating a web app in Azure - Practice Exercises

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Azure Web App Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Architecture
intermediate
2:00remaining
Choosing the right Azure App Service plan for a web app

You want to deploy a web app on Azure that needs to handle sudden traffic spikes and requires automatic scaling. Which Azure App Service plan should you choose?

AFree plan with limited CPU and memory, no auto-scaling
BBasic plan with manual scaling only
CStandard plan with auto-scaling and load balancing
DShared plan with limited resources and no SLA
Attempts:
2 left
💡 Hint

Consider plans that support automatic scaling and load balancing for traffic spikes.

❓ Configuration
intermediate
2:00remaining
Configuring environment variables for an Azure web app

You want to securely store and access a database connection string in your Azure web app without hardcoding it in your code. Where should you configure this connection string?

AIn a text file uploaded to the web app's root directory
BDirectly inside the source code as a constant string
CIn the Azure Storage Blob container
DIn the web app's Application Settings under Configuration in Azure Portal
Attempts:
2 left
💡 Hint

Think about secure and manageable ways to store sensitive configuration data in Azure.

❓ service_behavior
advanced
2:00remaining
Understanding deployment slots behavior in Azure App Service

You have two deployment slots: production and staging. You deploy a new version to staging and want to swap it with production. What happens to the app settings marked as 'slot setting' during the swap?

ASlot settings remain with their respective slots and do not swap
BSlot settings swap along with the code and content
CSlot settings are deleted during the swap
DSlot settings are merged between slots after the swap
Attempts:
2 left
💡 Hint

Consider how slot settings are designed to keep environment-specific configurations isolated.

❓ security
advanced
2:00remaining
Securing Azure web app with Managed Identity

You want your Azure web app to access an Azure SQL Database securely without storing credentials in the app code or configuration. What is the best way to achieve this?

AEnable a system-assigned Managed Identity for the web app and grant it access to the database
BStore the database username and password in Application Settings
CUse a shared access signature (SAS) token in the app code
DCreate a service principal and hardcode its credentials in the app
Attempts:
2 left
💡 Hint

Think about Azure features that allow apps to authenticate securely without secrets.

✅ Best Practice
expert
2:00remaining
Optimizing cost and performance for a global Azure web app

You have a web app serving users worldwide. You want to reduce latency and optimize costs while maintaining high availability. Which architecture should you implement?

ADeploy the web app in a single Azure region with Standard plan and use Azure CDN for static content
BDeploy multiple instances of the web app in multiple Azure regions with Traffic Manager and use auto-scaling in each region
CDeploy the web app in multiple regions but disable auto-scaling to save costs
DDeploy the web app in a single region with Premium plan and rely on Azure Front Door for global routing
Attempts:
2 left
💡 Hint

Consider global distribution, load balancing, and scaling features for performance and cost.

Practice

(1/5)
1. What is the main purpose of creating a web app in Azure?
easy
A. To create databases for applications
B. To store large amounts of data securely
C. To manage virtual machines
D. To make your website or service available online

Solution

  1. Step 1: Understand the purpose of a web app

    A web app hosts websites or services so users can access them online.
  2. Step 2: Compare options

    Options relate to storage, virtual machines, and databases, not web hosting.
  3. Final Answer:

    To make your website or service available online -> Option D
  4. Quick Check:

    Web app purpose = online availability [OK]
Hint: Web apps host websites or services online [OK]
Common Mistakes:
  • Confusing web apps with databases
  • Thinking web apps manage virtual machines
  • Assuming web apps store data only
2. Which Azure CLI command correctly creates a web app named myapp123 in resource group mygroup with plan myplan?
easy
A. az webapp create --name myapp123 --resource-group mygroup --plan myplan
B. az webapp new --app myapp123 --group mygroup --plan myplan
C. az create webapp --name myapp123 --group mygroup --plan myplan
D. az webapp deploy --name myapp123 --resource-group mygroup --plan myplan

Solution

  1. Step 1: Identify the correct Azure CLI syntax

    The correct command to create a web app is az webapp create with options --name, --resource-group, and --plan.
  2. Step 2: Check each option

    az webapp create --name myapp123 --resource-group mygroup --plan myplan matches the correct syntax. Other options use incorrect subcommands like 'new', invalid syntax such as 'az create webapp', or 'deploy' which is for deployment not creation.
  3. Final Answer:

    az webapp create --name myapp123 --resource-group mygroup --plan myplan -> Option A
  4. Quick Check:

    Correct CLI command = az webapp create --name myapp123 --resource-group mygroup --plan myplan [OK]
Hint: Use 'az webapp create' with --name, --resource-group, --plan [OK]
Common Mistakes:
  • Using 'az webapp new' instead of 'create'
  • Mixing up option names like --app or --group
  • Using 'deploy' instead of 'create'
3. What will happen if you run this command?
az webapp create --name myapp123 --resource-group mygroup --plan myplan

Assuming mygroup and myplan exist and myapp123 is unique.
medium
A. A new resource group named mygroup is created automatically
B. The command fails because the app name is not unique
C. A new web app named myapp123 is created in mygroup using myplan
D. The app service plan myplan is deleted

Solution

  1. Step 1: Understand command prerequisites

    The command creates a web app if the resource group and plan exist and the app name is unique.
  2. Step 2: Analyze the command effect

    Since all conditions are met, the web app named myapp123 is created in mygroup using myplan.
  3. Final Answer:

    A new web app named myapp123 is created in mygroup using myplan -> Option C
  4. Quick Check:

    Valid inputs create web app = A new web app named myapp123 is created in mygroup using myplan [OK]
Hint: Valid group, plan, unique name = web app created [OK]
Common Mistakes:
  • Assuming resource group auto-creation
  • Thinking app service plan is deleted
  • Believing app name uniqueness is not required
4. You run this command but get an error:
az webapp create --name myapp123 --resource-group mygroup --plan myplan

What is the most likely cause?
medium
A. The app service plan myplan does not exist
B. The app name myapp123 is already taken
C. The resource group mygroup is missing
D. The Azure CLI is not installed

Solution

  1. Step 1: Check prerequisites for the command

    The resource group and app service plan must exist before creating a web app.
  2. Step 2: Identify the most common error

    If the resource group exists but the plan does not, the command fails with an error about the plan.
  3. Final Answer:

    The app service plan myplan does not exist -> Option A
  4. Quick Check:

    Missing plan causes error = The app service plan myplan does not exist [OK]
Hint: Check if app service plan exists before creating web app [OK]
Common Mistakes:
  • Assuming resource group auto-creates
  • Ignoring app name uniqueness errors
  • Not verifying Azure CLI installation
5. You want to create a web app with a unique name myapp123 in resource group mygroup. The app service plan myplan is in the EastUS region. Which command correctly creates the web app ensuring it uses the same region?
hard
A. az webapp create --name myapp123 --resource-group mygroup --plan myplan --location EastUS
B. az webapp create --name myapp123 --resource-group mygroup --plan myplan
C. az webapp create --name myapp123 --resource-group mygroup --plan myplan --location WestUS
D. az webapp create --name myapp123 --resource-group mygroup --plan myplan --sku B1

Solution

  1. Step 1: Understand app service plan location

    The web app inherits the region from the app service plan; specifying location is not needed.
  2. Step 2: Analyze command options

    az webapp create --name myapp123 --resource-group mygroup --plan myplan uses the existing plan without location override, ensuring the web app is in EastUS. Adding --location when --plan is specified is invalid and causes errors. Adding --sku B1 is unnecessary and invalid for web app creation.
  3. Final Answer:

    az webapp create --name myapp123 --resource-group mygroup --plan myplan -> Option B
  4. Quick Check:

    Web app location = app service plan location [OK]
Hint: Web app location follows app service plan location; no need to specify [OK]
Common Mistakes:
  • Adding --location causing conflicts
  • Assuming location must be specified again
  • Changing SKU without need
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard