cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Parameters not passed correctly from PowerAutomate to Azure Runbook

Hello, I have the following Runbook in Azure:

 

#Dynamic parameters to pass to PowerAutomate
param(
    [Parameter(Mandatory=$true)]
    [string]$SiteTemplateURL,
    [Parameter(Mandatory=$true)]
    [string]$ApplyTemplatetoURL
)
#Credentials
$myCred = Get-AutomationPSCredential -Name "SPOAdminCred"

Connect-PnPOnline -url $SiteTemplateURL -Credentials $myCred
#Create new Site
New-PnPWeb -Title "This PNP Test 11" -Url $ApplyTemplatetoURL -Description "This is a test 11 for PNP templates" -Locale 1033 -Template "STS#3" -ErrorAction SilentlyContinue

Connect-PnPOnline -url https://andreir2020.sharepoint.com/sites/NTTTDATA/$ApplyTemplatetoURL -Credentials $myCred

 
 
I've created a SharePoint list from where I get the values for the parameters required by the runbook, and put all this in a PowerAutomate flow:

 
Flow-762020.png
 
When a new item is created, the flow starts and finishes successfully:
powerautomaterun1.png
 
But the Runbook fails to run with the following errors although it seems to get the parameters successfully:
 
runbook params.png
runbookERROR.png
Note: the runbook works OK when run only from the "Test Pane" in the "edit PowerShell runbook" page in Azure.
 
Thanks for any idea you could give me.
 
 
 
1 REPLY 1
Highlighted
Microsoft
Microsoft

Re: Parameters not passed correctly from PowerAutomate to Azure Runbook

Hi @pbnet 

 

Try to enter the values on the "Create Job" card manually, make a test using an static value instead using the Dynamics content from the Sharepoint.

 

You could try to capture a network trace and see if there is anything relevant on it that might be blocking it.
https://docs.microsoft.com/en-us/azure/azure-portal/capture-browser-trace

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,697)