Azure App Service for Containers

Deploy your containerized applications directly to Azure App Service for a streamlined PaaS experience.

Overview

Azure App Service provides a highly scalable, self-patching web hosting service that enables you to build, deploy, and scale your web apps, mobile back ends, and API apps. With App Service for Containers, you can deploy custom containers directly to App Service. This means you can package your application and its dependencies into a container image, and then run that image on App Service without managing the underlying infrastructure.

Key Features

Getting Started

To deploy a container to Azure App Service:

  1. Create a Dockerfile: Define your application's environment and dependencies.
  2. Build and Push Image: Build your Docker image and push it to a container registry (e.g., Azure Container Registry).
  3. Create an App Service: In the Azure portal, create a new App Service.
  4. Configure Deployment: Select "Docker Container" as the publish type and provide the details of your container image and registry.

Example Dockerfile

Here's a simple example of a Dockerfile for a Node.js application:

# Use an official Node.js runtime as a parent image
FROM node:18-alpine

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install app dependencies
RUN npm install

# Bundle app source
COPY . .

# Make port 8080 available to the world outside this container
EXPOSE 8080

# Define environment variable
ENV NODE_ENV production

# Run the app when the container launches
CMD [ "node", "server.js" ]

Deployment Options

You can deploy your containers using:

Advanced Scenarios

Explore advanced features such as using private registries, deploying multi-container applications with Docker Compose, and integrating with other Azure services.

For detailed guides and examples, please refer to the official Azure App Service documentation.