asc.core.services_ai_foundry role – Deploy an Azure AI Foundry environment

Note

This role is part of the asc.core collection (version 2.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: git clone git@ssh.dev.azure.com:v3/cloudasc/iac-ansible-collections/core $HOME/.ansible/collections/ansible_collections/asc/core.

To use it in a playbook, specify: asc.core.services_ai_foundry.

Entry point main – Deploy an Azure AI Foundry environment

New in asc.core 2.0.0

Synopsis

  • Deploys a self-contained Azure AI Foundry environment in its own dedicated resource group so its networking stays isolated from the rest of the deployment.

  • Provisions the modern Foundry resources - an AIServices cognitive account (the Foundry resource) plus a Foundry project - and a configurable set of model deployments.

  • Private by default (a dedicated vnet with a private endpoint, peered to the core vnet); public access can be enabled and is then restricted to an IP allowlist and protected by the account API key.

  • Adds change-detection alerting (any administrative write/delete in the resource group) and cost budget alerts, both emailing the users tagged ai_alert in users.csv.

  • The account endpoint and primary API key are exposed as deploy outputs.

Parameters

Parameter

Comments

services_ai_foundry

dictionary

added in asc.core 2.0.0

AI Foundry module configuration.

alert_at_percent

integer

Email a cost alert at this percentage of cost_ceiling_usd.

Default: 80

cost_ceiling_usd

integer

Monthly cost ceiling in USD for the account. One limit, used for both the budget alerts and the key-rotation kill-switch.

Default: 100

enabled

boolean

Whether to deploy the AI Foundry module.

Choices:

  • false ← (default)

  • true

guardian_interval_minutes

integer

How often (in minutes) the guardian Logic App checks month-to-date spend. Lower reacts faster to a breach; higher reduces Logic App run cost.

Default: 1

ip_allowlist

list / elements=string

IP addresses or CIDR blocks allowed to reach the public endpoint when public_access is true.

Default: []

kill_at_percent

integer

Hard-stop (regenerate the account keys - preserving logs/data) at this percentage of cost_ceiling_usd. Enforced near-real-time by the guardian Logic App (exact per-model cost from the metrics API); a lagged, price-independent cost budget provides a backstop kill at 100 percent of the ceiling.

Default: 90

location

string

Azure region for the dedicated resource group and account. Defaults to the deployment region.

models

list / elements=dictionary

Models to deploy on the account, each as its own deployment.

To discover deployable models/versions/SKUs for your region before deploying, run az cognitiveservices model list --location <region> --query "[].{model:model.name, version:model.version, skus:join(',', model.skus[].name}” -o table). A listed version can still be blocked for new deployments once Azure retires it, so prefer the current/default version. Once an account exists, az cognitiveservices account list-models -g <rg> -n <account> shows exactly what it can deploy. See Azure AI Foundry for the full workflow and how output-token pricing is resolved.

Default: []

capacity

integer

Optional throughput ceiling in Tokens-Per-Minute, in thousands (for example 50 means 50,000 TPM). Bounds burst rate only; defaults high so bursts are not throttled. Monthly spend is capped by the kill-switch, not by this.

Default: 50

format

string

Model provider/format (for example OpenAI, Meta, Mistral AI, DeepSeek).

Default: "OpenAI"

model

string / required

Model name (for example gpt-4o).

name

string / required

Deployment name (how the model is addressed in API calls).

price_per_1k_tokens_usd

float

Override the automatically pulled output-token price (USD per 1,000 tokens) used to compute this model’s exact cost against cost_ceiling_usd. Set this when the price cannot be resolved automatically (for example DeepSeek or Anthropic models).

sku

string

Deployment SKU (for example GlobalStandard, Standard, DataZoneStandard).

Default: "GlobalStandard"

version

string

Model version. Defaults to the current default version for the model when unset.

pe_subnet_cidr

string

Subnet used for the private endpoint.

Default: "10.60.0.0/26"

peer_to_core

boolean

Peer the dedicated vnet to the core vnet (and link the private DNS zones to it) so the rest of the environment can reach the private endpoint.

Choices:

  • false

  • true ← (default)

private_endpoint

boolean

Deploy a dedicated vnet and a private endpoint for the account (private access).

Choices:

  • false

  • true ← (default)

public_access

boolean

Allow public network access. Even when enabled the endpoint stays default-deny, restricted to ip_allowlist and protected by the account API key.

Choices:

  • false ← (default)

  • true

sku

string

SKU of the Cognitive Services (AIServices) account.

Default: "S0"

vnet_cidr

string

Address space of the dedicated vnet.

Default: "10.60.0.0/24"

Authors

  • Ignace De Cock