Skip to content

Commit a9aab2c

Browse files
authored
Merge pull request #17 from pamelafox/main
Updates for azd release and Oryx issue
2 parents bb36d72 + 8548b9f commit a9aab2c

File tree

4 files changed

+40
-15
lines changed

4 files changed

+40
-15
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
ARG VARIANT=3
22
FROM --platform=amd64 mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33

4-
RUN curl -fsSL https://aka.ms/install-azd.sh | bash
5-
64
ENV PYTHONUNBUFFERED 1
75

86
RUN 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

.devcontainer/devcontainer.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Python 3 & PostgreSQL",
2+
"name": "msdocs-flask-postgresql-sample-app",
33
"dockerComposeFile": "docker-compose.yml",
44
"service": "app",
55
"workspaceFolder": "/workspace",
@@ -37,9 +37,6 @@
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
}
@@ -55,9 +52,9 @@
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
}

.github/workflows/azure-dev.yaml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,45 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
id-token: write
11+
contents: read
12+
913
jobs:
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

infra/resources.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)