MSDN Documentation

Your comprehensive resource for Microsoft technologies.

Getting Started with App Services

Welcome to App Services! This guide will walk you through the essential steps to get your first application up and running on App Services.

1. Prerequisites

Before you begin, ensure you have the following:

2. Creating an App Service Plan

An App Service plan is a set of compute resources for your web app to run. You can create one using the Azure portal or Azure CLI.

Using the Azure Portal:

  1. Navigate to the Azure portal (portal.azure.com).
  2. Click Create a resource.
  3. Search for Web App and select it.
  4. Click Create.
  5. On the Basics tab, select your Subscription and Resource Group.
  6. Provide a unique Name for your App Service.
  7. Choose your preferred Runtime stack and Operating System.
  8. Select an Region close to your users.
  9. Under App Service Plan, click Create new and configure your plan details (Pricing tier, Name, Location).
  10. Click Review + create, then Create.

Using Azure CLI:


az group create --name MyResourceGroup --location "East US"
az appservice plan create --name MyFreePlan --resource-group MyResourceGroup --sku F1 --is-linux
            

This command creates a resource group named MyResourceGroup and then an App Service plan named MyFreePlan using the Free (F1) tier on Linux.

3. Creating Your Web App

Once your App Service plan is ready, you can create your web app and associate it with the plan.

Using the Azure Portal:

  1. In the Azure portal, after creating the App Service plan, you will be prompted to create a Web App.
  2. If you are creating it separately, search for Web App and click Create.
  3. Select the same Subscription and Resource Group.
  4. Provide a unique Name for your Web App.
  5. Choose your Runtime stack and Operating System.
  6. Under App Service Plan, select the plan you created earlier.
  7. Click Review + create, then Create.

Using Azure CLI:


az webapp create --resource-group MyResourceGroup --plan MyFreePlan --name MyFirstWebApp --runtime "python|3.9"
            

This command creates a web app named MyFirstWebApp in the MyResourceGroup, associated with MyFreePlan, and configured for Python 3.9.

Tip: For production environments, consider using a Standard or Premium tier for better performance, scalability, and features.

4. Deploying Your Application

App Services offers multiple deployment methods. Here are a few common ones:

a) Local Git Deployment:

You can deploy directly from a local Git repository.


# Configure Git deployment credentials if you haven't already
az webapp deployment user set --user-name your_username --password your_password

# Get the deployment URL for your app
az webapp deployment list-publishing-credentials --name MyFirstWebApp --resource-group MyResourceGroup

# Clone the app repository (example)
git clone 

# Add your code and commit
git add .
git commit -m "Initial commit"

# Push to the remote repository
git push master main
            

b) GitHub Actions / Azure DevOps Pipelines:

For continuous integration and continuous deployment (CI/CD), integrate with services like GitHub Actions or Azure DevOps.

In the Azure portal, navigate to your Web App, then go to Deployment Center and choose your preferred deployment method.

Important: Ensure your application's dependencies are correctly listed in your project's manifest file (e.g., requirements.txt for Python, package.json for Node.js).

5. Next Steps

Congratulations! You've created and deployed your first application to App Services. Here are some recommended next steps:

Learn More About Deployment Explore Networking Options