App Service Custom AI Middleware
Python middleware and tools for AI agents hosted behind Azure App Service Authentication and App Service Hooks.
Install
pip install aw-appservice-custom-ai-middleware-extension
The distribution name is aw-appservice-custom-ai-middleware-extension. The
stable Python import remains:
import app_service_extensions as ase
For Azure Functions:
pip install "aw-appservice-custom-ai-middleware-extension[functions]"
For Azure Functions hosted skills:
pip install "aw-appservice-custom-ai-middleware-extension[hosted-skills]"
The hosted-skills integration patches runtime seams that are not yet public API. Its dependency range is intentionally narrow and is expanded only after the integration suite passes against a new runtime release.
Azure Functions
Configure the middleware before creating the hosted-skills app, then attach it to the generated Function app:
import app_service_extensions as ase
from azure_functions_agents import create_function_app
ase.configure()
app = create_function_app()
ase.configure(app)
The package preserves App Service caller identity and the opaque
X-MS-Hook-Invocation recursion chain for same-site callbacks. It does not
send those credentials to third-party MCP servers.
ase.current_request().request.origin exposes the proxy-aware, client-facing
site origin supplied by App Service Hooks for callbacks to the originating site.
Publish to PyPI
Publishing is manual because this repository does not have an Actions runner.
PyPI does not allow replacing an existing release, so first update the version
in both pyproject.toml and src\app_service_extensions\__init__.py.
From the repository root in PowerShell, run:
.\scripts\publish-pypi.ps1
The script verifies that both version declarations match, installs the build
tools, runs the tests, rebuilds a clean dist directory, validates the
artifacts, and prompts for the PyPI API token. It keeps the token only in the
publisher process environment and restores that environment after upload.
Paste the token only into the secure prompt. Do not save it in the script,
commit it, or include it in an issue, pull request, or chat.
After the upload succeeds, tag the exact commit that produced the package:
$version = python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])"
git tag "v$version"
git push origin "v$version"
Metadata
Release files for aw-appservice-custom-ai-middleware-extension 0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aw_appservice_custom_ai_middleware_extension-0.3.5.tar.gz | 70.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aw_appservice_custom_ai_middleware_extension-0.3.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 158.2 kB
Release files / aw_appservice_custom_ai_middleware_extension-0.3.5.tar.gz
| Download URL | aw_appservice_custom_ai_middleware_extension-0.3.5.tar.gz |
|---|---|
| Size | 70.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f39bb4090bcda1ffee6468a49d275cd15a2147d07bfb5af412037e13d7443439
|
|
BLAKE2b-256 checksum How to use checksums |
23108790ce29d331bf6e9706f0de43592381d85f2fc6ea2489d99fa3fa8cdf5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / aw_appservice_custom_ai_middleware_extension-0.3.5-py3-none-any.whl
| Download URL | aw_appservice_custom_ai_middleware_extension-0.3.5-py3-none-any.whl |
|---|---|
| Size | 88.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f148392ea228b2af5984cc1b9ced63065c13db53167c5abdb3976025a9d92c68
|
|
BLAKE2b-256 checksum How to use checksums |
32273c4b44039f48fe483e686b756fe8b5f1d237126b30f78266e6c76fac7735
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|