CLI (v2) OpenAI connection YAML schema

APPLIES TO: Azure CLI ml extension v2 (current)

Note

The YAML syntax detailed in this document is based on the JSON schema for the latest version of the ML CLI v2 extension. This syntax is guaranteed only to work with the latest version of the ML CLI v2 extension. You can find the schemas for older extension versions at https://azuremlschemasprod.azureedge.net/.

YAML syntax

Key Type Description Allowed values Default value
$schema string The YAML schema. If you use the Azure Machine Learning Visual Studio Code extension to author the YAML file, include $schema at the top of your file to invoke schema and resource completions.
name string Required. The connection name.
description string The connection description.
tags object The connection tag dictionary.
type string Required. The connection type. open_ai open_ai
is_shared boolean true if the connection is shared across other projects in the hub; otherwise, false. true
api_key string Required. The API key used to authenticate the connection.

Remarks

This schema is used to create a connection to the non-Microsoft OpenAI service. For information on the schema used to connect to Azure OpenAI, see the Azure OpenAI connection schema.

While the az ml connection commands can be used to manage both Azure Machine Learning and Azure AI Studio connections, the OpenAI connection is specific to Azure AI Studio.

Examples

These examples would be in the form of YAML files and used from the CLI. For example, az ml connection create -f <file-name>.yaml.

YAML: API key

name: open_ai_conn
type: open_ai
api_key: "1234467"

Next steps