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.
The visual showcase is served directly at /, without a redirect.
Real local rendering in Microsoft Edge, not evidence of an Azure deployment.
Check app health displays server liveness on this page without navigating
to the plain-text response. /health remains unchanged. The page explains how
to customize SAMPLE_GREETING in your own Builder App and deploy the change.
/returns HTTP 200 andtext/html; charset=utf-8, displaying the public greeting./healthreturns HTTP 200 andOK; unknown paths return HTTP 404./is a responsive, dependency-free visual introduction with the current public greeting, Python language identity, customization guidance, and links to the real routes./healthretains its plain-text response.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 HTML displaying 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.
Open http://localhost:8080/ in a browser for the
visual showcase. It uses local inline styles and system fonts; no external assets or package installation is needed; inline JavaScript checks health. SAMPLE_GREETING is displayed
as escaped text on this page.
Keep demo.html alongside app.py; the server loads it relative to the script,
not the current working directory.
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 AzureAppService repository.
- Select your fork's
mainbranch and the repository root as the app source root. Keepapp.py,requirements.txt, andbuilder.yamltogether at that root, along withdemo.html; 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 HTML displays 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 root HTML, health text, public greetings,
HTML escaping, query strings, 404s (including the removed showcase route), and
unsupported methods returning 501, 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.
The product mark uses the supplied App Service Builder asset in assets/AppServiceBuilder.svg. Its SVG is inlined in the root page to preserve the existing routes and security policy. Keep the inline copy and asset in sync when updating the logo.
The page uses the official Python logo and links separately to Python documentation and Builder documentation. The greeting remains simple; no editor or counter was added. Logo provenance and trademark notices are available on the page and the original asset is retained under assets/.
