Git Product home page Git Product logo

azure-developer-cli-demo's Introduction

Overview

This repo is a simple example to show how to use the Azure Developer Cli for inner loop development in Azure.
It leverages Github Codespaces as a hosted developer environment.

Github Action

The repo also has two Github Action workflows that would be used to promote code into upper environments after changes are merged into the main branch.

  • Create Azure Container Apps Environment
  • Update a deployment to Azure Container Apps

Required Action Secrets

Variable Usage
SIMPLE_AZURE_CREDENTIALS Creds to access Azure
CONTAINER_APP_RG Resource Group Name for the Upper Environment
CONTAINER_APP_NAME Container App Environment Name for the Upper Environment
DOCKER_REPO Container Registry for Upper Environment
SIMPLE_REGISTRY_USERNAME User name for Container Registry
SIMPLE_REGISTRY_PASSWORD User password for Container Registry

Prerequisite

  • Azure Subscrption
  • Github Codespaces

Deployed Azure Resources

  • Azure Container Registry
  • Azure Container Environment
  • Azure Container App
  • Azure PostgreSQL

Deploy Environment

    git checkout -b branch/feature1
    azd login --tenant-id $ARM_TENANT_ID --client-id $ARM_CLIENT_ID --client-secret $ARM_CLIENT_SECRET
    azd init 
        - Environment Name: dev
        - Azure Location: (US) Southcentral US
        - Azure Subscription: <ENTER> 
    azd up
    ./scripts/update-ui.sh

Validate

    ./scripts/validate.sh

Update Deployment

    //Update line 9 from 
    app.MapGet( "/", () =>  $"Hello World! The time now is {DateTime.Now}" );
    //To 
    app.MapGet( "/", () =>  $"Hello World, Updated! The time now is {DateTime.Now}" );

Redeploy and Validate

    azd deploy 
    ./scripts/validate.sh

Pull Request

  • At this point, a developer would commit the code upstream to their branch and create a pull request. After approved then the Update a deployment to Azure Container Apps Github Action workflow will deploy the change to the upper environments.

Clean Up

    azd down

Backlog

  • Create script to build and push docker image
  • Create script to upate Container App with latest image
  • Migrate to Dapr/PostgreSQL from InMemory Database

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.