-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pamelafox/azd-support
Azd support
- Loading branch information
Showing
39 changed files
with
3,737 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG VARIANT=bullseye | ||
FROM --platform=amd64 mcr.microsoft.com/devcontainers/python:0-${VARIANT} | ||
RUN curl -fsSL https://aka.ms/install-azd.sh | bash \ | ||
&& curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \ | ||
&& mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg \ | ||
&& sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/debian/$(lsb_release -rs | cut -d'.' -f 1)/prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list' \ | ||
&& apt-get update && apt-get install -y azure-functions-core-tools-4 \ | ||
&& apt update && apt-get install -y xdg-utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "FastAPI on Azure Functions", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
"VARIANT": "3.9-bullseye" | ||
} | ||
}, | ||
"forwardPorts": [8000, 7071], | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": { | ||
"version": "2" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": { | ||
"version": "16", | ||
"nodeGypDependencies": false | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-azuretools.azure-dev", | ||
"ms-azuretools.vscode-bicep", | ||
"ms-azuretools.vscode-docker", | ||
"ms-vscode.vscode-node-azure-pack", | ||
"ms-python.python", | ||
"ms-azuretools.vscode-azurefunctions" | ||
] | ||
} | ||
}, | ||
"postCreateCommand": "python3 -m venv .venv", | ||
"postAttachCommand": ". .venv/bin/activate", | ||
"remoteUser": "vscode", | ||
"hostRequirements": { | ||
"memory": "8gb" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Validate bicep scripts | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Azure CLI script | ||
uses: azure/CLI@v1 | ||
with: | ||
inlineScript: az bicep build -f infra/main.bicep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Azure Developer CLI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- azd-support | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: mcr.microsoft.com/azure-dev-cli-apps:latest | ||
env: | ||
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | ||
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in with Azure (Federated Credentials) | ||
if: ${{ env.AZURE_CLIENT_ID != '' }} | ||
run: | | ||
azd login ` | ||
--client-id "$Env:AZURE_CLIENT_ID" ` | ||
--federated-credential-provider "github" ` | ||
--tenant-id "$Env:AZURE_TENANT_ID" | ||
shell: pwsh | ||
|
||
- name: Log in with Azure (Client Credentials) | ||
if: ${{ env.AZURE_CREDENTIALS != '' }} | ||
run: | | ||
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable; | ||
Write-Host "::add-mask::$($info.clientSecret)" | ||
azd login ` | ||
--client-id "$($info.clientId)" ` | ||
--client-secret "$($info.clientSecret)" ` | ||
--tenant-id "$($info.tenantId)" | ||
shell: pwsh | ||
env: | ||
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Azure Dev Provision | ||
run: azd provision --no-prompt | ||
env: | ||
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }} | ||
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }} | ||
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
||
- name: Azure Dev Deploy | ||
run: azd deploy --no-prompt | ||
env: | ||
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }} | ||
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }} | ||
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json | ||
|
||
name: fastapi-on-azure-functions | ||
|
||
services: | ||
api: | ||
project: . | ||
language: py | ||
host: function |
Oops, something went wrong.