Azure Developers Quickstart

Get started building and deploying applications on Microsoft Azure.

Welcome to the Azure Quickstart Guide!

This guide will walk you through the essential steps to set up your development environment and deploy your first application to Azure. We'll cover creating resources, writing code, and making it live.

Step 1: Set Up Your Azure Account and Environment

Before you begin, ensure you have an active Azure subscription. If you don't, you can sign up for a free trial.

Next, install the Azure CLI, a powerful command-line tool for managing Azure resources.

Install Azure CLI

Step 2: Log In to Azure

Open your terminal or command prompt and log in to your Azure account:

az login

This command will open a browser window for you to authenticate.

Step 3: Create a Resource Group

Resource groups are logical containers for your Azure resources. Let's create one for this project.

Replace myResourceGroup and eastus with your desired name and location.

az group create --name myResourceGroup --location eastus

Step 4: Deploy a Web App

For this quickstart, we'll deploy a simple Node.js web application. First, create a new directory for your project and navigate into it.

mkdir my-azure-app
cd my-azure-app

Now, create a simple index.js file with the following content:

const http = require('http');

const port = process.env.PORT || 3000;

const server = http.createServer((req, res) => {
    res.statusCode = 200;
    res.setHeader('Content-Type', 'text/plain');
    res.end('Hello from Azure!\n');
});

server.listen(port, () => {
    console.log(`Server running at http://localhost:${port}/`);
});

And a package.json file:

{
  "name": "my-azure-app",
  "version": "1.0.0",
  "description": "A simple Node.js app for Azure",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "dependencies": {}
}

Now, create your Azure App Service and deploy your code:

az webapp create --resource-group myResourceGroup --name my-unique-app-name --runtime "node|18-lts"
az webapp deploy --resource-group myResourceGroup --name my-unique-app-name --src-path .

Replace my-unique-app-name with a globally unique name for your web app.

Step 5: Access Your Web App

Once the deployment is complete, you can access your web app by navigating to its URL in your browser:

https://my-unique-app-name.azurewebsites.net

Congratulations! You've successfully deployed your first application to Azure.

Next Steps