Here's a step-by-step guide on how to create a container app with 1 replica using the Azure portal:
Prerequisites:
- You have an Azure account and are logged in to the Azure portal.
- You have Docker installed on your machine.
- You have created a Docker image that you want to run as a container.
Step 1: Create a Container Instance
- Log in to the Azure portal and navigate to the Container Instances page.
- Click on the Create Container Instance button.
- Enter a name for your container instance (e.g., "my-container-app").
- Choose the Azure Container Registry (ACR) as your registry, if you have one created already. If not, you can create one here.
- Select the Docker image you want to run (e.g.,
microsoft/mcr.microsoft.com/oss/nginx:1.17.9-alpine
).
- Set the Port to the port number that your container listens on (e.g., 80).
Step 2: Configure Container Instance Settings
- Under Instance settings, set the following:
- Replicas: 1 (since you want only one replica running)
- Cpu: Choose a value based on your application's requirements (e.g., 0.5 CPU).
- Memory: Choose a value based on your application's requirements (e.g., 1024 MB).
- Click Next: Networking.
Step 3: Configure Networking
- Under Networking, you can choose to:
- Use the Azure Load Balancer to distribute traffic across replicas.
- Allow incoming traffic from the internet (or restrict it to specific IP addresses or networks).
- Click Next: Tags.
Step 4: Add Tags (Optional)
- You can add tags to your container instance for organization and filtering purposes.
- Click Create to create the container instance.
Verification
Once the container instance is created, you can verify that it's running by:
- Going back to the Container Instances page in the Azure portal.
- Viewing the status of your container instance (e.g., "Running").
- Checking the logs for any errors or issues.
That's it! You now have a container app with 1 replica running on Azure Container Instances.
Find 2 of my best .NET 8 projects with tons of features add value to and capture your audience!
If you are interested in more of my work, you can find it:
Thank you for your time.
Kind regards, Auguste @ kiss-code.com