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 / Flow with “Run Script ...
Power Automate
Unanswered

Flow with “Run Script (Excel Online)” action fails to enable after deployment to managed solution

(1) ShareShare
ReportReport
Posted on by 6

Title: Issue enabling flow with “Run script” action after deploying solution to managed environment

 

Description:

Hi,

I’m facing an issue while deploying a flow that uses the Run script (Excel Online) action from a development environment to a client’s managed environment.

Error:
Flow save failed with code 'MultipleErrorsOccurred' and message 'The dynamic operation request to API 'excelonlinebusiness' operation 'GetSingleScript' failed with status code 'NotFound'. This may indicate invalid input parameters. Error response: { "status": 404, "message": "Script not found. It may have been unshared or deleted.\r\nclientRequestId: 0d036ccd-7d73-4b07-abf0-7d4c921c72a8", "error": { "message": "Script not found. It may have been unshared or deleted." }, "source": "excelonline-uks.azconn-uks-002.p.azurewebsites.net" };The dynamic operation request to API 'excelonlinebusiness' operation 'GetSingleScript' failed with status code 'NotFound'. This may indicate invalid input parameters. Error response: { "status": 404, "message": "Script not found. It may have been unshared or deleted.\r\nclientRequestId: 0d036ccd-7d73-4b07-abf0-7d4c921c72a8", "error": { "message": "Script not found. It may have been unshared or deleted." }, "source": "excelonline-uks.azconn-uks-002.p.azurewebsites.net" }'.Upgrade 
 
Screenshots: 


Scenario:


  • Flow was developed in a Dev environment (unmanaged)

  • Solution is deployed to Client environment (managed)

  • Flow includes Run script action (Excel Online)

Issue:
After deployment, the flow does not turn on in the client environment. When trying to enable or save the flow, I encounter an error (while validating the Run Script action).

What I tried:


  1. Used environment variables for:
    • File ID
    • Document Library
    • Script ID
      → Still received error
  2. Removed environment variables in client environment and manually reselected
    • File
    • Library
    • Script
      → Same issue occurs while savin 

Additional Info:


  • The Excel file and script exist in the client environment
  • Permissions seem to be in place
  • Issue only occurs post-deployment (works fine in Dev)

  •  

Ask:

Has anyone faced issues with the Run script action in managed environments?

Is there any known limitation, dependency, or configuration required when deploying via solutions?

 

Any guidance would be really helpful.

 

Thanks in advance!

I have the same question (0)
  • 11manish Profile Picture
    2,036 on at
    It seems that this issue occurs because the Excel “Run script” action depends on Office Scripts that are user-scoped and not solution-aware,
     
    so their references do not carry over during solution deployment.
     
    The recommended approach is to recreate or rebind the script in the target environment after deployment, ensuring proper permissions and connections.
  • SB-01070651-0 Profile Picture
    6 on at

    Hi @11manish,

    Thanks for your response.
    I’d like to clarify a few important points in my scenario:
     
    - The Office Script used in the client environment is different from the Dev script — it is created separately in the client environment.
    - During solution import, I am providing the correct Script ID via environment variables, pointing to the client environment script. 
    - So this is not about references carrying over from Dev — I am explicitly rebinding it in the target environment.
     
    Also, an important observation:
     
    - The same setup (using environment variables for Script ID, File, and Library) works perfectly in the Development environment
    - The issue only occurs after deployment to the managed (client) environment
     
    Additionally:
     
    - The script is created using a service account, and the same account is used for:
    • Deployment
    • Connections
    • Flow ownership
    So permission or ownership mismatch is unlikely.
    What’s more:
    • Even after removing environment variables completely
    • And manually re-selecting:
      • File
      • Document Library
      • Script
    The error still occurs while saving the flow, with: GetSingleScript → 404 (Script not found)
    This suggests the issue is not just with environment variables or solution references.
    It seems more like:
     
    - The Excel Online connector is unable to resolve script metadata correctly in the managed environment
    - Or there is some backend validation/caching issue during the save operation
     
    Has anyone experienced a case where:
     
     - Script is visible and selectable in UI
     -  But fails during save/enable with Script not found?
     
    Any deeper insights or workarounds would be really helpful.
    Thanks!
  • 11manish Profile Picture
    2,036 on at
     
    Yes, this exact scenario can occur where the script is visible and selectable in the UI but fails during save with “Script not found.”
     
    It seems that this is typically caused by backend validation and metadata resolution issues in the Excel Online connector within managed environments.
     
    Even when Script ID, permissions, and ownership are correct, the connector may fail to resolve the script due to caching, drive context mismatch, or known
     
    platform limitations.
     
    The most reliable workaround is to recreate the script (and sometimes the Excel file) directly in the target environment and rebind it using a fresh connection.

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
Vish WR Profile Picture

Vish WR 875

#2
Valantis Profile Picture

Valantis 817

#3
Haque Profile Picture

Haque 481

Last 30 days Overall leaderboard