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 / Cloud Flow - downloadi...
Power Automate
Suggested Answer

Cloud Flow - downloading files from local URL

(3) ShareShare
ReportReport
Posted on by 53

I would like to understand whether a specific scenario can be implemented using Power Automate Cloud Flows only, without relying on Power Automate Desktop (RPA).

The goal is to programmatically access a local (on‑premises) URL that belongs to an internal enterprise application and opens a file which i want to save on sharepoint.

When this URL is opened manually in a browser within the internal network, it either displays a document (such as a PDF) or directly triggers a file download (for example a Word document or another attachment). 

As an example the URL might look like the following:
https://internal-app.example-company.com/application?cmd=DocumentCommand.getReadAttachment&id=6484&processId=0

The application is not publicly accessible and requires authentication before the URL can be used. Calling the document URL directly in the browser without an authenticated session fails. Therefore in the manual process you first have to visit a login screen and use basic user credentials or click a "Without Registration" Button. The you can open the download link (is this based on session cookies?).

So far, I have not found a suitable standard connector for this scenario, because all available HTTP connectors do not support the On‑Premises Data Gateway and therefore cannot be used to access local URLs.

My question is whether this can be implemented using a Custom Connector instead. If so, how would authentication and session handling (cookies) be implemented in such a case? Or are there other recommended ways to achieve this scenario with Power Automate Cloud Flows only?

Thank you
Categories:
I have the same question (0)
  • Suggested answer
    Vish WR Profile Picture
    3,748 on at
    Hi @LuITS
     

    If you have an on-premises resource that you need to integrate with, you should use the On-premises Data Gateway to connect your on-premises system with Power Automate.

    Example:

    If you have an internal SharePoint permission platform and want to build a workflow to automate processes, you would use the data gateway to enable that integration.

    Without a gateway or internet-exposed API, Cloud Flows alone cannot directly access internal network URLs or systems.

     
     
     
  • Vish WR Profile Picture
    3,748 on at
     
    If you want more information/clarification on the data gateway, you can reach out to me 
     
      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 
     
     
     
  • Suggested answer
    Haque Profile Picture
    3,653 on at
    Hi @LuITS,
     

    Apparently, accessing a local (on-premises) URL from an internal enterprise application programmatically and saving the resulting file to SharePoint using only Power Automate Cloud Flows is generally not feasible because:

    • Power Automate Cloud Flows run in the cloud and cannot directly access on-premises resources or URLs that are not exposed to the internet.
    • Accessing internal enterprise applications or local URLs typically requires network access within the corporate environment, which cloud flows do not have by default.

    One work around might be: Use On-Premises Data Gateway

    • If the internal application exposes data or files via a database, API, or file share, you can use the On-Premises Data Gateway to connect Power Automate Cloud Flows to those resources.
    • This requires the internal resource to be accessible via supported connectors or custom connectors through the gateway.
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!

     

  • LuITS Profile Picture
    53 on at
    @Vish WR@Haque

    Thanks. I have an on premises data gateway set up. And as I mentioned, I already figured that it would only work that way.

    Can you walk me through how to implement this using a custom connector that calls this URL and reads the files?
  • Suggested answer
    Vish WR Profile Picture
    3,748 on at
     
    If you want to use the custom connector approach, then your source system https://internal-app.example-company.com should expose an API in the internet zone. If it's in an intranet zone, Power Platform cannot reach your API.
     
    Option 1: Use the Data Gateway to communicate with your system 
    Option 2: Your https://internal-app.example-company.com should support an internet-facing API for a custom connector.
     
    I am not an Azure expert. If your system is an intranet, and routing traffic via the Azure public firewall / forward proxy might do the trick.  Or leveraging the API gateway to have a bridging  API Sharing this with little knowledge i have on Azure  
     
     
      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 
     
     
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
    Hi @LuITS,
     
    Yes, this can be done with a Cloud Flow only using a Custom Connector with the on-premises data gateway. Here is the full picture.
    Why the standard HTTP connector does not work: You are correct. The standard HTTP action in Power Automate does not support the on-premises data gateway, so it cannot reach internal URLs that are not publicly accessible.
     
    The solution: Custom Connector + On-Premises Data Gateway

    Microsoft docs confirm that custom connectors support private APIs through the on-premises data gateway. The gateway is installed on a machine inside your network, acts as a relay between the cloud flow and your internal application, and proxies the HTTP requests securely.
     
    How to set it up:

    1. Install the on-premises data gateway on a server inside your internal network that can reach internal-app.example-company.com
    2. Create a custom connector in Power Automate pointing to your internal app base URL
    3. In the custom connector wizard, enable the Connect via on-premises data gateway option
    4. Define your actions (the login endpoint and the document download endpoint)
    5. When creating the connection in your flow, select the gateway you installed
     
    Handling cookie-based authentication
    This is the tricky part. Custom connectors support standard auth methods (Basic, API key, OAuth 2.0) but do not have native cookie session management. Your scenario appears to use a session cookie after a login step.
     
    The approach here is:
    - Define two actions in your custom connector: one for the login POST request, one for the document GET request
    - In the login action, capture the Set-Cookie response header
    - Pass the session cookie value manually as a Cookie header in your document download action
    This requires the login endpoint to return a predictable cookie name you can extract. You would use the HTTP response headers output from the login action and parse out the session cookie value using an expression, then inject it into the document request.
    If the application uses Basic authentication you can skip the cookie step entirely and just pass credentials directly in the Authorization header of the document request.
     
    Limitations to be aware of:

    - Custom connector cookie handling is manual, not automatic like a browser session
    - Binary file responses (PDF, Word) need to be handled carefully. Make sure the action is configured to return binary/file content and not text
    - The gateway must remain running on the on-premises machine for the flow to work
     
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • Valantis Profile Picture
    6,735 on at
    Hi @LuITS,

    Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

     

    Thanks and have a great day!

  • LuITS Profile Picture
    53 on at
    [removed]
  • LuITS Profile Picture
    53 on at
    @Valantis
     
    Thanks i tried to build a custom connector. Specifics below. But i am not able to get the session cookies. Could you maybe further assist me?

    Using:

    Security:
    Authentication type -> No Authentication
    (Because the cookies are set on the login site where i don't necessarily need to login and can choose "Enter without login")

    Request:
    GET
    https://internal-app.example-company.com/internal-app/login
    (This is the link were im routet to a login page in the Browser, where i can see with developer tools, a Response Header with Set-Cookie: JSESSIONID=34234......;)

    Response Headers:
    Set-Cookies string

    Testing the Connector gives me in the header

    {
    "cache-control": "no-cache,no-store",
    "content-encoding": "gzip",
    "content-type": "text/html; charset=UTF-8",
    "date": "Wed, ......1 GMT",
    "expires": "-1",
    "p3p": "CP='CAO PSA OUR'",
    "pragma": "no-cache",
    "strict-transport-security": "max-age=31xxx00; includeSubDomains",
    "vary": "Accept-Encoding",
    "x-content-type-options": "nosniff",
    "x-frame-options": "DENY",
    "x-ms-apihub-cached-response": "false",
    "x-ms-apihub-obo": "false",
    "x-ms-au-caller-id": "0xxxxx-cxxx-4xxeb-axxf-acxxxxxxx1c20",
    "x-ms-au-creator-id": "00xxxxc-cxxx-4xxeb-a6xx-axx6xxxx1c20",
    "x-ms-connection-gateway-object-id": "4xxxxx7x1-xxxx-xxxx-xxxx-4xxxxxx0a4a6",
    "x-ms-dlp-ef": "-|-/-|-|-|-|-",
    "x-ms-dlp-gu": "-|-",
    "x-ms-dlp-re": "-|-|-",
    "x-ms-environment-id": "xxxxx65-1xx9-exx6-bxx9-3xxxxxxxa",
    "x-ms-mip-sl": "-|-|-|-",
    "x-ms-request-id": "bfxxxxx3-bxxx2-4xx1-8xxxxxxxxxe",
    "x-ms-tenant-id": "9xxxxx5-cxx7-4xx1-9xxx7-axxxxxxxxd",
    "x-robots-tag": "noindex,nofollow"
    }

    Body is empty

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard