Skip to content

Commit

Permalink
[Doc] Update connection doc (#2256)
Browse files Browse the repository at this point in the history
# Description

Please add an informative description that covers that changes made by
the pull request and link all relevant issues.

# All Promptflow Contribution checklist:
- [ ] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [ ] Title of the pull request is clear and informative.
- [ ] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.

Signed-off-by: Brynn Yin <[email protected]>
  • Loading branch information
brynn-code authored Mar 7, 2024
1 parent 083ef4f commit 90a4838
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/cloud/azureai/consume-connections-from-azure-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

For a smooth development flow that transitions from cloud (Azure AI) to local environments, you can directly utilize the connection already established on the cloud by setting the connection provider to "Azure AI connections".

:::{note}
Promptflow is not able to manage connections from Azure AI, please manage it in workspace portal, [Azure AI Studio](https://learn.microsoft.com/en-us/azure/ai-studio/how-to/connections-add), az ml cli or azure-ai-ml sdk.
:::

You can set the connection provider using the following steps:

1. Navigate to the connection list in the VS Code primary sidebar.
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/manage-connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is an experimental feature, and may change at any time. Learn [more](faq.md
[Connection](../../concepts/concept-connections.md) helps securely store and manage secret keys or other sensitive credentials required for interacting with LLM (Large Language Models) and other external tools, for example, Azure Content Safety.

:::{note}
To use azureml workspace connection locally, refer to [this guide](../how-to-guides/set-global-configs.md#connectionprovider).
This document target for manage connections locally. To use Azure AI connections locally, refer to [this guide](../cloud/azureai/consume-connections-from-azure-ai.md).
:::

## Connection types
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/set-global-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ When `get` or `list` connections, `PFClient`(or `pf connection` commands) will r
_Secrets for workspace connection will not be shown by those commands, which means you may see empty dict `{}` for custom connections._

:::{note}
Command `create`, `update` and `delete` are not supported for workspace connections, please manage it in workspace portal, az ml cli or AzureML SDK.
Command `create`, `update` and `delete` are not supported for workspace connections, please manage it in workspace portal, [Azure AI Studio](https://learn.microsoft.com/en-us/azure/ai-studio/how-to/connections-add), az ml cli or azure-ai-ml sdk.
:::


Expand Down
1 change: 1 addition & 0 deletions src/promptflow/promptflow/_sdk/entities/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def __init__(
source: Optional[Union[Path, str]] = None,
**kwargs,
):
# !!! Caution !!!: Please update self._copy() if you add new fields to init
# TODO: remove when RUN CRUD don't depend on this
self.type = kwargs.get("type", RunTypes.BATCH)
self.data = data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
from promptflow._sdk._telemetry import ActivityType, WorkspaceTelemetryMixin, monitor_operation
from promptflow._sdk._utils import interactive_credential_disabled, is_from_cli, is_github_codespaces, print_red_error
from promptflow._sdk.entities._connection import _Connection
from promptflow._utils.logger_utils import get_cli_sdk_logger
from promptflow._utils.credential_utils import get_default_azure_credential
from promptflow.azure._utils.general import get_arm_token
from promptflow._utils.logger_utils import get_cli_sdk_logger

logger = get_cli_sdk_logger()

Expand Down Expand Up @@ -49,6 +48,8 @@ def _client(self):
def _get_credential(cls):
from azure.identity import DefaultAzureCredential, DeviceCodeCredential

from promptflow.azure._utils.general import get_arm_token

if is_from_cli():
try:
# Try getting token for cli without interactive login
Expand Down

0 comments on commit 90a4838

Please sign in to comment.