Registry /
azure / azureml-inference-server-http
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
HttpServer
✓ Users define `init()` and `run()` functions in a `score.py` file.
✗ from azureml.inference.server.http import HttpServer
This library provides the server runtime. User interaction is primarily by defining a `score.py` script with `init()` and `run()` functions, not by directly importing server components into application code.
This quickstart demonstrates how to create a minimal `score.py` file, which is the standard interface for models running on `azureml-inference-server-http`. It also provides the necessary shell commands to run this server locally for testing. The server exposes a `/score` endpoint for inference requests.
# Create a file named 'score.py'
# ---
# import json
#
# def init():
# global model
# # In a real scenario, load your model here, e.g., from a file.
# model = {"status": "initialized"}
#
# def run(raw_data):
# try:
# data = json.loads(raw_data)
# prediction = f"Model received input: {data.get('input', 'no input')} and is {model['status']}"
# return json.dumps({"output": prediction})
# except Exception as e:
# return json.dumps({"error": str(e)})
# ---
# To run locally, save the above to 'score.py' and execute in your terminal:
# export AZUREML_ENTRY_SCRIPT=score.py
# python -m azureml.inference.server.http.http_server
#
# Then, send a request to http://localhost:5001/score
# Example with curl:
# curl -X POST -H "Content-Type: application/json" -d '{"input": "example data"}' http://localhost:5001/score
Debug
Known issues
gotchaThis library is primarily a server runtime, not a client library for direct programmatic interaction with ML models. Users define `init()` and `run()` functions in a `score.py` file that this server loads and executes.fixFocus on correctly structuring your `score.py` script and its environment, rather than attempting to import and use internal server components directly.
affects: All versions
gotchaLocal testing requires setting specific environment variables, most notably `AZUREML_ENTRY_SCRIPT`, to point the server to your `score.py` file.fixBefore running `python -m azureml.inference.server.http.http_server`, ensure `export AZUREML_ENTRY_SCRIPT=your_score_file.py` (or `set AZUREML_ENTRY_SCRIPT=your_score_file.py` on Windows) is executed.
affects: All versions
breakingThe exact signature requirements for `init()` and `run()` in `score.py` have been stable, but future versions might introduce subtle changes or new optional parameters.fixAlways refer to the official Azure ML documentation for the recommended `score.py` template and function signatures for your target Azure ML SDK and server version to ensure compatibility.
affects: Across major releases (e.g., 1.x to 2.x)
gotchaAll Python package dependencies for your model code within `score.py` must be explicitly managed and installed into the server's environment. `pip install azureml-inference-server-http` does not install your model's dependencies.fixWhen deploying to Azure ML, provide a `conda_env.yml` file. For local testing, manually `pip install` all necessary packages into your Python environment *before* running the server.
affects: All versions
Upgrade
Version history
1.5.1latest on PyPI · released Dec 18, 2025
Audit
Dependencies
No dependency data recorded yet.