web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error: "Label and key ...
Power Automate
Unanswered

Error: "Label and key in API Key can not be empty" when creating custom connector

(0) ShareShare
ReportReport
Posted on by 17

I am stuck trying manually create a custom connector from an Azure Function, but I get an error message of "Label and key in API Key can not be empty".  In the Security section of the Custom Connector wizard, I set the Authentication Type as "API Key".  And I set the Parameter Label to "APIKEY", Parameter Name="code" and Parameter Location="Query".  The error message occurs when I click the Create Connector button.  

 

I'm curious what this error message is actually refering to?  Is it something in my Swagger defintion (see below) or the configuration of the connector?

APIKEY.png

 

 

swagger: '2.0'
info:
title: docfluixdemofunctionapp.azurewebsites.net
version: 1.0.0
schemes:
- https
host: docfluixdemofunctionapp.azurewebsites.net
basePath: /
paths:
/api/GetPerDiemByZip:
post:
operationId: GetPerDiemByZip
summary: Get Hotel and Meal Per Diem amounts from GSA
description: GSA Per Diem
x-ntx-summary: GSA Per Diem
x-ms-summary: GSA Per Diem
x-ms-visibility: important
produces:
- application/json
consumes:
- application/json
parameters:
- name: body
in: body
description: Zipcode and Tripdate to query Per Diem amounts from GSA
x-ntx-summary: Zipcode and Tripdate
x-ms-summary: Zipcode and Tripdate
x-ms-visibility: important
required: true
schema:
type: object
properties:
Zip:
type: string
description: Zip code for primary destination of the trip
x-ntx-summary: Zip code
x-ms-summary: Zip code
x-ms-visibility: important
TripDate:
type: string
description: Date of the first day of the trip
x-ntx-summary: Trip Start Date
x-ms-summary: Trip Start Date
x-ms-visibility: important
responses:
'200':
description: Returns Per Diem Amounts for Hotel and Meals
x-ms-summary: Per Diem Amounts
schema:
type: object
properties:
Hotel:
type: number
description: Allowed Hotel Per Diem
x-ntx-summary: Hotel
x-ms-summary: Hotel
Meals:
type: number
description: Allowed Meals Per Diem
x-ntx-summary: Meals
x-ms-summary: Meals
security:
- apikeyQuery: []
definitions: {}
securityDefinitions:
apikeyQuery:
type: apiKey
name: code
in: query
Categories:
I have the same question (0)
  • Verified answer
    v-micsh-msft Profile Picture
    on at

    Hi @TomCastiglia1,

     

    How you created the custom connector, from the OpenAPI file directly?

    The security Parameter location part would be auto-generated once you uploaded the swagger.

    In addition to that, would you please share more details about the Definition page of the custom Connector?

    I think the error message should be mostly related with the Definition->Request->Query field.

     

     

    Besides, please take a try with the method mentioned in the article below to generate the swagger for your Azure function, then use that to create the custom connector:

    "

    1.Navigate to â€˜API definition’section of your Function App. You will see an XML structure representing swagger definition. 

    2. Copy API definition URL somewhere.

    3. Navigate to your Microsoft Flow account (https://flow.microsoft.com). Open Connections:

    4. Create a new Custom Connector using the API definition URL that you copied earlier:

    "

     Here is a reference.

     

    Regards,

    Michael

  • TomCastiglia1 Profile Picture
    17 on at

    Michael -

     

    Yes, I imported the Open API definition file directly.  Initially, I tried it with the URL, but this casued an error: "Unable to download OpenAPI from specified URL", so I switched to uploading the definitition file itself.  I'm not sure why the URL approach failed, because if I navigate to the URL in the browser it displays the definition as JSON.  That is what I saved locally and uploaded in lieu of the URL.

     

    The steps I followed are essentially the same as what is described in your reference below (exept I used the Upload OpenAPI file option instead of the URL).

     

    I would like to resolve the URL issue as well.  Note that when I used the Express import option from Azure Functions, that worked perfectly with this Azue Function. 

     

    But I would like to know how to use the manual approach.  I have successfully used the manual approach before, but that was with a different function from a different Azure tenant.

     

    I will review the "Definition->Request->Query field" in more detail.  If you have more details about what to look for with that, please advise.

     

    Thank You!

     

    Tom Castiglia

  • TomCastiglia1 Profile Picture
    17 on at

    Michael -

     

    Also, here is a screenshot from the Definition Request.

     

    image.png

     

    I went to the Import from Sample and updated the URL from /api/GetPerDiemByZip to /api/GetPerDiemByZip?code={APIKEY}. So now the query section looks like this:  

    image.png

     

    However, I still get the same error: Label and key in API Key can not be empty

     

    Any other suggestions?

     

    Regards,

     

    Tom Castiglia

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard