Coder Social home page Coder Social logo

taeyo / frontdoor-container-apps Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sebafo/frontdoor-container-apps

0.0 0.0 0.0 280 KB

Azure FrontDoor w/ private Container Apps

Shell 10.47% JavaScript 1.94% HTML 24.07% Dockerfile 1.18% Bicep 62.34%

frontdoor-container-apps's Introduction

Azure FrontDoor & Azure Container Apps

Overview

This repository demonstrates how to use Azure Container Apps with private VNET integration together with Azure FrontDoor. This follows the best practice to enable only VNET internal incoming traffic to Azure Container Apps.

Architecture

Architecture

Implementation

This project contains two main packages.

App

The example app is a nodeJS application, that consists of an index.html (/) and an health endpoint (/health). The app is already pre-built and publicly available on Docker Hub.

Infrastructure

This repo leverages Bicep as Infrastructure as Code. Beside the provisioning of the resource group and approving of the created private link connection everything is deployed by Bicep code. Entrypoint for the deployment is deploy.sh. It is crucial to define the basename in the deploy.sh before running it. This base name is used as a prefix for all resources, including the resource group.

Setup / How To

Prerequisites (Local)

  1. Azure Subscription
  2. Azure CLI installed locally, Azure Cloud Shell or GitHub Codespaces (or alternatives)
  3. Bash shell to execute deploy.sh
  4. jq is locally required to read outputs

Deployment (Local)

  1. App is already built and available on Docker Hub. Feel free to re-build and host it yourself. (/app)
  2. Infrastructure code is in /infra
# Update Base_Name to an individual value in /infra/deploy.sh. 
## (Optional: Update location)

cd infra

az login
az upgrade 
./deploy.sh
  1. After 10-15 minutes everything should be deployed and the FrontDoor Endpoint is reachable. The "Hello Container App"-application is available.

Deployment (GitHub Actions)

  1. Clone/Fork Repo to your own GitHub repository
  2. App is already built and available on Docker Hub. Feel free to re-build yourself. (Run GitHub Action: (Optional) Build "Hello World" Container App)
  3. Azure Subscription
  4. Add a Service Principal Secret to GitHub Secrets as AZURE_CREDENTIALS (HowTo: https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure#create-a-service-principal)
  5. Deploy Infrastructure (Run GitHub Action: Deploy FrontDoor w/ Container Apps)
  6. Get the FQDN to your app out of the "Final Outputs"-step or check the FrontDoor resource

Result

After the deployment a basic Azure Container App application is available via Azure FrontDoor FQDN. Website in Browser

Limitations / Improvements

  • Private Link Service Auto Approval is not possible because the FrontDoor service is located in a Microsoft owned subscription. For that reason, this project tries to approve the endpoint semi-automatic. In some scenarios this might fail, and you need to approve the request manually in the created Private Link Service after the deployment.
  • The approach of this repo does not work with the new Azure Container Apps Workload Profiles (Preview) feature. Currently, there is no IP-based load balancer when using workload profiles. In this scenario, you have to add an Azure Application Gateway in front of Azure Container Apps and use the Application Gateway as a FrontDoor backend. See GitHub - ACA Feature Request
  • (Optional) Include Custom Domains

Disclaimer

This is only sample code and not production ready!

frontdoor-container-apps's People

Contributors

sebafo avatar somebdyelse 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.