Giter VIP home page Giter VIP logo

acaup-albums's Introduction

Container App UP with albums app

Prereqs

Requirement Instructions
Azure account If you don't have one, create an account for free. You need the Contributor or Owner permission on the Azure subscription to proceed.

Refer to Assign Azure roles using the Azure portal for details.
GitHub Account Sign up for free.
git Install git
Azure CLI Install the Azure CLI.

Getting started

Login to Azure

az login 

Upgrade Azure CLI and install the latest containerapp cli extension

az upgrade 
az extension add --name containerapp --upgrade

Register the following namespaces if not already registered for your subscription

az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights

Set necessary env variables. Make sure to target a location supported for container apps

RG='your-rg-name'
LOCATION='your-preferred-location'
GITHUB_USERNAME='your-gh-username'

Clone the API code

For this sample, we will be deploying a simple front end with a backend API to Azure Container Apps using the az containerapp up command. Navigate to the following repo and fork.

Retrieve the necessary command to clone to your local machine. The command should look something like the following:

git clone https://github.com/$GITHUB_USERNAME/containerapps-albumapi-csharp.git code-to-cloud

Replace the variables with your GitHub username and the app language you would like to use. This command will clone the code into a directory called code-to-cloud.

Change your directory to ensure you are pointed at the newly cloned repo

cd code-to-cloud

DELETE the dockerfile :)

Let's experiment with one of the new capabilities of the az containerapp up command. Recently, support was added for deploying from repos without a dockerfile present. Let's test it out and see how it works! Delete the file called dockerfile from the repository.

Deploy the Album API to Azure Container Apps

Deploy an Azure Container App for the Album API

az containerapp up --name album-api --source ./src -g $RG -l $LOCATION
  • Creates a resource group.
  • Creates an Azure Container Registry and an ACR task.
  • Creates an Azure Log Analytics workspace.
  • Creates an Azure Container Apps environment.
  • Builds a container image and pushes it to the container registry.
  • Creates an Azure Container App.
  • Deploys the container to the container app.

Enable ingress

 az containerapp ingress enable -n album-api -g $RG --type external --target-port 8080 --transport auto

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.