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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to use environm...
Power Automate
Suggested Answer

Unable to use environment variable in custom connector

(0) ShareShare
ReportReport
Posted on by 6
Steps to use environment variables in custom connector is provided in docs here: Use environment variables in solution custom connectors | Microsoft Learn

However, I am getting following error even though following every step in the article
The request failed with client error: 'Invalid Api definition object. Please specify a valid Swagger 2.0 Url and valid list of ServiceUrls.'. The correlation Id is '3abc1c0f-633a-4361-8fb6-37b7bdece90b'.
 
This is my swagger of the custom connector
swagger: '2.0'
info:
  title: ProQuote - Data Integration
  description: ''
  version: '1.0'
host: '@environmentVariables(''pcw_DATAIntegrationCustomConnectorHost'')'
basePath: /ttpm
schemes:
  - http
 
I can attest to the fact that the environment variable exists
Categories:
I have the same question (0)
  • Suggested answer
    Vish WR Profile Picture
    892 on at
     
    can you try this and see if it works 
     
    swagger: '2.0'
    info:
      title: ProQuote - Data Integration
      version: '1.0'
    basePath: /ttpm
    schemes:
      - https
    paths:
      /quotes:
        get:
          operationId: GetQuotes
          responses:
            200:
              description: Success

    Then set host via environment variable in connector UI (not in Swagger).
     
     
     
      Vishnu WR
     
    Please âœ… Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like â™¥
     
     
     
  • MM-02040739-0 Profile Picture
    6 on at
    I am setting from the connector UI only, pasted swagger for reference
  • 11manish Profile Picture
    1,300 on at
    I believe that you cannot use environment variables in Swagger host
     
     Fix by:
    • Use static placeholder host in Swagger
       
  • MM-02040739-0 Profile Picture
    6 on at
    Again, doesnt help; its documented that environment variables can be used and i am exactly following those steps
  • Vish WR Profile Picture
    892 on at
     
    Swagger is only for definition.  Can you share with us the link to the documentation?
     
  • MM-02040739-0 Profile Picture
    6 on at
  • Vish WR Profile Picture
    892 on at
    Document states we can use an environment variable, which is correct, but what we say here dont use the environment variable in the swagger definition.
     
    environment variable can be used on other places like client id , sec etc 
     
     
     
      Vishnu WR
     
    Please âœ… Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like â™¥
     
     
     
  • Vish WR Profile Picture
    892 on at
     
    Swagger UI does not support path templating, and should be a valid host. Please find the link below for reference 
     
     
     
     
      Vishnu WR
     
    Please âœ… Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like â™¥
     
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 600

#2
Valantis Profile Picture

Valantis 453

#3
11manish Profile Picture

11manish 356

Last 30 days Overall leaderboard