File tree Expand file tree Collapse file tree 4 files changed +40
-15
lines changed
Expand file tree Collapse file tree 4 files changed +40
-15
lines changed Original file line number Diff line number Diff line change 11ARG VARIANT=3
22FROM --platform=amd64 mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33
4- RUN curl -fsSL https://aka.ms/install-azd.sh | bash
5-
64ENV PYTHONUNBUFFERED 1
75
86RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9- && apt-get -y install --no-install-recommends postgresql-client
7+ && apt-get -y install --no-install-recommends postgresql-client \
8+ && apt-get update && apt-get install -y xdg-utils \
9+ && apt-get clean -y && rm -rf /var/lib/apt/lists/*
10+
11+ RUN curl -fsSL https://aka.ms/install-azd.sh | bash
Original file line number Diff line number Diff line change 11{
2- "name" : " Python 3 & PostgreSQL " ,
2+ "name" : " msdocs-flask-postgresql-sample-app " ,
33 "dockerComposeFile" : " docker-compose.yml" ,
44 "service" : " app" ,
55 "workspaceFolder" : " /workspace" ,
3737 "python.testing.pytestPath" : " /usr/local/py-utils/bin/pytest"
3838 },
3939 "features" : {
40- "ghcr.io/devcontainers/features/azure-cli:1" : {
41- "version" : " latest"
42- },
4340 "ghcr.io/devcontainers/features/github-cli:1" : {
4441 "version" : " latest"
4542 }
5552 // Use 'forwardPorts' to make a list of ports inside the container available locally.
5653 "forwardPorts" : [
5754 5000 , 5432
58- ]
55+ ],
5956 // Use 'postCreateCommand' to run commands after the container is created.
6057 // "postCreateCommand": "",
61- // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
62- // "remoteUser": "vscode"
58+ // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
59+ "remoteUser" : " vscode"
6360}
Original file line number Diff line number Diff line change 66 branches :
77 - main
88
9+ permissions :
10+ id-token : write
11+ contents : read
12+
913jobs :
1014 build :
1115 runs-on : ubuntu-latest
1216 container :
1317 image : mcr.microsoft.com/azure-dev-cli-apps:latest
18+ env :
19+ AZURE_CLIENT_ID : ${{ secrets.AZURE_CLIENT_ID }}
20+ AZURE_TENANT_ID : ${{ secrets.AZURE_TENANT_ID }}
21+ AZURE_SUBSCRIPTION_ID : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
22+ AZURE_CREDENTIALS : ${{ secrets.AZURE_CREDENTIALS }}
1423 steps :
1524 - name : Checkout
1625 uses : actions/checkout@v2
1726
18- - name : Log in with Azure
19- uses : azure/login@v1
20- with :
21- creds : ${{ secrets.AZURE_CREDENTIALS }}
27+ - name : Log in with Azure (Federated Credentials)
28+ if : ${{ env.AZURE_CLIENT_ID != '' }}
29+ run : |
30+ azd login `
31+ --client-id "$Env:AZURE_CLIENT_ID" `
32+ --federated-credential-provider "github" `
33+ --tenant-id "$Env:AZURE_TENANT_ID"
34+ shell : pwsh
35+
36+ - name : Log in with Azure (Client Credentials)
37+ if : ${{ env.AZURE_CREDENTIALS != '' }}
38+ run : |
39+ $info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
40+ Write-Host "::add-mask::$($info.clientSecret)"
41+ azd login `
42+ --client-id "$($info.clientId)" `
43+ --client-secret "$($info.clientSecret)" `
44+ --tenant-id "$($info.tenantId)"
45+ shell : pwsh
46+ env :
47+ AZURE_CREDENTIALS : ${{ secrets.AZURE_CREDENTIALS }}
2248
2349 - name : Azure Dev Provision
2450 run : azd provision --no-prompt
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ resource web 'Microsoft.Web/sites@2022-03-01' = {
9292 serverFarmId : appServicePlan .id
9393 siteConfig : {
9494 alwaysOn : true
95- linuxFxVersion : 'PYTHON|3.10 '
95+ linuxFxVersion : 'PYTHON|3.9 '
9696 ftpsState : 'Disabled'
9797 appCommandLine : 'startup.sh'
9898 }
You can’t perform that action at this time.
0 commit comments