cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pbnet
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
danielbazetto
Community Support
Community Support

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,196)