SOLVED

Permissions Required to Run Excel Scripts in Logic Apps

Copper Contributor

Hi,

 

I have been trying for months to migrate a Logic App solution to the final SharePoint portal.  When I originally wrote the code, I used my own credentials to set it up and resolve any issues.  Now that it is ready to be deployed to the business, we want to migrate it off my credentials to a service account.

 

The service account has owner permissions to the SharePoint site and can access the Excel template file in the document folder, create a new file etc.  But when it comes to configuring the 'Run Script' block, the script available in the Excel template are not visible.

 

Geordie_ca_1-1699484972481.png

Just changing to my credentials will allow the scripts to be displayed.

Geordie_ca_2-1699485107987.png

 

What permissions does the service account need.  We have tried giving it a basic Office 365 subscription.

 

Any assistance will be much appreciated.

 

Thanks in advance,

Martin

 

2 Replies
best response confirmed by Geordie_ca (Copper Contributor)
Solution

Hi Martin, thank you for reaching out!

 

The run script block action by default only supports running scripts that are stored on the current user's own OneDrive for Business ( /Documents/Office Scripts folder) which is why the scripts are not showing up even if you have given your service account permissions to your folder.

 

Here is a solution that could unblock your situation.

You could try using the 'Run Script from SharePoint library' action.

MichaelVaquierMSFT_0-1699568563658.pngMichaelVaquierMSFT_1-1699568576993.png

Here, you will be able to specify a shared location where the script you want to run can be found.

 

I hope this helps, and please let me know if you have any more questions.

 

Michael Vaquier

@Michael-Vaquier-MSFT 

Hi Michael, Thanks for your response on this issue.  I was not aware that when I save a script Excel that the script is actually being saves to my One Drive and not stored in the Excel document. With this info, it makes sense that the service account cannot access the script.

 

From your response and reviewing this MS documentation page (https://learn.microsoft.com/en-us/office/dev/scripts/overview/script-storage), I have been able to move the script to Sharepoint and update my Logic App to use the service account.  Since it is initiated by a 3rd party nightly process, I will find out if it works tomorrow.  But it is looking good...  

 

Thanks Again.

Martin

1 best response

Accepted Solutions
best response confirmed by Geordie_ca (Copper Contributor)
Solution

Hi Martin, thank you for reaching out!

 

The run script block action by default only supports running scripts that are stored on the current user's own OneDrive for Business ( /Documents/Office Scripts folder) which is why the scripts are not showing up even if you have given your service account permissions to your folder.

 

Here is a solution that could unblock your situation.

You could try using the 'Run Script from SharePoint library' action.

MichaelVaquierMSFT_0-1699568563658.pngMichaelVaquierMSFT_1-1699568576993.png

Here, you will be able to specify a shared location where the script you want to run can be found.

 

I hope this helps, and please let me know if you have any more questions.

 

Michael Vaquier

View solution in original post