Skip to content

Commit

Permalink
Merge branch 'Azure:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
waiholiu authored Nov 15, 2024
2 parents b7c31ef + 81824b2 commit ffcf657
Show file tree
Hide file tree
Showing 91 changed files with 933 additions and 845 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/infra-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if : ${{ github.event.inputs.teardown != 'true' }}
name: Lint bicep files
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Perform linting
run: az bicep build --f bicep/main.bicep

Expand All @@ -46,7 +46,7 @@ jobs:
name: Create RG and Validate bicep template
needs: [ lint ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Azure login
uses: azure/login@v1
with:
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
needs: [ validate ]
name: Run what-if on the bicep template
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: azure/login@v1
name: Sign in to Azure
with:
Expand All @@ -105,7 +105,7 @@ jobs:
if : ${{ vars.CONTAINER_REGISTRY_NAME != '' }}
needs: [ preview ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: azure/login@v1
name: Sign in to Azure
with:
Expand All @@ -115,7 +115,7 @@ jobs:
- name: Create ACR ${{ vars.CONTAINER_REGISTRY_NAME }} if does not exist
uses: azure/CLI@v1
with:
inlineScript: |
inlineScript: |
if [[ $(az acr check-name -n ${{ vars.CONTAINER_REGISTRY_NAME }} -o tsv --query "nameAvailable") == false ]]
then
echo "ACR already exists."
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
needs: [ create-acr]
name: Deploy to Azure subscription with ACR
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: azure/login@v1
name: Sign in to Azure
with:
Expand All @@ -169,7 +169,7 @@ jobs:
needs: [ preview ]
name: Deploy to Azure subscription with GHCR
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: azure/login@v1
name: Sign in to Azure
with:
Expand All @@ -192,7 +192,7 @@ jobs:
runs-on: ubuntu-latest
if : ${{ github.event.inputs.teardown == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: azure/login@v1
name: Sign in to Azure
with:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ on:
- 'mkdocs.yml'
- 'Makefile'

permissions:
actions: write # Required for pr-preview-action
contents: write # Required for the checkout action to know to kick off (read) and pr-preview-action (write)
deployments: write # Required for pr-preview-action
id-token: write # Required for pr-preview-action
pages: write # Required for pr-preview-action
pull-requests: write # Required for pr-preview-action

concurrency:
group: preview-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -23,9 +31,9 @@ jobs:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Capture branch and tag
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Deploy static content to Pages
on:
workflow_call:

permissions:
contents: write # Required for checkout and upload-pages-artifact actions
deployments: write # Required for deploy-pages action
id-token: write # Required for deploy-pages action if using OIDC for authentication
pages: write # Required for configure-pages, upload-pages-artifact, and deploy-pages actions

jobs:
# Single deploy job since we're just deploying
deploy:
Expand All @@ -13,15 +19,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/publish-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
frontend: ${{ steps.filter.outputs.frontend }}
processor: ${{ steps.filter.outputs.processor }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ on:
workflow_dispatch: {}

permissions:
contents: write
pages: write
id-token: write
contents: write # Required for checkout and upload-pages-artifact actions
deployments: write # Required for deploy-pages action
id-token: write # Required for deploy-pages action if using OIDC for authentication
pages: write # Required for configure-pages, upload-pages-artifact, and deploy-pages actions

concurrency:
group: "pages"
Expand All @@ -24,9 +25,9 @@ jobs:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Capture branch and tag
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ build-docs-website:
cp -R site/* dist/

docs-local:
docker pull squidfunk/mkdocs-material:latest
docker build -t squidfunk/mkdocs-material:latest ./docs/
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
docker run --rm -it -p 8000:8000 -v $(CURDIR):/docs squidfunk/mkdocs-material
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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](https://learn.microsoft.com/en-us/azure/container-apps/compare-options) provides a good comparison between the available services to host and manage cloud-native containerized applications in Azure.
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](https://learn.microsoft.com/azure/container-apps/compare-options) 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.

Expand Down
20 changes: 5 additions & 15 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
# TODO: The maintainer of this repo has not yet edited this file

**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?

- **No CSS support:** Fill out this template with information about how to file issues and get help.
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.

*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*

# Support

## How to file issues and get help
## How to file issues and get help

This project uses GitHub Issues to track bugs and feature requests. Please search the existing
issues before filing new issues to avoid duplicates. For new issues, file your bug or
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
issues before filing new issues to avoid duplicates. For new issues, file your bug or
feature request as a new Issue.

For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.

## Microsoft Support Policy
## Microsoft Support Policy

Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.12.0" />
<PackageReference Include="Dapr.AspNetCore" Version="1.14.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.15.1" />
<PackageReference Include="SendGrid" Version="9.28.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.12.0" />
<PackageReference Include="Dapr.AspNetCore" Version="1.14.0" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.29.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.15.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.12.0" />
<PackageReference Include="Dapr.AspNetCore" Version="1.14.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.15.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
</ItemGroup>
</Project>
7 changes: 5 additions & 2 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
FROM squidfunk/mkdocs-material
RUN pip install mkdocs-git-revision-date-plugin mkdocs-macros-plugin
RUN pip install mkdocs-glightbox

RUN pip install mkdocs-git-revision-date-plugin \
mkdocs-macros-plugin \
mkdocs-glightbox

2 changes: 1 addition & 1 deletion docs/aca/00-workshop-intro/1-aca-core-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Container App Environment is a secure boundary around several Container Apps
Used to provide monitoring and observability functionality. Each environment will have its own Log Analytics workspace and will be shared among all container apps within the environment.

1. **Container Apps**
Each container App represents a single deployable unit that can contain one or more related containers. Using more than one container in a container app is an advanced use case. For this workshop we will deploy a single container in each container app. More about multiple containers in the same single Azure Container App can be found [here](https://docs.microsoft.com/en-us/azure/container-apps/containers#multiple-containers){target=_blank}.
Each container App represents a single deployable unit that can contain one or more related containers. Using more than one container in a container app is an advanced use case. For this workshop we will deploy a single container in each container app. More about multiple containers in the same single Azure Container App can be found [here](https://docs.microsoft.com/azure/container-apps/containers#multiple-containers){target=_blank}.

1. **Revisions**
For each container app, you can create up to 100 revisions. Revisions are a way to deploy multiple versions of an app where you have the option to send the traffic to a certain revision. You can select if revision mode will support one or multiple active revisions at the same time to support A/B testing scenarios or canary deployments. A container app running in single revision mode will have a single revision that is backed by zero-many Pods/replicas.
Expand Down
25 changes: 10 additions & 15 deletions docs/aca/00-workshop-intro/4-prerequisites.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
---
title: Prerequisites
title: Prerequisites
parent: Workshop Introduction
has_children: false
nav_order: 4
---

## Prerequisites

The workshop is divided into separate modules. Each module will guide you through building the solution code step-by-step. Ensure that you finish the modules in the right order as they have dependencies on each other.
The workshop is divided into separate modules. Each module will guide you through building the solution code step-by-step. Ensure that you finish the modules in the right order as they have dependencies on each other.

Make sure you have your development environment set up and configured.

1. An Azure account with an active subscription - [Create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio){target=_blank}
1. dotnet 6.0 or a higher version - [Install](https://dotnet.microsoft.com/en-us/download){target=_blank}
1. PowerShell 7.0 or higher version (For Windows Users only!) - [Install](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package){target=_blank}
1. .NET SDK 8 or a higher version (we primarily focus on LTS versions) - [Install](https://dotnet.microsoft.com/download){target=_blank}
1. PowerShell 7.0 or higher version (For Windows Users only!) - [Install](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package){target=_blank}
1. Docker Desktop - [Install](https://docs.docker.com/desktop/install/windows-install/){target=_blank}
> As of November 2024, Docker Desktop continues to be free for education purposes. Please consult the [Docker Desktop license agreement](https://docs.docker.com/subscription/desktop-license/) for any updates.
1. Visual Studio Code - [Install](https://code.visualstudio.com/){target=_blank}
1. VS Code Docker extension - [Install](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker){target=_blank}
1. Dapr CLI - [Install](https://docs.dapr.io/getting-started/install-dapr-cli/){target=_blank} and [Initialize](https://docs.dapr.io/getting-started/install-dapr-selfhost/){target=_blank}
1. VS Code Dapr extension. Depends on Dapr CLI - [Install](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-dapr){target=_blank}
1. Azure CLI - [Install](https://docs.microsoft.com/cli/azure/install-azure-cli){target=_blank}
1. Git CLI - [Install](https://git-scm.com){target=_blank}
1. (Optional) A REST client such as [Postman](https://www.postman.com/){target=_blank} or [Insomnia](https://insomnia.rest/){target=_blank} or similar.

## Set up Git Repository & Variable Scripts

Expand Down Expand Up @@ -81,24 +83,17 @@ This workshop typically spans several days. As such, you may close your tools, e
- Copy the [Set-Variables.ps1 script](../../aca/30-appendix/03-variables.md){target=_blank} into the newly-created `Set-Variables.ps1` file and save it.
- Perform an initial commit of the `Set-Variables.ps1` file.
```shell
git add .\Set-Variables.ps1
git commit -m "Initialize Set-Variables.ps1"
```
- 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.
- 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. As we have not yet defined any variables, the output will indicate that the script has exited (without writing out to the file). This is intentional and expected at this stage.
```shell
.\Set-Variables.ps1
```
- Perform an initial commit of the variables file.
- Commit the `Set-Variables.ps1` file.
```shell
git add .\Variables.ps1
git commit -m "Initialize Variables.ps1"
git add .\Set-Variables.ps1
git commit -m "Add Set-Variables.ps1"
```
This completes the basic setup for Git and the variables to be used. You are ready to proceed to [Module 1](../01-deploy-api-to-aca/index.md)!
Expand Down
2 changes: 1 addition & 1 deletion docs/aca/00-workshop-intro/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Introduction

## Description

The Building Microservice Applications with Azure Container Apps workshop will provide you with the practical knowledge to create, deploy, and operate an enterprise level microservice application deployed on the latest serverless containers offering, [Azure Container Apps](https://learn.microsoft.com/en-us/azure/container-apps/overview){target=_blank}. We will demonstrate enabling different components like Dapr which will allow you to address common challenges when building an event driven distributed application while keeping your code platform agnostic. In addition to this, you will get familiar with the built-in autoscaling capabilities in Azure Container Apps using KEDA and how to control spending by scaling down to zero replicas.
The Building Microservice Applications with Azure Container Apps workshop will provide you with the practical knowledge to create, deploy, and operate an enterprise level microservice application deployed on the latest serverless containers offering, [Azure Container Apps](https://learn.microsoft.com/azure/container-apps/overview){target=_blank}. We will demonstrate enabling different components like Dapr which will allow you to address common challenges when building an event driven distributed application while keeping your code platform agnostic. In addition to this, you will get familiar with the built-in autoscaling capabilities in Azure Container Apps using KEDA and how to control spending by scaling down to zero replicas.

## Objectives & Outcomes

Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions docs/aca/01-deploy-api-to-aca/Program-dotnet9.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using TasksTracker.TasksManager.Backend.Api.Services;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

builder.Services.AddSingleton<ITasksManager, FakeTasksManager>();
builder.Services.AddControllers();
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}

app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();

app.Run();
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "8.0.403",
"rollForward": "latestFeature"
}
}
6 changes: 6 additions & 0 deletions docs/aca/01-deploy-api-to-aca/global-dotnet9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"rollForward": "latestFeature"
}
}
Loading

0 comments on commit ffcf657

Please sign in to comment.