Files
wehub-resource-sync e768098d0e
tools_continuous_delivery / Private PyPI non-main branch release (push) Has been skipped
tools_continuous_delivery / Private PyPI main branch release (push) Failing after 2m42s
Publish Promptflow Doc / Build (push) Has been cancelled
Publish Promptflow Doc / Deploy (push) Has been cancelled
Flake8 Lint / flake8 (push) Has been cancelled
Spell check CI / Spell_Check (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:39:52 +08:00

47 lines
1.6 KiB
Markdown

# Working with Connection
This folder contains example `YAML` files for creating `connection` using `pf` cli. Learn more on all the [connections types](https://microsoft.github.io/promptflow/concepts/concept-connections.html).
## Prerequisites
- Install promptflow sdk and other dependencies:
```bash
pip install -r requirements.txt
```
## Get started
- To create a connection using any of the sample `YAML` files provided in this directory, execute following command:
```bash
# Override keys with --set to avoid yaml file changes
pf connection create -f custom.yml --set configs.key1='<your_api_key>'
pf connection create -f azure_openai.yml --set api_key='<your_api_key>'
```
- To create a custom connection using an `.env` file, execute following command:
```bash
pf connection create -f .env --name custom_connection
```
- To list the created connection, execute following command:
```bash
pf connection list
```
- To show one connection details, execute following command:
```bash
pf connection show --name custom_connection
```
- To update a connection that in workspace, execute following command. Currently only a few fields(description, display_name) support update:
```bash
# Update an existing connection with --set to override values
# Update an azure OpenAI connection with a new api base
pf connection update -n open_ai_connection --set api_base='<your_api_base>'
# Update a custom connection
pf connection update -n custom_connection --set configs.key1='<your_new_key>' secrets.key2='<your_another_key>'
```
- To delete a connection:
```bash
pf connection delete -n custom_connection
```