I am currently running into an issue trying to establish an AzureOpenAI connection.
I have properly logged into my azure account using the “az login” command and am trying to establish a connection to my AzureOpenAI subscription through Microsoft’s chat-basic flow found in their github.
I have appropriately replaced the “name” and “api_base” per below, and hit Create Connection. I receive an error in the terminal and no prompt comes up for me to enter my api_key:
AzureOpenAI connection
As well, I have colleagues who have entered the same credentials and they were able to successfully receive a prompt to enter their api_key.
Here is the error I receive:
File "c:Users<USERFOLDER>.vscodeextensionsprompt-flow.prompt-flow-1.20.0pfutil_pf_vsc_connection.py", line 52, in upsert_connection
upsert_connection_new(args)
File "c:Users<USERFOLDER>.vscodeextensionsprompt-flow.prompt-flow-1.20.0pfutil_pf_vsc_connection.py", line 65, in upsert_connection_new
connection = _upsert_connection_from_file(args.file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflow_cli_pf_connection.py", line 224, in _upsert_connection_from_file
existing_connection = _get_pf_client().connections.get(connection.name, raise_error=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflow_sdk_telemetryactivity.py", line 265, in wrapper
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflow_sdkoperations_local_azure_connection_operations.py", line 111, in get
return self._get(name, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflow_sdkoperations_local_azure_connection_operations.py", line 130, in _get
return ArmConnectionOperations._direct_get(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflowazureoperations_arm_connection_operations.py", line 62, in _direct_get
return _Connection._from_core_connection(provider.get(name=name))
^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflowcore_connection_provider_workspace_connection_provider.py", line 461, in get
connection_dict = self._build_connection_dict(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflowcore_connection_provider_workspace_connection_provider.py", line 336, in _build_connection_dict
rest_obj: WorkspaceConnectionPropertiesV2BasicResource = cls.open_url(
^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflowcore_connection_provider_workspace_connection_provider.py", line 148, in open_url
raise OpenURLFailedUserError(
promptflow.core._errors.OpenURLFailedUserError: Open url /subscriptions/<My Subscription Credentials>/providers/Microsoft.MachineLearningServices/workspaces/<My Workspace>/connections/<My API Name>/listsecrets?api-version=2023-04-01-preview failed with status code: 401, action: listsecrets, reason: Unauthorized
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:Users<USERFOLDER>.vscodeextensionsprompt-flow.prompt-flow-1.20.0pfutilpfutil.py", line 4, in <module>
main()
File "c:Users<USERFOLDER>.vscodeextensionsprompt-flow.prompt-flow-1.20.0pfutil_pf_vsc_main.py", line 37, in main
operate_connection(args)
File "c:Users<USERFOLDER>.vscodeextensionsprompt-flow.prompt-flow-1.20.0pfutil_pf_vsc_connection.py", line 29, in operate_connection
upsert_connection(args)
File "c:Users<USERFOLDER>.vscodeextensionsprompt-flow.prompt-flow-1.20.0pfutil_pf_vsc_connection.py", line 58, in upsert_connection
connection = ConnectionOperations().create_or_update(connection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflow_sdk_telemetryactivity.py", line 265, in wrapper
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflow_sdkoperations_connection_operations.py", line 87, in create_or_update
orm_object = connection._to_orm_object()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflow_sdkentities_connection.py", line 247, in _to_orm_object
secrets = self._validate_and_encrypt_secrets()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Users<USERFOLDER>AppDataRoamingPythonPython311site-packagespromptflow_sdkentities_connection.py", line 116, in _validate_and_encrypt_secrets
raise ValidationException(
promptflow.exceptions.ValidationException: Connection '<My API Name>' secrets ['api_key'] value invalid, please fill them.
So I was just wondering if anyone has run into a similar issue and where I could troubleshoot this further?
I have tried reinstalling my anaconda and VS Code and all my prompt code extensions, making sure everything is up to date.
MakE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.