Issue establishing AzureOpenAI Connection through VS Code Prompt Flow

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:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> 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.
</code>
<code> 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. </code>
  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.

New contributor

MakE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật