Skip to content

Commit 9b0b82f

Browse files
authored
adding remote container definition (#256)
1 parent b4beaaf commit 9b0b82f

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Find the Dockerfile at this URL
2+
# https://github.com/Azure/azure-functions-docker/blob/dev/host/4/bullseye/amd64/python/python39/python39-core-tools.Dockerfile
3+
FROM mcr.microsoft.com/azure-functions/python:4-python3.9-core-tools
4+
5+
COPY patch-core-tools.sh /tmp/patch-core-tools.sh
6+
RUN chmod +x /tmp/patch-core-tools.sh
7+
RUN /tmp/patch-core-tools.sh
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Python devcontainer for SQL bindings public preview
2+
3+
The use of SQL bindings during the early public preview phase requires additional setup for local development due to the requirement of the Azure Functions host 4.5.0 or greater. With the included files (`devcontainer.json`, `Dockerfile`, and `patch-core-tools.sh`), your environment can be automatically setup to support development for SQL bindings in VS Code remote containers or Codespaces. Once inside this environment, your VS Code tasks (F5 to run) will perform as expected.
4+
5+
For more on remote development in VS Code, please check out their [documentation](https://code.visualstudio.com/docs/remote/containers).
6+
7+
8+
## What does this environment include?
9+
10+
This environment definition takes the standard Python 3.9 and Azure Functions development environment image as its base image, then applies an update to a pre-release version of the [Azure Functions Core Tools](https://github.com/azure/azure-functions-core-tools).
11+
12+
The update to Azure Functions Core Tools takes place in [patch-core-tools.sh](patch-core-tools.sh).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/azure-functions-python-3
3+
{
4+
"name": "Azure Functions & Python 3",
5+
"dockerFile": "Dockerfile",
6+
"forwardPorts": [ 7071 ],
7+
8+
// Set *default* container specific settings.json values on container create.
9+
"settings": {},
10+
11+
// Add the IDs of extensions you want installed when the container is created.
12+
"extensions": [
13+
"ms-azuretools.vscode-azurefunctions",
14+
"ms-azuretools.vscode-docker",
15+
"ms-python.python",
16+
"ms-mssql.mssql"
17+
],
18+
19+
// Use 'postCreateCommand' to run commands after the container is created.
20+
// "postCreateCommand": "npm install",
21+
22+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
23+
"remoteUser": "vscode"
24+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
mkdir /tmp/patch-core-tools
3+
cd /tmp/patch-core-tools
4+
wget -O localdev.zip https://go.microsoft.com/fwlink/?linkid=2196321
5+
unzip localdev.zip -d core-tools
6+
cp -r core-tools/* /usr/lib/azure-functions-core-tools-4/

0 commit comments

Comments
 (0)