I’m working on my first promptflow project and need to connect it to an Azure AI Language resource for entity recognition and key phrase extraction. I already created the Language Resource in Azure and set up my VSCode environment with the Azure Language package installed.
The problem happens when I add a Language node to my flow and try to create a connection. I’m using the Custom Connection template that looks like this:
# Configuration notes:
# - Keep '<user-input>' placeholder unchanged, the app will ask for values at runtime
# - Save manually to create connection after validation
# - Connection data stored locally with encrypted api_key
# - PromptFlow only uses connection info when you tell it to
# - All values must be strings: use "123" not 123, "True" not True
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/CustomConnection.schema.json
name: "connection_name_here"
type: custom
configs:
setting1: "value1"
secrets:
# Keep '<user-input>' placeholder as is
setting2: "<user-input>"
Based on the documentation, I think I need to put my Azure Language Service Endpoint in setting1 under configs, and the Key from my Azure service in setting2 under secrets. But when I fill in both values, I get an error saying setting2 must stay empty. When I only fill the endpoint and leave setting2 as empty string, clicking “Create Connection” in VSCode gives me this terminal error:
ModuleNotFoundError: No module named 'azure.ai'
Traceback (most recent call last):
File "pfutil.py", line 4, in <module>
main()
File "pf_vsc_main.py", line 37, in main
operate_connection(args)
File "pf_vsc_connection.py", line 58, in upsert_connection
connection = ConnectionOperations().create_or_update(connection)
File "connection.py", line 885, in _to_orm_object
encrypted_secrets = self._validate_and_encrypt_secrets()
ValueError: Connection secrets value invalid, please fill them.
I’m sure this is something obvious I’m missing. Can someone help me figure out what I’m doing wrong?
Those error messages scream environment setup problems, but you’re overcomplicating this.
Skip the PromptFlow connection headaches and package dependency hell - automate the whole workflow instead. I’ve built entity recognition and key phrase extraction pipelines that hit Azure Language Service without any manual connection setup.
You can create a flow that handles Azure auth automatically, processes text through Language Service APIs, and chains operations together. No YAML configs or connection errors.
Set up triggers for incoming documents, handle batch processing, add error handling and retry logic. Everything runs smoothly without local environment issues or missing packages.
Way cleaner than debugging PromptFlow templates and wrestling with encrypted secrets.
had the same issue! replace <user-input> with your actual api key - it can’t be empty. also, ensure that you have the azure-ai-language package installed, not just the standard azure. that ModuleNotFound error usually indicates a package mismatch.
Your YAML config structure is the problem. You can’t use generic setting1/setting2 - you need specific key names that match what the Language node expects. Try this:
Replace <user-input> with your actual API key from Azure portal when creating the connection. The Language node looks for ‘endpoint’ and ‘api_key’ as parameter names. Also check you’ve got azure-ai-textanalytics installed instead of just azure-ai-language - the package naming’s confusing but textanalytics is what most Language Service operations actually need.
Parameter names matter way more than you’d expect. I fought with this same setup last month and found that Language Service operations are picky about connection formats. Sure, others use api_base and api_key, but I got it working with the Azure OpenAI connection format - turns out it works for Language Service too:
Use azure_endpoint and azure_api_key as your parameter names. This worked reliably for both entity recognition and key phrase extraction in my flows. Double-check you’re grabbing the key from the right spot in Azure portal - there’s usually two keys and sometimes one plays nicer with PromptFlow than the other.
Been through this exact mess before when I had to integrate Language Service with PromptFlow for a document processing pipeline. The error combo you’re seeing is classic - part authentication, part package issue.
First, dump that generic template. Language Service connections need specific parameter names. Your YAML should look like:
Learned this the hard way after spending hours with mismatched package versions. The Language Service operations actually live in the textanalytics package, not the language one.
This video walks through the VS Code setup step by step if you want to double check your environment:
Once you get the connection working, test it with a simple text sample before building your full flow. Saves debugging time later when things get complex.