Testing Azure OpenAI deployments with promptfoo

A practical guide to pointing promptfoo at Azure OpenAI deployments, mapping deployment names to model names, authenticating for CI and comparing Azure and OpenAI results on one suite.

On this page

Testing Azure OpenAI deployments with promptfoo: what changes from direct OpenAI

If your team runs models through Azure OpenAI and needs repeatable evals and red team scans, the first thing to understand is where the traffic goes. promptfoo runs on the machine or CI runner where you start it, and it calls your Azure endpoint directly. There is no promptfoo-hosted relay in the path, so test prompts and model responses stay on your own Azure resource under your existing network and access controls. The Community edition is free, and the software runs completely locally, so the main cost of this setup is the Azure consumption your test runs generate, plus whatever time your engineers spend maintaining the suite.

Azure OpenAI is configured in promptfoo through its model provider configuration, the same mechanism used for direct OpenAI, but the settings differ. Point the provider at your Azure resource and select the model by the deployment you created in that resource. Confirm the exact provider identifier, the endpoint and API version option keys, and the authentication fields in the promptfoo provider documentation for the version you have installed, since these names change between releases. The promptfoo introduction is the right starting point for checking the current provider setup before you write the first config.

Ask your platform team to confirm which Azure resource, region and deployments the test suite should target before anyone copies a config from an example. Keeping one dedicated test deployment per model, with its own quota and logging, makes it easier to see test cost and to keep red team traffic out of production dashboards.

What you need before the first Azure OpenAI eval runs

Most failed first runs against Azure OpenAI come from missing prerequisites rather than from promptfoo itself. The cards below cover the runtime, the Azure resource, the network path and the identity that connect the runner to your deployments. Check each one before you write the first config.

Node.js runtime version

The promptfoo npm release 0.124.1, published on 8 October 2026, requires Node.js 22.22.0 or newer. Install that version on every runner, including developer laptops and CI images, because an older Node.js can fail at install or at startup. Pin the version in your CI image so a runner upgrade does not change eval behavior between runs.

promptfoo on npm

An Azure OpenAI resource with deployments

promptfoo calls deployments, not bare model names, so the resource needs at least one model deployed under a name you choose. Record the resource endpoint, the deployment names and the model each deployment wraps. Confirm the deployments are in a region your data handling rules allow, since model availability varies by region.

Network path from the runner

The runner must reach the resource endpoint over HTTPS. Check outbound rules on corporate proxies, egress firewalls and any private endpoint or virtual network restrictions on the resource. A runner in a self-hosted CI network may need an allow rule that a hosted runner does not. Test the path with a single request before you add a full suite.

Identity used to authenticate

Decide which identity the runner uses before you configure anything. Interactive developers can rely on their Azure CLI sign-in, while CI jobs need a non-human identity such as a service principal with credentials supplied through your secret store. Do not reuse a personal account in pipelines, and keep the identity separate from the one your production application uses.

API version and deployment types

Confirm which Azure OpenAI API version and deployment types the promptfoo version you pin supports before you copy any sample config. Chat, completion and embedding deployments may need different settings, and API versions change over time. Read the release notes of the pinned version and test one deployment of each type you plan to use.

promptfoo releases

Ownership of Azure role assignments

Agree in advance who grants the role assignments the identity needs on the resource, and who approves changes to them. In many organizations that is a cloud platform or security team, not the people writing evals, so the request can take longer than the setup itself. Write down the role, the scope and the owner, and review the assignment when the test identity or its deployments change.

How a promptfoo test request reaches an Azure OpenAI deployment

The request starts at the promptfoo CLI on a laptop or CI runner, which is the only component that calls Azure. Credentials come from either an Azure CLI session or a service principal, both inside the client's Azure subscription boundary. The request addresses the Azure OpenAI resource endpoint and names a deployment, not a model, so the deployment name is what must be checked first. The response returns to promptfoo for assertions, and if a grader model is configured, its calls follow the same path and should be reviewed as a second data flow.

Test traffic path from the promptfoo runner to an Azure OpenAI deployment and optional grader.

Deployment names, model names and where each one goes

This table maps each Azure OpenAI concept to the promptfoo setting that carries it, so you can see which value belongs where before running a suite. Read it row by row and confirm each key name in the promptfoo Azure provider documentation for your installed version. The main takeaway is that the deployment name, not the model name, goes in the request path that promptfoo sends to Azure.

Azure conceptWhat it isWhere it goes in promptfoo
Resource endpointThe base URL of your Azure OpenAI resource in your subscriptionBase URL setting on the Azure provider; confirm the exact key name in the provider docs
Deployment nameThe name you chose when you created the model deployment in Azure AI Foundry or the Azure portalDeployment identifier in the provider ID or config; this is the value Azure routes requests by
Underlying model nameThe model family you deployed, such as a GPT model, which Azure does not use for routingInformational only for most setups; confirm whether any config key needs it for pricing or capability checks
Model versionThe version of the underlying model that the deployment is pinned toConfirm whether the provider takes an API version setting separately from the deployment name
Authentication identityThe API key, Microsoft Entra ID service principal or Azure CLI login that Azure accepts for the resourceCredential settings in the provider config or environment variables; confirm which method your CI runner supports
Grader or judge deploymentA second deployment used to score outputs with LLM-as-a-judge assertions or red team gradingSeparate grader provider entry pointing at its own deployment name; do not assume it inherits the target deployment
Common mistakePasting the model name, such as a GPT family name, into the field that expects the deployment nameResults in not-found or wrong-model errors; check the deployment name in the Azure portal first

Configuration sequence for connecting promptfoo to Azure OpenAI

This sequence takes a team from an unconfigured workstation to a full promptfoo suite running against Azure OpenAI, with a check at each stage so that connection problems surface early. Each step proves one thing before the next depends on it.

  1. Install a pinned promptfoo version

    An engineer installs one specific promptfoo release on the workstation or CI runner rather than a floating latest tag, and records that version in the repository. promptfoo requires Node.js 22.22.0 or newer, so confirm the Node runtime first. The step is done when the installed version prints from the command line and matches the version written in the project. Pinning keeps later result differences tied to your configuration rather than to tool upgrades.

  2. Create one deployment-level provider entry

    Add a single provider entry to the configuration that names one Azure OpenAI deployment. The name in the configuration must be the deployment name you created in the Azure resource, which may differ from the underlying model name, so copy it from the Azure portal rather than typing it from memory. Keep the resource endpoint and API key or authentication method in environment variables, not in the file. The entry is complete when the file contains exactly one provider and no secrets.

  3. Confirm the connection with one prompt

    Run a single prompt with a single test case against the test deployment. This is the first point where the endpoint, deployment name and credentials are exercised together, so a failure here usually points to one of those three. Check that the response is returned and that the output reflects the prompt you sent. Do not add assertions or more cases yet. The step is done when a one-case eval completes successfully and the result is visible in the output.

  4. Add the grader deployment

    If your assertions use a model-graded check, define a second deployment for the grader and reference it explicitly in the configuration instead of relying on defaults. Choose a grader that your data handling rules allow, and confirm which deployment in your Azure resource it maps to. Run a one-case eval that uses a model-graded assertion. The step is done when the grader returns a score and the result shows the grader deployment name you expect.

  5. Expand to the full suite

    Add the remaining test cases, prompts and assertions in stages, starting with the deployments and cases already proven. Run the full suite once and review failures to separate configuration problems, such as a missing deployment or rate limit errors, from genuine model behavior differences. Record the pinned version, deployment names and grader used alongside the results so the run can be repeated. The step is done when the full suite completes and every failure has been classified.

Azure CLI for developers, service principal for CI

On a developer machine, the simplest path is often to sign in with the Azure CLI and let promptfoo use that session. This avoids creating extra credentials for every engineer while they write and debug eval suites. The convenience carries a risk: the tests then run under a personal identity, which may hold far broader rights than the test deployment needs, and the activity appears in logs as that person's own actions. Treat the Azure CLI session as a fallback for exploration, not as the way evals reach production-like resources.

  • Use a dedicated test subscription or resource group: Point local runs at the test Azure OpenAI resource so that a mistake in a prompt or loop cannot touch production deployments.
  • Check what identity is active: Run the Azure CLI account show command before a long red team run so you know which user or service principal is signed in.
  • Ask for least-privilege roles: Request access that allows calling the specific deployments under test, and nothing about resource administration.
  • Keep personal sessions out of shared configs: Do not commit a config that relies on one engineer's login, because colleagues and CI will fail or quietly use the wrong identity.
  • Sign out after shared-machine use: On shared or borrowed laptops, clear the CLI session when finished.

Before relying on a local run for evidence, confirm which credential sources your installed promptfoo version reads and in what order, and record the identity used in the run.

Securing test traffic, keys and red team output

Testing Azure OpenAI with promptfoo sends real prompts, credentials and model responses through a cloud resource you pay for. The cards below cover the access, secret handling, traffic separation and output review that keep that test activity contained. Each one is a decision or check to settle before the first scheduled run.

Least-privilege role assignment

Grant the identity that runs promptfoo only the access it needs on the test resource, usually inference calls against the deployments under test. Avoid broad contributor or owner roles on the whole subscription, since a leaked CI credential would then reach resource management as well. Confirm the exact role names and their scope with your Azure administrator, and review assignments whenever a new deployment is added to the suite.

Service principal secrets outside config

Keep the service principal client secret in your CI secret store or a vault, and reference it through environment variables rather than writing it into promptfooconfig.yaml. Config files are committed, shared and copied into reports, so a secret placed there tends to outlive the test run. Check that verbose logs and eval output do not echo environment values, and rotate the secret on a schedule your security team sets.

Separate resource for red team traffic

Point red team scans at a deployment or resource that is separate from the one serving production users. Red team prompts are deliberately hostile, and their traffic, quotas and logs should not mix with customer traffic or inflate production usage. This also lets you apply stricter logging or rate limits to adversarial runs. Ask your Azure team which deployment names and quotas the test resource will hold.

Content filter settings and false failures

Azure OpenAI applies content filtering to prompts and completions, and a filtered response can arrive as an error or an empty or refusal-like output. In a red team run, that can look like a passing test when the model was in fact blocked, or like a failure in a benign eval. Record the filter configuration of each deployment, read Azure's content filter documentation for your model, and label filtered results separately in your reports.

Review of sensitive red team output

Red team reports can contain the attack prompts, the model's replies to them, and occasionally data echoed from your system prompt or retrieval sources. Restrict who can open these files, store them in an access-controlled location, and set a retention period that your data handling policy allows. Review a sample before sharing findings beyond the security team, and remove any real customer data that a test case reproduced.

Comparing Azure and OpenAI behaviour on the same suite

The point of running one suite against both an Azure OpenAI deployment and a direct OpenAI provider is to separate platform differences from model differences, and that only works if everything you control is held constant. Keep the prompts, test cases, assertions and grader identical on both sides. Use the same grading model for every run, because a different judge can shift scores more than the target model does. Then pin model versions on both sides so that a change in results cannot be blamed on a silent upgrade. On the Azure side, confirm the exact model and version behind each deployment name in the Azure model and version documentation before you attribute any difference to the platform. Record the provider blocks you used, including the deployment names, so the comparison can be reproduced later.

Expect differences that have nothing to do with the platform. Model versions may not match even when the names look alike, since Azure exposes its own version and retirement schedule. Default parameters such as temperature, maximum output tokens and system handling can differ unless you set them explicitly in the provider config, so set them yourself on both sides. Content filtering is configured per Azure resource and deployment, so a refusal or blocked response on Azure may come from the filter rather than the model. Regional availability and rate limits (tokens per minute and requests per minute quotas) can change timing, retries and error rates, which affects pass rates in runs that hit limits. Confirm each of these against your own Azure resource settings and quota, not against general assumptions.

Read the differences in the right order. First, check whether the model and version match. Second, check whether parameters and filter settings match. Third, look at error and retry counts, since throttling can make one side look worse for reasons unrelated to answer quality. Only then attribute remaining gaps in assertion results to model behaviour. Keep the Azure filter output and the promptfoo error logs with each run so a reviewer can see which failures were blocked, throttled or wrong. A comparison that cannot separate these causes is a finding about your setup, not about either platform.

Common Azure OpenAI failures in promptfoo and how to fix them

This table lists the failures teams most often hit when pointing promptfoo at Azure OpenAI, with the likely cause and the first check for each. Read it from the top when a run fails, and match the error to the row before changing configuration. The main takeaway is that most failures trace to the deployment name, the identity used at run time, or the API version, and each can be confirmed in minutes.

FailureLikely causeFirst check
Deployment not found (404)The model name, such as gpt-4o, was used where the deployment name from your Azure resource belongsCompare the provider ID with the deployment name listed under the resource in the Azure portal, and confirm the endpoint host matches that resource
Authentication fails only in CIThe service principal has no role assignment on the Azure OpenAI resource, or the wrong tenant or client secret is set in pipeline variablesConfirm the service principal holds an Azure AI or Cognitive Services role on that resource, and that the tenant ID and client ID match the principal
Azure CLI login stops working on a runnerThe CLI session was created interactively on a developer machine and has expired or was never created on the runnerRun a token request as the same user the runner uses, then switch the job to service principal credentials for unattended runs
Unexpected response format or unsupported parameterThe API version set in the provider does not match the features the deployment supportsCheck the API version string in your config against the version your deployment and SDK documentation specify, then test one request with it
Filtered responses counted as failuresAzure content filtering blocked the prompt or completion, so the response has no usable text for assertions to checkInspect the raw response for the content filter result, then decide whether the test expects a refusal or should be graded as blocked rather than failed
429 throttling during a large red team runThe scan sends more requests per minute than the deployment's quota allows, and retries add to the loadCheck the deployment quota and the concurrency setting, then lower concurrency or spread the scan across deployments before raising quota
Same suite passes on OpenAI and fails on AzureModel versions, content filter settings and default parameters differ between the two servicesPin the model version on both sides and diff the raw responses for one failing case before editing any assertion
Wrong region or endpoint returns errorsThe endpoint URL points at a different resource or region than the deployment being testedCopy the endpoint from the resource's keys and endpoint page and compare it with the base URL in your configuration

Questions teams ask before connecting promptfoo to Azure OpenAI

What drives the cost of testing Azure OpenAI with promptfoo?

The main costs are Azure consumption for test traffic, engineering time for authentication and deployment mapping, and the grader model you choose. promptfoo itself is MIT-licensed and the Community edition is free, so the software is not the line item to budget for. Azure charges depend on the models you call, the number of test cases, the number of runs in CI and whether red teaming generates many probes. Engineering time is largely one-time, covering service principal setup, deployment name mapping and a first suite. Ask your Azure administrator for current pricing on each model you plan to call, and estimate call volume from your suite size and run frequency before you commit to a schedule.

Does the grader model change what the testing costs?

Yes. When an assertion uses an LLM as a judge, every graded output produces an extra model call, so a larger or more expensive grader raises consumption on each run. Some teams grade with a model in the same Azure resource to keep data inside one boundary, while others use a self-hosted judge. The grader choice also affects result consistency, so test it on a small set of known good and bad answers before you rely on it. Record which grader and version produced each result so later comparisons stay valid.

How long does a first Azure OpenAI integration take?

Duration depends mainly on how many deployments and environments you connect, and on how many identity paths you need. A single deployment in one development environment with a working Azure CLI login is the shortest case. Each additional deployment needs its name mapped and tested, and each additional environment usually needs its own resource, role assignment and secret store entry. CI authentication with a service principal adds a separate setup and review step. Ask any partner for a written plan that lists these items so you can see which parts are fixed work and which depend on your environment.

What must our team provide before the work starts?

You need an Azure subscription with an OpenAI resource, the deployments you want to test, and a separate test resource so that evaluation traffic does not affect production quotas. Someone with permission to assign Azure roles must grant the test identity access to the resource, and that access should be limited to what the tests need. You also need a secret store, such as your existing vault or CI secret management, for service principal credentials. Confirm these items with your Azure and security teams first, since role assignment and secret handling are often the slowest approvals.

Can one in-house engineer set this up alone?

Often yes, for a single team with one Azure resource and a local test workflow. The work is mostly configuration: writing the provider settings, mapping deployment names, running a first suite and wiring CI. The harder parts are the Azure role assignments, which usually need an administrator, and getting secrets into CI safely. A second person from security or platform engineering is useful for reviewing the identity setup. If several teams, subscriptions or environments are involved, plan for more than one person so the configuration is consistent and documented.

Why do Azure deployment names and model names differ in promptfoo?

In Azure OpenAI, requests are routed to a deployment you created, which has its own name, while the model name describes the underlying model version. A test configured with a model name that is not the deployment name will fail even though the model exists. Check the deployment names in your Azure resource and use those names in the provider configuration. Keep a written mapping of deployment names to models so that a renamed deployment does not silently change what a suite measures.

What is free in the promptfoo Community edition?

The promptfoo Community edition is free and includes all LLM evaluation features, all model providers and integrations, and red teaming with 10k probes per month, with community support. Because promptfoo is MIT-licensed, you can also use the open-source software without a subscription. Team sharing, SSO, role-based access control, continuous monitoring and priority support with SLAs belong to the paid Enterprise edition, which is priced on request. If you need those features, ask the vendor for a quote and review what it includes before you plan your rollout.

How DeployOpen scopes and delivers promptfoo testing on Azure OpenAI

DeployOpen plans and delivers promptfoo test setups against Azure OpenAI deployments inside your own environment. We agree the scope in writing first, then build the provider configuration, authentication and comparison suites, and hand over documented runs your team can repeat in its own pipelines.

How we scope

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • We confirm which Azure OpenAI resources, deployment names and regions the written scope covers.
  • We agree whether the work is evaluation, red teaming or both, and which OpenAI comparison targets are included.

How we build

  • We configure promptfoo providers that map deployment names to the models you actually run.
  • We set up service principal authentication for CI runners and a documented Azure CLI path for local work.
  • We build one shared suite that runs against Azure and OpenAI so behaviour differences are visible and attributable.

How we hand over

  • You receive version-controlled configuration, environment variable documentation and a runbook for adding deployments.
  • Test results, known gaps and the steps needed to rerun the suite are documented for your security and compliance reviewers.
  • We walk your engineers through the pipeline setup so your team can operate the tests without us.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover promptfoo version upgrades, changes to Azure deployments and refreshed test coverage.
  • Support scope and response expectations are written into the agreement, so you know what is included.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.