Skip to content
HackerRank Launches Two New Products: SkillUp and Engage Read now
Join us at the AI Skills & Tech Talent Summit in London! Register now
The 2024 Developer Skills Report is here! Read now
Stream HackerRank AI Day, featuring new innovations and industry thought leaders. Watch now
Career Growth

6 Azure Interview Questions Every Developer Should Know

Written By April Bohnert | August 30, 2023

Abstract, futuristic image generated by AI

Cloud technology is far more than just an industry buzzword these days; it’s the backbone of modern IT infrastructures. And among the crowded field of cloud service providers, a handful of tech companies have emerged as key players. Microsoft’s Azure, with its enormous range of services and capabilities, has solidified its position in this global market, rivaling giants like AWS and Google Cloud and quickly becoming a favorite among both businesses and developers at the forefront of cloud-based innovation. 

As Azure continues to expand its footprint across industries, the demand for professionals proficient in its ecosystem is growing too. As a result, interviews that dive deep into Azure skills are becoming more common — and for a good reason. These interviews don’t just test a candidate’s knowledge; they probe for hands-on experience and the ability to leverage Azure’s powerful features in real-world scenarios.

Whether you’re a developer eyeing a role in this domain or a recruiter seeking to better understand the technical nuances of Azure, it can be helpful to delve into questions that capture the essence of Azure’s capabilities and potential challenges. In this guide, we unravel what Azure really is, the foundations of an Azure interview, and of course, a curated set of coding questions that every Azure aficionado should be prepared to tackle.

What is Azure?

Azure is Microsoft’s answer to cloud computing — but it’s also much more than that. It’s a vast universe of interconnected services and tools designed to meet a myriad of IT needs, from the basic to the complex.

More than just a platform, Azure offers Infrastructure-as-a-Service (IaaS), providing essential resources like virtual machines and networking. It delves into Platform-as-a-Service (PaaS), where services such as Azure App Service or Azure Functions let you deploy applications without getting bogged down by infrastructure concerns. And it has software-as-a-Service (SaaS) offerings like Office 365 and Dynamics 365.

Yet, Azure’s capabilities don’t end with these three service models. It boasts specialized services for cutting-edge technologies like IoT, AI, and machine learning. From building an intelligent bot to managing a fleet of IoT devices, Azure has tools and services tailor-made for these ventures.

What an Azure Interview Looks Like

An interview focused on Azure isn’t just a test of your cloud knowledge; it’s an exploration of your expertise in harnessing the myriad services and tools that Azure offers. Given the platform’s vast expanse, the interview could span a range of topics. It could probe your understanding of deploying and configuring resources using the Azure CLI or ARM templates. Or it might assess your familiarity with storage solutions like Blob, Table, Queue, and the more recent Cosmos DB. Networking in Azure, with its virtual networks, VPNs, and Traffic Manager, is another crucial area that interviewers often touch upon. And with the increasing emphasis on real-time data and AI, expect a deep dive into Azure’s data and AI services, like machine learning or Stream Analytics.

While the nature of questions can vary widely based on the specific role, there are some common threads. Interviewers often look for hands-on experience, problem-solving ability, and a sound understanding of best practices and architectural designs within the Azure ecosystem. For instance, if you’re aiming for a role like an Azure solutions architect, expect scenarios that challenge your skills in designing scalable, resilient, and secure solutions on Azure. On the other hand, Azure DevOps engineers might find themselves solving automation puzzles, ensuring smooth CI/CD pipelines, or optimizing infrastructure as code.

But it’s not all technical! Given that Azure is often pivotal in business solutions, you might also be tested on your ability to align Azure’s capabilities with business goals, cost management, or even disaster recovery strategies.

1. Deploy a Web App Using Azure CLI

The Azure command-line interface (CLI) is an essential tool for developers and administrators to manage Azure resources. This question tests a candidate’s proficiency with Azure CLI commands, specifically focusing on deploying web applications to Azure.

Task: Write an Azure CLI script to deploy a simple web app using Azure App Service. The script should create the necessary resources, deploy a sample HTML file, and return the public URL of the web app.

Input Format: The script should accept the following parameters:

  • Resource group name
  • Location (e.g., “East U.S.”)
  • App service plan name
  • Web app name


  • The web app should be hosted on a free tier App Service plan.
  • The HTML file to be deployed should simply display “Hello Azure!”

Output Format: The script should print the public URL of the deployed web app.

Sample Code:


# Parameters





# Create a resource group

az group create --name $resourceGroupName --location $location

# Create an App Service plan on Free tier

az appservice plan create --name $appServicePlanName --resource-group $resourceGroupName --sku F1 --is-linux

# Create a web app

az webapp create --name $webAppName --resource-group $resourceGroupName --plan $appServicePlanName --runtime "NODE|14-lts"

# Deploy sample HTML file

echo "<html><body><h1>Hello Azure!</h1></body></html>" > index.html

az webapp up --resource-group $resourceGroupName --name $webAppName --html

# Print the public URL

echo "Web app deployed at: https://$"


The script begins by creating a resource group using the provided name and location. It then creates an App Service plan on the free tier. Subsequently, a web app is created using Node.js as its runtime (although we’re deploying an HTML file, the runtime is still needed). A sample HTML file is then generated on the fly with the content “Hello Azure!” and deployed to the web app using `az webapp up`. Finally, the public URL of the deployed app is printed.

2. Configure Azure Blob Storage and Upload a File

Azure Blob Storage is a vital service in the Azure ecosystem, allowing users to store vast amounts of unstructured data. This question examines a developer’s understanding of Blob Storage and their proficiency in interacting with it programmatically.

Task: Write a Python script using Azure SDK to create a container in Azure Blob Storage, and then upload a file to this container.

Input Format: The script should accept the following parameters:

  • Connection string
  • Container name
  • File path (of the file to be uploaded)


  • Ensure the container’s access level is set to “Blob” (meaning the blobs/files can be accessed, but not the container’s metadata or file listing).
  • Handle potential exceptions gracefully, like invalid connection strings or file paths.

Output Format: The script should print the URL of the uploaded blob.

Sample Code:

from import BlobServiceClient, BlobClient, ContainerClient

def upload_to_blob(connection_string, container_name, file_path):

        # Create the BlobServiceClient

        blob_service_client = BlobServiceClient.from_connection_string(connection_string)

        # Create or get container

        container_client = blob_service_client.get_container_client(container_name)

        if not container_client.exists():

            blob_service_client.create_container(container_name, public_access='blob')

        # Upload file to blob

        blob_client = blob_service_client.get_blob_client(container=container_name, blob=file_path.split('/')[-1])

        with open(file_path, "rb") as data:


        print(f"File uploaded to: {blob_client.url}")     

    except Exception as e:

        print(f"An error occurred: {e}")
# Sample Usage

# upload_to_blob('<Your Connection String>', 'sample-container', 'path/to/file.txt')


The script uses the Azure SDK for Python. After establishing a connection with the Blob service using the provided connection string, it checks if the specified container exists. If not, it creates one with the access level set to “Blob.” The file specified in the `file_path` is then read as binary data and uploaded to the blob storage. Once the upload is successful, the URL of the blob is printed. Any exceptions encountered during these operations are caught and printed to inform the user of potential issues.

Explore verified tech roles & skills.

The definitive directory of tech roles, backed by machine learning and skills intelligence.

Explore all roles

3. Azure Functions: HTTP Trigger with Cosmos DB Integration

Azure Functions, known for its serverless compute capabilities, allows developers to run code in response to specific events. Cosmos DB, on the other hand, is a multi-model database service for large-scale applications. This question assesses a developer’s ability to create an Azure Function triggered by an HTTP request and integrate it with Cosmos DB.

Task: Write an Azure Function that’s triggered by an HTTP GET request. The function should retrieve a document from an Azure Cosmos DB based on a provided ID and return the document as a JSON response.

Input Format: The function should accept an HTTP GET request with a query parameter named `docId`, representing the ID of the desired document.

Output Format: The function should return the requested document in JSON format or an error message if the document isn’t found.


  • Use the Azure Functions 3.x runtime.
  • The Cosmos DB has a database named `MyDatabase` and a container named `MyContainer`.
  • Handle exceptions gracefully, ensuring proper HTTP response codes and messages.

Sample Code:

using System.IO;

using Microsoft.AspNetCore.Mvc;

using Microsoft.Azure.WebJobs;

using Microsoft.Azure.WebJobs.Extensions.Http;

using Microsoft.AspNetCore.Http;

using Microsoft.Extensions.Logging;

using Newtonsoft.Json;

using Microsoft.Azure.Documents.Client;

using Microsoft.Azure.Documents.Linq;

using System.Linq;

public static class GetDocumentFunction



    public static IActionResult Run(

        [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,


            databaseName: "MyDatabase",

            collectionName: "MyContainer",

            ConnectionStringSetting = "AzureWebJobsCosmosDBConnectionString",

            Id = "{Query.docId}")] dynamic document,

        ILogger log)


        log.LogInformation("C# HTTP trigger function processed a request.");

        if (document == null)


            return new NotFoundObjectResult("Document not found.");


        return new OkObjectResult(document);


This Azure Function uses the Azure Functions 3.x runtime and is written in C#. It’s triggered by an HTTP GET request. The function leverages the CosmosDB binding to fetch a document from Cosmos DB using the provided `docId` query parameter. If the document exists, it’s returned as a JSON response. Otherwise, a 404 Not Found response is returned with an appropriate error message.

Note: This code assumes the Cosmos DB connection string is stored in an application setting named “AzureWebJobsCosmosDBConnectionString.”

4. Azure Virtual Machine: Automate VM Setup with Azure SDK for Python**

Azure Virtual Machines (VMs) are a fundamental building block in the Azure ecosystem. It’s crucial for developers to know how to automate VM creation and setup to streamline operations and ensure standardized configurations. This question assesses a developer’s understanding of the Azure SDK for Python and their ability to automate VM provisioning.

Task: Write a Python script using the Azure SDK to create a new virtual machine. The VM should run Ubuntu Server 18.04 LTS, and once set up, it should automatically install Docker.

Input Format: The script should accept the following parameters:

  • Resource group name
  • VM name
  • Location (e.g., “East U.S.”)
  • Azure subscription ID
  • Client ID (for Azure service principal)
  • Client secret (for Azure service principal)
  • Tenant ID (for Azure service principal)


  • Ensure the VM is of size `Standard_DS1_v2`.
  • Set up the VM to use SSH key authentication.
  • Assume the SSH public key is located at `~/.ssh/`.
  • Handle exceptions gracefully.

Output Format: The script should print the public IP address of the created VM.

Sample Code:

from azure.identity import ClientSecretCredential

from azure.mgmt.compute import ComputeManagementClient

from import NetworkManagementClient

from azure.mgmt.resource import ResourceManagementClient

def create_vm_with_docker(resource_group, vm_name, location, subscription_id, client_id, client_secret, tenant_id):

    # Authenticate using service principal

    credential = ClientSecretCredential(client_id=client_id, client_secret=client_secret, tenant_id=tenant_id)

    # Initialize management clients

    resource_client = ResourceManagementClient(credential, subscription_id)

    compute_client = ComputeManagementClient(credential, subscription_id)

    network_client = NetworkManagementClient(credential, subscription_id)

    # Assuming network setup, storage, etc. are in place

    # Fetch SSH public key

    with open("~/.ssh/", "r") as f:

        ssh_key =

    # Define the VM parameters, including post-deployment script to install Docker

    vm_parameters = {

        #... (various VM parameters like size, OS type, etc.)

        'osProfile': {

            'computerName': vm_name,

            'adminUsername': 'azureuser',

            'linuxConfiguration': {

                'disablePasswordAuthentication': True,

                'ssh': {

                    'publicKeys': [{

                        'path': '/home/azureuser/.ssh/authorized_keys',

                        'keyData': ssh_key




            'customData': "IyEvYmluL2Jhc2gKc3VkbyBhcHQtZ2V0IHVwZGF0ZSAmJiBzdWRvIGFwdC1nZXQgaW5zdGFsbCAt

            eSBkb2NrZXIuY2U="  # This is base64 encoded script for "sudo apt-get update && sudo apt-get install -y docker.ce"



    # Create VM

    creation_poller = compute_client.virtual_machines.create_or_update(resource_group, vm_name, vm_parameters)


    # Print the public IP address (assuming IP is already allocated)

    public_ip = network_client.public_ip_addresses.get(resource_group, f"{vm_name}-ip")

    print(f"Virtual Machine available at: {public_ip.ip_address}")

# Sample Usage (with parameters replaced appropriately)

# create_vm_with_docker(...)


The script begins by establishing authentication using the provided service principal credentials. It initializes management clients for resource, compute, and networking operations. After setting up networking and storage (which are assumed to be in place for brevity), the VM is defined with the necessary parameters. The post-deployment script installs Docker on the VM upon its first boot. Once the VM is created, its public IP address is printed.

Note: The Docker installation script is base64 encoded for brevity. In real use cases, you might use cloud-init or other provisioning tools for more complex setups.

5. Azure SQL Database: Data Migration and Querying

Azure SQL Database is a fully managed relational cloud database service for developers. The integration between applications and data becomes crucial, especially when migrating data or optimizing application performance through SQL queries.

Task: Write a Python script that does the following:

  1. Connects to an Azure SQL Database using provided connection details
  2. Migrates data from a CSV file into a table in the Azure SQL Database
  3. Runs a query on the table to fetch data based on specific criteria

Input Format: The script should accept command line arguments in the following order:

  • Connection string for the Azure SQL Database
  • Path to the CSV file
  • The query to run on the table


  • The CSV file will have headers that match the column names of the target table.
  • Handle exceptions gracefully, such as failed database connections, invalid SQL statements, or CSV parsing errors.

Output Format: The script should print:

  • A success message after data has been migrated
  • The results of the SQL query in a readable format

Sample Code:

import pyodbc

import csv

import sys

def migrate_and_query_data(conn_string, csv_path, sql_query):


        # Connect to Azure SQL Database

        conn = pyodbc.connect(conn_string)

        cursor = conn.cursor()

        # Migrate CSV data

        with open(csv_path, 'r') as file:

            reader = csv.DictReader(file)

            for row in reader:

                columns = ', '.join(row.keys())

                placeholders = ', '.join('?' for _ in row)

                query = f"INSERT INTO target_table ({columns}) VALUES ({placeholders})"

                cursor.execute(query, list(row.values()))

        print("Data migration successful!")

        # Execute SQL query and display results


        for row in cursor.fetchall():



    except pyodbc.Error as e:

        print(f"Database error: {e}")

    except Exception as e:

        print(f"An error occurred: {e}")

# Sample usage (with parameters replaced appropriately)

# migrate_and_query_data(sys.argv[1], sys.argv[2], sys.argv[3])


This script utilizes the `pyodbc` library to interact with Azure SQL Database. The script starts by establishing a connection to the database and then iterates through the CSV rows to insert them into the target table. After the data migration, it runs the provided SQL query and displays the results. The script ensures that database-related errors, as well as other exceptions, are captured and presented to the user.

Note: Before running this, you’d need to install the necessary Python packages, such as `pyodbc` and ensure the right drivers for Azure SQL Database are in place.

6. Azure Logic Apps with ARM Templates: Automated Data Sync

Azure Logic Apps provide a powerful serverless framework to integrate services and automate workflows. While the Azure Portal offers a user-friendly visual designer, in professional settings, especially with DevOps and CI/CD pipelines, there’s often a need to define these workflows in a more programmatic way. Enter ARM (Azure Resource Manager) templates: a declarative syntax to describe resources and configurations, ensuring idempotent deployments across environments.

Task: Taking it up a notch from the visual designer, your challenge is to implement an Azure Logic App that automates the process of syncing data between two Azure Table Storage accounts using an ARM template. This will test both your familiarity with the Logic Apps service and your ability to translate a workflow into an ARM template.


  • Source Azure Table Storage connection details
  • Destination Azure Table Storage connection details


  • Your ARM template should define the Logic App, its trigger, actions, and any associated resources like connectors.
  • The Logic App should be triggered whenever a new row is added to the source Azure Table Storage.
  • Newly added rows should be replicated to the destination Azure Table Storage without any data loss or duplication.
  • Any failures in data transfer should be logged appropriately.

Sample ARM Template (simplified for brevity):


    "$schema": "",

    "contentVersion": "",

    "resources": [


            "type": "Microsoft.Logic/workflows",

            "apiVersion": "2017-07-01",

            "name": "SyncAzureTablesLogicApp",

            "location": "[resourceGroup().location]",

            "properties": {

                "definition": {

                    "$schema": "...",

                    "contentVersion": "...",

                    "triggers": {

                        "When_item_is_added": {

                            "type": "ApiConnection",




                    "actions": {

                        "Add_item_to_destination": {

                            "type": "ApiConnection",





                "parameters": { ... }




    "outputs": { ... }



Using ARM templates to define Azure Logic Apps provides a programmatic and version-controllable approach to designing cloud workflows. The provided ARM template is a basic structure, defining a Logic App resource and its corresponding trigger and action for syncing data between two Azure Table Storage accounts. While the ARM template in this question is simplified, a proficient Azure developer should be able to flesh out the necessary details.

To implement the full solution, candidates would need to detail the trigger for detecting new rows in the source table, the action for adding rows to the destination table, and the error-handling logic.

Resources to Improve Azure Knowledge

This article was written with the help of AI. Can you tell which parts?

Abstract, futuristic image generated by AI

What Is Terraform? Redefining Infrastructure Management in the Cloud