Giter Site home page Giter Site logo

containerappsdemo's Introduction

EAUG CONTAINER APPS

This repository includes the code for my Container Apps demo at Edinburgh Azure User Group meetup #23 (27th September).

The talk covers deploying Container Apps using bicep, as well as creating a self-hosted Azure DevOps build agent that can be autoscaled based on the queue length of the given agent pool.

Running locally

⚠️ To run locally, ensure you have the Azure CLI installed, and you are logged into Azure via the az login command.

⚠️ This assumes you have an Azure DevOps organization. This will show you through creating an Agent Pool however.

Steps

  1. Start by creating a resource group for all resources to reside in:

    az group create -n <RG_NAME> -l <LOCATION>
  2. Create the container registry (ensure you are in /deploy directory), providing any parameters required:

    az deployment group create -g <RG_NAME> --template-file .\container-registry.bicep
  3. Create the log analytics workspace:

    az deployment group create -g <RG_NAME> --template-file .\log-analytics.bicep
  4. Create the Container Apps Environment:

    Retrieve logAnalyticsCustomerId and logAnalyticsPrimaryKey from previous output and add to container-app-env-parameters.json

    az deployment group create -g <RG_NAME> --template-file .\container-app-env.bicep --parameters container-app-env-parameters.json
  5. Build and deploy Azure DevOps self-hosted docker agent to Container registry:

        cd ../ado-agent

    Build image:

       docker build -t ado-agent:latest .

    Tag/Push to ACR:

       docker tag ado-agent:latest <ACR_LOGIN_SERVER>/ado-agent:latest
       az acr login -n <ACR_NAME>
       docker push <ACR_LOGIN_SERVER>/ado-agent:latest
  6. Create Azure DevOps Agent Pool:

    • Navigate to Organization Settings > Agent pools > Add pool in Azure DevOps
    • Select self-hosted for Pool type
    • Provide a name for the Agent pool and click Create
    • Obtain the poolId by selecting the Pool and copying the poolId found in the URL, it should look similar to https://dev.azure.com/<ORG_NAME>/_settings/agentpools?poolId=<POOL_ID>&view=jobs
  7. Create Personal Access Token:

    • A Personal Access token is required to read/create new agents dynamically based on autoscale triggers. The following link demonstrates how to create one
    • For scope, select Agent Pools Read & manage. This may require you to click show all scopes at the bottom of the current panel.
  8. Create the Self-Hosted Agent Container App:

    Retrieve containerAppEnvId, containerRegistry and registryUsername from previous steps and add to ado-agent-container-app-parameters.json, as well as changing name, adoUrl, adoAgentPool as appropriate

    az deployment group create -g <RG_NAME> --template-file .\ado-agent-container-app.bicep --parameters ado-agent-container-app-parameters.json

    When prompted, enter registryPassword, which can be found from the Container Registry in Azure, and adoToken, which is the Personal Access Token created in the previous step.

containerappsdemo's People

Contributors

philbroderick avatar

Watchers

James Cloos avatar  avatar

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.