Lesson 1 of 3 Deploying Models to Endpoints

Understanding Endpoints

This lesson explains how endpoints and deployments relate, how online and batch inference differ, how managed and Kubernetes online endpoints differ, and how endpoints authenticate callers.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish endpoints from deployments.
  • Choose between online and batch inference.
  • Compare managed and Kubernetes online endpoints.
  • Identify the endpoint authentication modes.

Endpoints and deployments

Azure Machine Learning separates the endpoint, which callers see, from the deployments behind it, which do the work. An endpoint has a name, a URI and an authentication mode. A deployment has a model, an environment, optional scoring code and compute. One endpoint can have several deployments, such as blue with the current model and green with a new one, and the endpoint decides how requests are shared between them.

This separation is what makes safe releases possible. Callers keep using the same URI while deployments are added, tested, given traffic and removed. A model update never requires clients to change their configuration.

Online and batch inference

Two patterns of inference need different infrastructure. Online (real-time) inference answers individual requests synchronously, typically in milliseconds, so compute must be running all the time. Batch inference scores a large set of inputs asynchronously, such as a million customer records each night, so compute is needed only while a job runs.

Online endpoint
Request patternOne request, one immediate response
LatencyMilliseconds to seconds
ComputeDeployment instances that run continuously
Cost when idleInstances are billed while the deployment exists
Typical useScoring in an app or API, fraud checks at checkout
Choose when A caller needs the answer now
Batch endpoint
Request patternA job over files or tables; results written to storage
LatencyMinutes to hours
ComputeA compute cluster that scales up for each job
Cost when idleNo cost; the endpoint itself is free
Typical useNightly churn scores, monthly risk ratings
Choose when Results can wait and volumes are large

Managed and Kubernetes online endpoints

Online endpoints come in two forms. Managed online endpoints, the recommended option, run on compute that Microsoft operates: you choose an instance type and count, and Azure handles the virtual machines, operating system patches, node recovery and the load balancer. Kubernetes online endpoints run on an AKS or Azure Arc-enabled cluster attached to the workspace, which suits organizations that must run inference on their own clusters, for example on-premises.

Managed endpoints add features that Kubernetes endpoints lack, such as mirrored traffic, and integrate with Azure Monitor and the managed virtual network. Kubernetes endpoints give control of the infrastructure in exchange for operating it.

Authentication

An endpoint's auth_mode decides how callers authenticate. The choice affects security and how callers are managed.

ModeCredentialNotes
keyA primary or secondary keyKeys do not expire; regenerate them to rotate
aml_tokenAn Azure Machine Learning tokenTokens expire and must be refreshed
aad_tokenA Microsoft Entra access tokenCallers use their own identities and Azure roles; no shared secret

Microsoft Entra authentication is the most secure option for applications hosted in Azure, because each caller authenticates with its own managed identity and access is granted with a role assignment on the endpoint, which can be audited and revoked individually. Batch endpoints always use Microsoft Entra authentication. Keys are retrieved with az ml online-endpoint get-credentials and rotated with regenerate-keys.

Worked example

Choosing the inference pattern

An insurer needs two things from its claims fraud model: a score for every claim submitted through its web portal, returned before the portal confirms the claim, and a rescoring of all 4 million open claims each Sunday after the model is updated. Cost should be minimal.

The portal needs a managed online endpoint, because each claim needs an immediate score. The weekly rescoring needs a batch endpoint with a deployment of the same model on a compute cluster that scales to zero, because 4 million records do not need an immediate answer and the cluster costs nothing between runs.

Scoring 4 million claims by calling the online endpoint in a loop would need a large, expensive deployment for a few hours a week, or take very long on a small one. Running the portal from a batch endpoint is not possible, because batch jobs do not return immediate responses. A Kubernetes endpoint adds infrastructure to operate without a requirement for it.

Check yourself

Which authentication modes can a managed online endpoint use, and which is used by batch endpoints?

Show answer

Online endpoints use key, aml_token or aad_token. Batch endpoints use Microsoft Entra ID tokens.

Exam Tips

Remember for the exam

  • An endpoint is the stable URI; deployments behind it hold the model and compute.
  • Online endpoints answer immediately; batch endpoints run jobs that write results to storage.
  • Managed online endpoints are recommended; Kubernetes endpoints run on your clusters.
  • auth_mode is key, aml_token or aad_token; batch endpoints use Microsoft Entra ID.