Skip to content

Commit 2046b4f

Browse files
authored
Initial code commit (#1)
1 parent ae7e5d1 commit 2046b4f

File tree

216 files changed

+182393
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+182393
-2
lines changed

.devcontainer/devcontainer.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "Azure Developer CLI",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.10-bullseye",
4+
"features": {
5+
// See https://containers.dev/features for list of features
6+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
7+
},
8+
"ghcr.io/azure/azure-dev/azd:latest": {}
9+
},
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"GitHub.vscode-github-actions",
14+
"ms-azuretools.azure-dev",
15+
"ms-azuretools.vscode-azurefunctions",
16+
"ms-azuretools.vscode-bicep",
17+
"ms-azuretools.vscode-docker"
18+
// Include other VSCode language extensions if needed
19+
// Right click on an extension inside VSCode to add directly to devcontainer.json, or copy the extension ID
20+
]
21+
}
22+
},
23+
"forwardPorts": [
24+
// Forward ports if needed for local development
25+
],
26+
"postCreateCommand": "",
27+
"remoteUser": "vscode",
28+
"hostRequirements": {
29+
"memory": "8gb"
30+
}
31+
}

.editorconfig

+395
Large diffs are not rendered by default.

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
*.sh text eol=lf

.github/workflows/azure-dev.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
# Run when commits are pushed to mainline branch (main or master)
5+
# Set this to the mainline branch you are using
6+
branches:
7+
- main
8+
- master
9+
10+
# GitHub Actions workflow to deploy to Azure using azd
11+
# To configure required secrets for connecting to Azure, simply run `azd pipeline config`
12+
13+
# Set up permissions for deploying with secretless Azure federated credentials
14+
# https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication
15+
permissions:
16+
id-token: write
17+
contents: read
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
env:
23+
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
24+
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
25+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
26+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
27+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Install azd
33+
uses: Azure/[email protected]
34+
35+
- name: Log in with Azure (Federated Credentials)
36+
if: ${{ env.AZURE_CLIENT_ID != '' }}
37+
run: |
38+
azd auth login `
39+
--client-id "$Env:AZURE_CLIENT_ID" `
40+
--federated-credential-provider "github" `
41+
--tenant-id "$Env:AZURE_TENANT_ID"
42+
shell: pwsh
43+
44+
- name: Log in with Azure (Client Credentials)
45+
if: ${{ env.AZURE_CREDENTIALS != '' }}
46+
run: |
47+
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
48+
Write-Host "::add-mask::$($info.clientSecret)"
49+
50+
azd auth login `
51+
--client-id "$($info.clientId)" `
52+
--client-secret "$($info.clientSecret)" `
53+
--tenant-id "$($info.tenantId)"
54+
shell: pwsh
55+
env:
56+
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
57+
58+
- name: Provision Infrastructure
59+
run: azd provision --no-prompt
60+
env:
61+
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
62+
63+
- name: Deploy Application
64+
run: azd deploy --no-prompt

.gitignore

+89-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4-
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
4+
## Get latest from `dotnet new gitignore`
5+
6+
# dotenv files
7+
.env
58

69
# User-specific files
710
*.rsuser
@@ -57,11 +60,14 @@ dlldata.c
5760
# Benchmark Results
5861
BenchmarkDotNet.Artifacts/
5962

60-
# .NET Core
63+
# .NET
6164
project.lock.json
6265
project.fragment.lock.json
6366
artifacts/
6467

68+
# Tye
69+
.tye/
70+
6571
# ASP.NET Scaffolding
6672
ScaffoldingReadMe.txt
6773

@@ -396,3 +402,84 @@ FodyWeavers.xsd
396402

397403
# JetBrains Rider
398404
*.sln.iml
405+
.idea/
406+
407+
##
408+
## Visual studio for Mac
409+
##
410+
411+
412+
# globs
413+
Makefile.in
414+
*.userprefs
415+
*.usertasks
416+
config.make
417+
config.status
418+
aclocal.m4
419+
install-sh
420+
autom4te.cache/
421+
*.tar.gz
422+
tarballs/
423+
test-results/
424+
425+
# Mac bundle stuff
426+
*.dmg
427+
*.app
428+
429+
# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
430+
# General
431+
.DS_Store
432+
.AppleDouble
433+
.LSOverride
434+
435+
# Icon must end with two \r
436+
Icon
437+
438+
439+
# Thumbnails
440+
._*
441+
442+
# Files that might appear in the root of a volume
443+
.DocumentRevisions-V100
444+
.fseventsd
445+
.Spotlight-V100
446+
.TemporaryItems
447+
.Trashes
448+
.VolumeIcon.icns
449+
.com.apple.timemachine.donotpresent
450+
451+
# Directories potentially created on remote AFP share
452+
.AppleDB
453+
.AppleDesktop
454+
Network Trash Folder
455+
Temporary Items
456+
.apdisk
457+
458+
# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
459+
# Windows thumbnail cache files
460+
Thumbs.db
461+
ehthumbs.db
462+
ehthumbs_vista.db
463+
464+
# Dump file
465+
*.stackdump
466+
467+
# Folder config file
468+
[Dd]esktop.ini
469+
470+
# Recycle Bin used on file shares
471+
$RECYCLE.BIN/
472+
473+
# Windows Installer files
474+
*.cab
475+
*.msi
476+
*.msix
477+
*.msm
478+
*.msp
479+
480+
# Windows shortcuts
481+
*.lnk
482+
483+
# Vim temporary swap files
484+
*.swp
485+
.azure

Dockerfile.containerapp

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
4+
5+
COPY ./src/EasyAuth.ContainerApp /source/EasyAuth.ContainerApp
6+
COPY ./src/EasyAuth.Components /source/EasyAuth.Components
7+
8+
WORKDIR /source/EasyAuth.ContainerApp
9+
10+
RUN dotnet publish -c Release -o /app
11+
12+
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final
13+
14+
WORKDIR /app
15+
16+
COPY --from=build /app .
17+
18+
USER $APP_UID
19+
20+
ENTRYPOINT ["dotnet", "EasyAuth.ContainerApp.dll"]

EasyAuth.sln

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{09E22D62-2D4D-40BE-94ED-90EB8528124A}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAuth.ContainerApp", "src\EasyAuth.ContainerApp\EasyAuth.ContainerApp.csproj", "{F2AACAFC-9022-4D1C-9B3F-F05D9D4DCCB6}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAuth.SwaApp", "src\EasyAuth.SwaApp\EasyAuth.SwaApp.csproj", "{7EE7A101-712C-45B6-8501-05E7FECEDA8A}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAuth.WebApp", "src\EasyAuth.WebApp\EasyAuth.WebApp.csproj", "{EDBFCBE0-3F6B-4DA4-84B0-0218CC4261C2}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAuth.Components", "src\EasyAuth.Components\EasyAuth.Components.csproj", "{0CDA4CFC-514A-4F52-BBFA-7A0B4100D132}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAuth.FunctionApp", "src\EasyAuth.FunctionApp\EasyAuth.FunctionApp.csproj", "{560AC983-7BF0-499D-B2B8-15C4B74633A3}"
17+
EndProject
18+
Global
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Debug|Any CPU = Debug|Any CPU
21+
Release|Any CPU = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{F2AACAFC-9022-4D1C-9B3F-F05D9D4DCCB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{F2AACAFC-9022-4D1C-9B3F-F05D9D4DCCB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{F2AACAFC-9022-4D1C-9B3F-F05D9D4DCCB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{F2AACAFC-9022-4D1C-9B3F-F05D9D4DCCB6}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{7EE7A101-712C-45B6-8501-05E7FECEDA8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{7EE7A101-712C-45B6-8501-05E7FECEDA8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{7EE7A101-712C-45B6-8501-05E7FECEDA8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{7EE7A101-712C-45B6-8501-05E7FECEDA8A}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{EDBFCBE0-3F6B-4DA4-84B0-0218CC4261C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{EDBFCBE0-3F6B-4DA4-84B0-0218CC4261C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{EDBFCBE0-3F6B-4DA4-84B0-0218CC4261C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{EDBFCBE0-3F6B-4DA4-84B0-0218CC4261C2}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{0CDA4CFC-514A-4F52-BBFA-7A0B4100D132}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{0CDA4CFC-514A-4F52-BBFA-7A0B4100D132}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{0CDA4CFC-514A-4F52-BBFA-7A0B4100D132}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{0CDA4CFC-514A-4F52-BBFA-7A0B4100D132}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{560AC983-7BF0-499D-B2B8-15C4B74633A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41+
{560AC983-7BF0-499D-B2B8-15C4B74633A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{560AC983-7BF0-499D-B2B8-15C4B74633A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{560AC983-7BF0-499D-B2B8-15C4B74633A3}.Release|Any CPU.Build.0 = Release|Any CPU
44+
EndGlobalSection
45+
GlobalSection(SolutionProperties) = preSolution
46+
HideSolutionNode = FALSE
47+
EndGlobalSection
48+
GlobalSection(NestedProjects) = preSolution
49+
{F2AACAFC-9022-4D1C-9B3F-F05D9D4DCCB6} = {09E22D62-2D4D-40BE-94ED-90EB8528124A}
50+
{7EE7A101-712C-45B6-8501-05E7FECEDA8A} = {09E22D62-2D4D-40BE-94ED-90EB8528124A}
51+
{EDBFCBE0-3F6B-4DA4-84B0-0218CC4261C2} = {09E22D62-2D4D-40BE-94ED-90EB8528124A}
52+
{0CDA4CFC-514A-4F52-BBFA-7A0B4100D132} = {09E22D62-2D4D-40BE-94ED-90EB8528124A}
53+
{560AC983-7BF0-499D-B2B8-15C4B74633A3} = {09E22D62-2D4D-40BE-94ED-90EB8528124A}
54+
EndGlobalSection
55+
EndGlobal

azure.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2+
3+
name: azure-easyauth-sample
4+
metadata:
5+
6+
services:
7+
easyauth-containerapp:
8+
project: src/EasyAuth.ContainerApp
9+
host: containerapp
10+
language: dotnet
11+
docker:
12+
path: ../../Dockerfile.containerapp
13+
context: ../../
14+
remoteBuild: true
15+
# easyauth-swaapp:
16+
# project: src/EasyAuth.SwaApp
17+
# host: staticwebapp
18+
# language: dotnet
19+
easyauth-webapp:
20+
project: src/EasyAuth.WebApp
21+
host: appservice
22+
language: dotnet

global.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"allowPrerelease": false
4+
}
5+
}

0 commit comments

Comments
 (0)