Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu
# Install the xz-utils package
RUN apt-get update && apt-get install -y xz-utils
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider cleaning up apt metadata to keep the devcontainer image smaller and more reproducible (e.g., --no-install-recommends and removing /var/lib/apt/lists/* after install).

Suggested change
RUN apt-get update && apt-get install -y xz-utils
RUN apt-get update \
&& apt-get install -y --no-install-recommends xz-utils \
&& rm -rf /var/lib/apt/lists/*

Copilot uses AI. Check for mistakes.
20 changes: 14 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
//"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "3.11"
}
},
Comment on lines +7 to +12
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VARIANT build arg is set here but the .devcontainer/Dockerfile never declares/uses ARG VARIANT, so this currently has no effect (and doesn't actually pin the Python version). Either use a Python base image keyed off VARIANT, or remove this arg and configure the Python feature version explicitly.

Copilot uses AI. Check for mistakes.
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest"
Expand All @@ -14,18 +21,16 @@
"installBicep": true,
"installUsingPython": true,
"version": "2.72.0",
"bicepVersion": "latest"
"bicepVersion": "latest"
},
"ghcr.io/devcontainers/features/terraform:1": {},
"ghcr.io/devcontainers/features/powershell:1": {},
"ghcr.io/azure/azure-dev/azd:latest": {}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r application/single_app/requirements.txt",
"postCreateCommand": "python3 -m venv .venv && .venv/bin/pip install -r application/single_app/requirements.txt",
// Configure tool-specific properties.
"customizations": {
"vscode": {
Expand All @@ -36,7 +41,10 @@
"ms-vscode.azurecli",
"HashiCorp.terraform",
"ms-vscode.powershell"
]
],
"settings": {
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/.venv/bin/python"
}
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
Expand Down
5 changes: 3 additions & 2 deletions deployers/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ hooks:

echo ""
echo "[2/4] Installing Python dependencies..."
if python3 -m pip install --user -r ./bicep/requirements.txt > /dev/null 2>&1; then

if python3 -m venv .venv && .venv/bin/pip install -r ./bicep/requirements.txt > /dev/null 2>&1; then
echo "✓ Dependencies installed successfully"
else
echo "✗ ERROR: Failed to install Python dependencies" >&2
Comment on lines +66 to 69
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This redirects all output (including venv creation failures) to /dev/null, which will make deployment failures harder to diagnose now that python3 -m venv is part of the command chain. Consider only silencing successful pip install output and printing captured stderr/stdout on failure.

Suggested change
if python3 -m venv .venv && .venv/bin/pip install -r ./bicep/requirements.txt > /dev/null 2>&1; then
echo "✓ Dependencies installed successfully"
else
echo "✗ ERROR: Failed to install Python dependencies" >&2
if python3 -m venv .venv; then
if pip_output=$(.venv/bin/pip install -r ./bicep/requirements.txt 2>&1); then
echo "✓ Dependencies installed successfully"
else
echo "$pip_output" >&2
echo "✗ ERROR: Failed to install Python dependencies" >&2
exit 1
fi
else
echo "✗ ERROR: Failed to create Python virtual environment" >&2

Copilot uses AI. Check for mistakes.
Expand All @@ -71,7 +72,7 @@ hooks:

echo ""
echo "[3/4] Running post-deployment configuration..."
if python3 ./bicep/postconfig.py; then
if .venv/bin/python3 ./bicep/postconfig.py; then
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency/portability, prefer invoking the venv interpreter as .venv/bin/python (not python3). Some venvs only guarantee python exists, and your devcontainer config also points VS Code at .venv/bin/python.

Suggested change
if .venv/bin/python3 ./bicep/postconfig.py; then
if .venv/bin/python ./bicep/postconfig.py; then

Copilot uses AI. Check for mistakes.
echo "✓ Post-deployment configuration completed"
else
echo "✗ ERROR: Post-deployment configuration failed" >&2
Expand Down
2 changes: 2 additions & 0 deletions deployers/bicep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ Using the bash terminal in Visual Studio Code

`azd config set cloud.name AzureCloud` - If you work with other Azure clouds, you may need to update your cloud like `azd config set cloud.name AzureUSGovernment` - more information here - [Use Azure Developer CLI in sovereign clouds | Microsoft Learn](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/sovereign-clouds)

`az login` - this will open a browser window shta the user with Owner level permissions to the target subscription will need to authenticate with.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the az login description: "shta" should be "that" (and the sentence could be tightened for clarity).

Suggested change
`az login` - this will open a browser window shta the user with Owner level permissions to the target subscription will need to authenticate with.
`az login` - opens a browser window where a user with Owner level permissions to the target subscription must authenticate.

Copilot uses AI. Check for mistakes.

`azd auth login` - this will open a browser window that the user with Owner level permissions to the target subscription will need to authenticate with.

`azd env new <environment>` - Use the same value for the \<environment\> that was used in the application registration.
Expand Down
Loading