Code Monkey home page Code Monkey logo

azure / aca-dotnet-workshop Goto Github PK

View Code? Open in Web Editor NEW
92.0 5.0 60.0 41.63 MB

A Dotnet Azure Container Apps workshop showcasing how to accelerate developers' ability to develop and ship distributed applications.

Home Page: https://azure.github.io/aca-dotnet-workshop/

License: MIT License

C# 39.91% Dockerfile 2.45% HTML 8.78% CSS 0.96% JavaScript 0.21% Bicep 47.27% Makefile 0.42%
azure azure-container-apps cloud-native containerapps microservices

aca-dotnet-workshop's Introduction

Azure Container Apps

There is no doubt that building containerized applications and following a microservices architecture is one of the most common software architecture patterns observed in the past couple of years.

Microsoft Azure offers different services to package, deploy, and manage cloud-native applications, each of which serves a certain purpose and has its own pros and cons. This page provides a good comparison between the available services to host and manage cloud-native containerized applications in Azure.

Whereas building cloud-native apps on Azure Kubernetes Service (AKS) is powerful, there is a bit of a learning curve needed when it comes to creating and configuring the cluster, configuring networking between microservices, services discovery, certificates provisioning, and, lastly, managing the cluster over the lifetime of the application.

In this workshop, we will be focusing on a new containerization service offered by Microsoft called Azure Container Apps (ACA). Microsoft announced the public preview of Azure Container Apps in November 2021, and in May 2022 it announced the General Availability of Azure Container Apps. In brief, Azure Container Apps is a fully managed, serverless, Kubernetes-based container runtime for building and running cloud-native applications which focuses on the business logic of the apps rather than on cloud infrastructure management.

Delivery Instructions

This workshop is intended to be completed by going through the different modules which are hosted under our Github page located here.

We also include an optional slides folder which includes supporting material for those delivering the content. You can think about the slides as supporting material for an instructor but are not required for the attendees to complete the workshop.

Contributions

We are most grateful for community involvement. Please see CONTRIBUTING.md for details. Thank you!

Acknowledgment

The workshop's material, concepts, and code samples draw inspiration from a collection of blog articles authored by Taiseer Joudeh and published on his personal blog. The workshop authors have worked collaboratively to modify and augment the content, resulting in the current version of the workshop.

aca-dotnet-workshop's People

Contributors

ch-rob avatar dependabot[bot] avatar hsirtl avatar microsoft-github-operations[bot] avatar microsoftopensource avatar pankajagrawal16 avatar sc-apps avatar simonkurtz-msft avatar tjoudeh avatar waelkdouh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aca-dotnet-workshop's Issues

[FEATURE REQ] Support Java as language runtime in workshop path

Please describe the feature.

Add support for Java language as well. Idea is that same architecture will be created using Java as language runtime as well and attendees can follow either of the language path based on which language team is using today.

May be in future, this leaves us scope for adding additional runtime as well

Module 5 - Limit Scope of Managed Identity on Service Bus

Please describe the feature.

Presently, the Backend API and Backend Processor have rights at the Service Bus level. We need to bring those down into the specific topics, so that the apps do not have universal read or write permission on the bus.

I can take care of this as I already did this for Contoso Theme Parks.

image

Evaluate Markdown Lint Rules

Please describe the feature.

We have scrubbed the documentation for the low-hanging Markdown Lint fruit by removing a lot of noise. Now it's time to refine the rules in .markdownlist.json and apply them to the documentation.

Check which rules should be enforced, which should be relaxed, and which one should have exceptions.

Update Terminology

Please describe the feature.

Our documentation needs to have updated terminology for terms such as "Microsoft Entra ID" instead of "Azure Active Directory." We also need to ensure proper naming and casing. We can enforce some of that in rules in the .markdownlint.json file.

Use Workload Profiles

Please describe the feature.

We need to switch to Workload Profiles as that's where Azure Container Apps is moving by default. We can still use consumption within Workload Profile. We do not need to use dedicated hardware.

Refactor module 10

Please describe the feature.

@pankajagrawal16 based on our discussion here are the suggested changes to the structure for module 10:

  • Modify the title of module 10 to reflect that fact that it will cover both bicep and ci/cd pipeline
  • From within the bicep section inform the user that they could skip it and go directly to the CI/CD pipeline as they have the option to fork the repo and build the ci/ci pipeline without having to manually build the bicep files.
  • From within the ci/cd section inform the user that they could reference the bicep section if they wanted to learn more.

Add contributor instructions to get workstation set up

Please describe the feature.

I don't yet see a good way to get started as a contributor to the documentation. Whether this is a local setup via the makefile or using a dev container, it may be helpul to have instructions.

User User-Assigned Managed Identity to access Azure Container Registry

Please describe the feature.

We need a user-assigned managed identity to access Azure Container Registry in order to pull images to create Azure Container Apps. Using a system-assigned managed identity does not work because we can't create one until the container app create, but that won't exist until we can securely pull an image from the registry using an identity. Chickens and eggs, rejoice!

Replace Deprecated MkDocs Extensions

Please describe the feature.

The external emoji generator dependency has been deprecated and moved into mkdocs-material.

When using squidfunk/mkdocs-material:latest and running make docs-local, I presently see these messages:

image

Set-Variables.ps1 script Unexpected token '?' in expression or statement

Describe the bug

When running the Set-Variables.ps1 script, I get the following error:

PS C:\dev\CodeSamples\TasksTracker.ContainerApps> .\Set-Variables.ps1
At C:\dev\CodeSamples\TasksTracker.ContainerApps\Set-Variables.ps1:74 char:41

  • "Write-Host "Set $i variable$($i -eq 1 ? '' : 's')."" | Out-File -F ...
  •                                     ~
    

Unexpected token '?' in expression or statement.
At C:\dev\CodeSamples\TasksTracker.ContainerApps\Set-Variables.ps1:76 char:43

  • Write-Host "nWrote $i variable$($i -eq 1 ? '' : 's') to $file.n"
  •                                       ~
    

Unexpected token '?' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken

I am not particularly familiar with PowerShell, but I have tried to adjust the quotes, etc. in those commands, but to no avail. Would you mind offering me some guidance please?

Expected behavior

From the workshop instructions: "Execute the script. You will do this repeatedly throughout the modules. The output of the script will inform you how many variables are written out."

Actual behavior

As per the description:

At C:\dev\CodeSamples\TasksTracker.ContainerApps\Set-Variables.ps1:74 char:41

  • "Write-Host "Set $i variable$($i -eq 1 ? '' : 's')."" | Out-File -F ...
  •                                     ~
    

Unexpected token '?' in expression or statement.
At C:\dev\CodeSamples\TasksTracker.ContainerApps\Set-Variables.ps1:76 char:43

  • Write-Host "nWrote $i variable$($i -eq 1 ? '' : 's') to $file.n"
  •                                       ~
    

Unexpected token '?' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken

Reproduction Steps

Just run the script in the latest (or any I think) version of PowerShell.

Add Network Security Module for ACA

  • Add an NSG to the Container App Environment subnet
  • Add App Gateway instructions to shield container apps
  • Remove external access to container apps
  • Add UDR on Container App Environment subnet
  • Add Azure Firewall for egress protection
  • Add validation steps to demonstrate security improvements

Web app crashes when cookie with email address does not exist

Describe the bug

When an email address had not been entered yet, and the user attempts to load tasks, the web app crashes.

Expected behavior

The web app loads an empty Create view.

Actual behavior

The web app crashes with this error:

image

Reproduction Steps

  1. Load the TasksTracker.WebPortal.Frontend.Ui URL. For example, [https://tasksmanager-frontend-webapp.whitewater-42989893.eastus.azurecontainerapps.io]
  2. Press Load My Tasks.
  3. Observe the error.

image

mkdocs local server throwing warning about missing file that exists

Describe the bug

The warning is complaining about a file that exists in the directory. Need to investigate the reason behind this false positive.
image

Expected behavior

No warning should be thrown.

Actual behavior

Warning should be thrown.

Reproduction Steps

Run the local mkdocs server by running the following command in a bash prompt (e.g. wsl on windows). Make sure you are at the root directory: make docs-local

Emphasize Learning in Documentation

Please describe the feature.

Each module should have a clearly defined intro, body, and outro. I noticed we are not quite clear on this.

  1. Intro: Tell them what they are going to achieve.
  2. Body: Show them what they are achieving.
  3. Outro: Tell them what they have achieved.

Add .NET 8 Instructions

Please describe the feature.

.NET 8 will be released in November 2023. Once generally available, update our instructions appropriately.

[BUG] Clarify port number update in automated deployment of app

Describe the bug

In Module 10 it should state that, if someone (like me) followed along with the whole workshop and wants to use their own sourcecode, they would need to adjust the port numbers in the parameters file according to what they have in their Dockerfiles. Otherwise, the container apps would listen on port 80 and get into timeouts.

Expected behavior

See bug description.

Actual behavior

If you don't change port numbers, the container apps will get session timeouts in cases where the Dockerfile-builds make the containers listen on different ports.

Reproduction Steps

See "Actual behavior".

Support VNET Integration

Allow users to host the ACA cluster in a VNET behind an Application Gateway or Azure Front Door.

Add Instructions to Commit to Local Git

Please describe the feature.

As this workshop is extensive, it's likely that errors along the way may occur. Therefore, it would be beneficial to add git instructions to maintain a local git repo and commit after every module. In case of a module not working as intended, the workshop participant can then roll back to a last known-good state.

Use Port 8080 with .NET 8 Containers

Please describe the feature.

Starting with .NET 8, port 8080 has become the default port (instead of port 80). We should move towards using port 8080 going forward.

As the new .NET 8 images use non-root users, port 80, which is a privileged port, needed to change to a non-privileged port to ensure non-root containers could function.

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.