Azure Tips and Tricks - How to get started with Azure Container Apps

Published Jun 23 2022 02:57 PM 689 Views
Microsoft

How to get started with Azure Container Apps

 

 

 

A simple way to run containers in Azure

 

Containers offer a great way to develop and run applications in a consistent environment. You can develop your app in a container on your local development machine, and run that same container in production, thereby eliminating differences in infrastructure between environments. And now, you can easily run containers in Azure with Azure Container Apps. Azure Container Apps abstracts the overhead of infrastructure and orchestration, making it easy for you to deploy and run a container.

In this post, we'll deploy a sample container to Azure Container Apps.

 

Prerequisites

 

If you want to follow along, you'll need the following:

  • An Azure subscription (If you don't have an Azure subscription, create a free account before you begin)

 

Create a simple hello world container

 

We'll start by creating an Azure Container Apps resource from the Azure portal.

  1. Go to the Azure portal
  2. Click the Create a resource button (the plus-sign in the top left corner)
  3. Search for Container App, select the "Container App" result and click Create
    1. Select a Resource Group
    2. Enter a Name
    3. Click Create new for the Container App environment. This environment houses the Log Analytics Workspace that will be used for monitoring and can contain one or more Container Apps which all write to this Log Analytics Workspace
      1. Fill in an Environment name
      2. Select a Region for the environment
      3. Click the Monitoring tab
      4. Select an existing Log analytics workspace or create a new one
      5. Click Create to return to the Create Container App wizard

Create an Azure Container AppCreate an Azure Container App

  1. Click Next: App settings
  2. You can specify a container in a container registry to run in the Container App. We will use a quickstart image, so check the "Use quickstart image" checkbox. This will also set the Container App CPU and memory and network settings

Configure Azure Container App settingsConfigure Azure Container App settings

  1. Click Review + create and then Create

When the Container App is deployed, navigate to it in the Azure portal. You'll see that it has an Application URL.

 

Azure Container App in the Azure portalAzure Container App in the Azure portal

Click on the Application URL to open the sample application that is now running in the Container App.

 

The sample application running in an Azure Container AppThe sample application running in an Azure Container App

You can configure the Container App by changing the ingress settings, to enable or disable incoming traffic and the target network port. You can also configure secrets that the container can use, and setup continuous deployment with GitHub Actions to automatically build and deploy code to the Container App. Pretty cool.

 

Conclusion

 

Azure Container Apps offers an easy way to run containers in Azure with minimal configuration and management overhead. Azure does the heavy lifting for you. Create a trial account today and go and check it out!

%3CLINGO-SUB%20id%3D%22lingo-sub-3545026%22%20slang%3D%22en-US%22%3EAzure%20Tips%20and%20Tricks%20-%20How%20to%20get%20started%20with%20Azure%20Container%20Apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3545026%22%20slang%3D%22en-US%22%3E%3CH3%20id%3D%22how-to-get-started-with-azure-container-apps%22%20id%3D%22toc-hId--1320050670%22%20id%3D%22toc-hId--1320048684%22%3E%3CEM%3EHow%20to%20get%20started%20with%20Azure%20Container%20Apps%3C%2FEM%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIFRAME%20src%3D%22https%3A%2F%2Fwww.youtube-nocookie.com%2Fembed%2FQIg3NIgkARI%22%20width%3D%221076%22%20height%3D%22636%22%20frameborder%3D%220%22%20allowfullscreen%3D%22allowfullscreen%22%20title%3D%22How%20to%20get%20started%20with%20Azure%20Container%20Apps%22%20allow%3D%22accelerometer%3B%20autoplay%3B%20clipboard-write%3B%20encrypted-media%3B%20gyroscope%3B%20picture-in-picture%22%3E%3C%2FIFRAME%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--629489196%22%20id%3D%22toc-hId--629487210%22%3E%26nbsp%3B%3C%2FH4%3E%0A%3CH4%20id%3D%22a-simple-way-to-run-containers-in-azure%22%20id%3D%22toc-hId-1858023637%22%20id%3D%22toc-hId-1858025623%22%3EA%20simple%20way%20to%20run%20containers%20in%20Azure%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EContainers%20offer%20a%20great%20way%20to%20develop%20and%20run%20applications%20in%20a%20consistent%20environment.%20You%20can%20develop%20your%20app%20in%20a%20container%20on%20your%20local%20development%20machine%2C%20and%20run%20that%20same%20container%20in%20production%2C%20thereby%20eliminating%20differences%20in%20infrastructure%20between%20environments.%20And%20now%2C%20you%20can%20easily%20run%20containers%20in%20Azure%20with%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcontainer-apps%2F%3FWT.mc_id%3Ddocs-azuredevtips-azureappsdev%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Container%20Apps%3C%2FA%3E.%20Azure%20Container%20Apps%20abstracts%20the%20overhead%20of%20infrastructure%20and%20orchestration%2C%20making%20it%20easy%20for%20you%20to%20deploy%20and%20run%20a%20container.%3C%2FP%3E%0A%3CP%3EIn%20this%20post%2C%20we'll%20deploy%20a%20sample%20container%20to%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcontainer-apps%2F%3FWT.mc_id%3Ddocs-azuredevtips-azureappsdev%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Container%20Apps%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22prerequisites%22%20id%3D%22toc-hId-50569174%22%20id%3D%22toc-hId-50571160%22%3EPrerequisites%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20follow%20along%2C%20you'll%20need%20the%20following%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAn%20Azure%20subscription%20(If%20you%20don't%20have%20an%20Azure%20subscription%2C%20create%20a%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Ffree%2F%3FWT.mc_id%3Dazure-azuredevtips-azureappsdev%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Efree%20account%3C%2FA%3E%26nbsp%3Bbefore%20you%20begin)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH4%20id%3D%22toc-hId--1756885289%22%20id%3D%22toc-hId--1756883303%22%3E%26nbsp%3B%3C%2FH4%3E%0A%3CH4%20id%3D%22create-a-simple-hello-world-container%22%20id%3D%22toc-hId-730627544%22%20id%3D%22toc-hId-730629530%22%3ECreate%20a%20simple%20hello%20world%20container%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe'll%20start%20by%20creating%20an%20Azure%20Container%20Apps%20resource%20from%20the%20Azure%20portal.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EGo%20to%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fportal.azure.com%2F%3FWT.mc_id%3Dazure-azuredevtips-azureappsdev%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20nofollow%22%3EAzure%20portal%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EClick%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECreate%20a%20resource%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ebutton%20(the%20plus-sign%20in%20the%20top%20left%20corner)%3C%2FLI%3E%0A%3CLI%3ESearch%20for%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EContainer%20App%3C%2FSTRONG%3E%2C%20select%20the%20%22Container%20App%22%20result%20and%20click%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECreate%3C%2FSTRONG%3E%3COL%3E%0A%3CLI%3ESelect%20a%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EResource%20Group%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EEnter%20a%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EName%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EClick%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECreate%20new%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efor%20the%20Container%20App%20environment.%20This%20environment%20houses%20the%20Log%20Analytics%20Workspace%20that%20will%20be%20used%20for%20monitoring%20and%20can%20contain%20one%20or%20more%20Container%20Apps%20which%20all%20write%20to%20this%20Log%20Analytics%20Workspace%3COL%3E%0A%3CLI%3EFill%20in%20an%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EEnvironment%20name%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3ESelect%20a%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ERegion%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efor%20the%20environment%3C%2FLI%3E%0A%3CLI%3EClick%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EMonitoring%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Etab%3C%2FLI%3E%0A%3CLI%3ESelect%20an%20existing%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ELog%20analytics%20workspace%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eor%20create%20a%20new%20one%3C%2FLI%3E%0A%3CLI%3EClick%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECreate%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20return%20to%20the%20Create%20Container%20App%20wizard%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Create%20an%20Azure%20Container%20App%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Create%20an%20Azure%20Container%20App%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383149i951D21D9765BF1E0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22147create1.png%22%20alt%3D%22Create%20an%20Azure%20Container%20App%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECreate%20an%20Azure%20Container%20App%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECreate%20an%20Azure%20Container%20App%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%225%22%3E%0A%3CLI%3EClick%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ENext%3A%20App%20settings%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EYou%20can%20specify%20a%20container%20in%20a%20container%20registry%20to%20run%20in%20the%20Container%20App.%20We%20will%20use%20a%20quickstart%20image%2C%20so%20check%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%22Use%20quickstart%20image%22%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Echeckbox.%20This%20will%20also%20set%20the%20Container%20App%20CPU%20and%20memory%20and%20network%20settings%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Configure%20Azure%20Container%20App%20settings%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Configure%20Azure%20Container%20App%20settings%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383150iF59CAE08E47D46D4%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22147create2.png%22%20alt%3D%22Configure%20Azure%20Container%20App%20settings%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EConfigure%20Azure%20Container%20App%20settings%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EConfigure%20Azure%20Container%20App%20settings%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%227%22%3E%0A%3CLI%3EClick%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EReview%20%2B%20create%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20then%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECreate%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EWhen%20the%20Container%20App%20is%20deployed%2C%20navigate%20to%20it%20in%20the%20Azure%20portal.%20You'll%20see%20that%20it%20has%20an%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EApplication%20URL%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Azure%20Container%20App%20in%20the%20Azure%20portal%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Azure%20Container%20App%20in%20the%20Azure%20portal%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383151iB5B02CBDF0B81ADE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22147result0.png%22%20alt%3D%22Azure%20Container%20App%20in%20the%20Azure%20portal%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAzure%20Container%20App%20in%20the%20Azure%20portal%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAzure%20Container%20App%20in%20the%20Azure%20portal%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EClick%20on%20the%20Application%20URL%20to%20open%20the%20sample%20application%20that%20is%20now%20running%20in%20the%20Container%20App.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22The%20sample%20application%20running%20in%20an%20Azure%20Container%20App%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22The%20sample%20application%20running%20in%20an%20Azure%20Container%20App%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383152iA8BDE2CEDE55A78B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22147result.png%22%20alt%3D%22The%20sample%20application%20running%20in%20an%20Azure%20Container%20App%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThe%20sample%20application%20running%20in%20an%20Azure%20Container%20App%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EThe%20sample%20application%20running%20in%20an%20Azure%20Container%20App%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20can%20configure%20the%20Container%20App%20by%20changing%20the%20ingress%20settings%2C%20to%20enable%20or%20disable%20incoming%20traffic%20and%20the%20target%20network%20port.%20You%20can%20also%20configure%20secrets%20that%20the%20container%20can%20use%2C%20and%20setup%20continuous%20deployment%20with%20GitHub%20Actions%20to%20automatically%20build%20and%20deploy%20code%20to%20the%20Container%20App.%20Pretty%20cool.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22conclusion%22%20id%3D%22toc-hId--1076826919%22%20id%3D%22toc-hId--1076824933%22%3EConclusion%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcontainer-apps%2Foverview%3FWT.mc_id%3Ddocs-azuredevtips-azureappsdev%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Container%20Apps%3C%2FA%3E%26nbsp%3Boffers%20an%20easy%20way%20to%20run%20containers%20in%20Azure%20with%20minimal%20configuration%20and%20management%20overhead.%20Azure%20does%20the%20heavy%20lifting%20for%20you.%20Create%20a%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fget-started%2Fazure-portal%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Etrial%20account%3C%2FA%3E%26nbsp%3Btoday%20and%20go%20and%20check%20it%20out!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3545026%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ETips%20and%20Tricks%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Jun 23 2022 02:57 PM
Updated by: