A minimal Python 3.14 HTTP app for learning how to deploy a GitHub repository with App Service Builder (Private Preview). It uses only the Python standard library: no framework, third-party packages, container files, or other repository is required.
This is a dev/test learning sample, not a production HTTP server. Live end-to-end preview qualification is pending; local checks do not prove a successful cloud build or deployment.
/returns HTTP 200 andApp Service Builder / python-web: Hello./healthreturns HTTP 200 andOK; unknown paths return HTTP 404.SAMPLE_GREETINGchanges the deliberately public greeting.- Root-level
builder.yamlexplicitly selects Python 3.14, the startup commandpython app.py, and/health. It relies on the single-component defaults for the root path (/), port 8080, and the required HTTP 200 health response. - Dependency-free HTTP tests run locally and in GitHub Actions.
- Python 3.14, available as
python3(orpythonon Windows). - Git, plus curl or a browser for HTTP checks.
- For deployment: Private Preview access, an authorized Azure subscription and resource group, and GitHub access to your own fork. Use a location available to your preview subscription; this sample does not assume a region.
Fork this repository
to your own GitHub account. Clone your fork, replacing <your-github-account>:
git clone https://github.com/<your-github-account>/app-service-builder-python.git
cd app-service-builder-python
python3 --versionNo package installation is required. requirements.txt intentionally contains no
packages, but must remain at the repository root as the build dependency manifest.
Optionally create a virtual environment:
python3 -m venv .venv
. .venv/bin/activateOn Windows PowerShell use Python 3.14 as python, create the environment with
python -m venv .venv, and activate it with .venv\Scripts\Activate.ps1.
From the repository root:
python3 app.pyThe server binds to 0.0.0.0:8080, so it can also be reached from your local
network. Use it only in a trusted dev/test environment. In another terminal:
curl -i http://localhost:8080/
curl -i http://localhost:8080/health
curl -i http://localhost:8080/not-foundExpect HTTP 200 with App Service Builder / python-web: Hello, HTTP 200 with OK,
and HTTP 404 with Not found, respectively. Stop the server with Ctrl+C.
Do not override PORT: this sample always listens on 8080.
Follow the Portal quickstart using your Private Preview access:
- Sign in to Portal and select your authorized subscription and resource group. Create an app in a location available to your preview.
- Authorize the GitHub source connection for your fork. If your organization restricts repository access, have an authorized owner grant access to that repository. Do not select the upstream Azure-Samples repository.
- Select your fork's
mainbranch and the repository root as the app source root. Keepapp.py,requirements.txt, andbuilder.yamltogether at that root; there is nosamples/python-websubdirectory to select. - Start deployment and wait for a successful terminal deployment state. Submitting a deployment request does not mean it has finished.
- Read the app's runtime URL from Portal, then check both
/and/health:
curl -i "https://<runtime-host>/"
curl -i "https://<runtime-host>/health"Both must return HTTP 200 and the expected greeting/OK bodies. If deployment
fails or the health check fails, inspect the deployment status and logs before
proceeding. These are instructions, not evidence of a completed cloud deployment.
For a local demo, stop the existing server and restart it:
SAMPLE_GREETING="Welcome" python3 app.pyOn Windows PowerShell set $env:SAMPLE_GREETING = "Welcome" and run python app.py.
The root response becomes App Service Builder / python-web: Welcome.
An unset or empty value uses Hello. Never put secrets or personal data in this
setting: the value is returned publicly over HTTP.
In Portal Variables, set SAMPLE_GREETING and choose Save and deploy.
Save only changes desired configuration, not existing runtime processes:
explicitly deploy afterward. Wait for completion and check / again.
Activating a retained version uses that version's historical values.
See the variables guide.
After editing your fork locally:
git add app.py
git commit -m "Update sample greeting"
git push origin mainPush the files you actually changed to the branch connected in Portal. Builds read
committed GitHub source, not your local working tree. A push alone is not a
promise of automatic deployment: explicitly deploy the connected main branch
in Portal, wait for completion, and verify / and /health again.
Stop local Python with Ctrl+C and run deactivate if you activated a virtual
environment. In Portal, delete only the sample app and wait for deletion to
complete. Do not delete the resource group or subscription: they may contain
unrelated resources. App deletion does not delete your GitHub fork or separately
created Azure resources.
Run from the repository root with Python 3.14:
python3 -m py_compile app.py
python3 -m unittest discover -s tests -vOn Windows use python instead of python3. Tests start owned servers on
ephemeral loopback ports, check responses and greetings, and shut down afterward.
They do not deploy to Azure or require credentials.
The build contract remains Python 3.14, python app.py, port 8080, and
/health returning exactly HTTP 200. The manifest pins the runtime, startup
command, and health path; the root path (/), port 8080, and exact HTTP 200 health
status use the single-component defaults. There is no custom build or output path
and no Flask/Django/WSGI detection requirement. Keep the root manifest and the
empty dependency manifest intact when experimenting. Preview build-image/runtime
support still requires end-to-end qualification.
See CONTRIBUTING.md, the Microsoft Open Source Code of Conduct, and the MIT license. For security vulnerabilities, follow Microsoft's security reporting guidance rather than opening a public issue.