cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WillPage
Impactful Individual
Impactful Individual

Azure Automation CreateJob Error.

Hello,

I'm trying to start an Azure Automation job from PowerApps using the CreateJob function in the Azure Automation connector. The run book has one parameter of type String and runs on a Hybrid Runbook Worker.

 

My button's OnSelect does this (some data changed for privacy/security)

AzureAutomation.CreateJob("4166d727-4747-4bc1-99f2-8d5d08ee20a4", "AutomationRG1", "AutomationAccount",{runbookName:"Runbook1",properties:{parameters:{Script: PowerShell.Text}, runOn:"HybridGroup1"}})

In this case the single parameter of the runbook is called Script and the control that contains the script is called PowerShell. As you might have guessed, this is intended to run a line of powershell on an on-prem server.

 

This formula contains no errors as far as PowerApps is concerned, but when I try to run it, this happens:

 

Capture.PNG

 

Any idea what could be going on here? I suspect it's the runbook parameters not being in the correct format, but there isn't a lot of documentation about this online.

8 REPLIES 8
v-yuxima-msft
Community Support
Community Support

Hi @WillPage ,

 

Could you please check whether the parameter you passed is valid?

Could you please test that by Microsoft Flow?

 

Best Regards.

Yumia

 

WillPage
Impactful Individual
Impactful Individual

@v-yuxima-msftit works perfectly in Flow, so I have the option here to trigger a flow with the input being the powershell.text parameter. I have done this as a workaround for now, but I would rather start the runbook job directly within PowerApps.

Hi @WillPage ,

 

I am afraid I can’t reproduce your issue on my side.

Could you please create one new connection to test it again?

 

Best Regards.

Yumia

Hi @WillPage ,

 

Is the issue solved?

 

Best Regards.

Yumia

WillPage
Impactful Individual
Impactful Individual

@v-yuxima-msft I have stuck with using a Flow for this so I don't know if the connector in PowerApps works to trigger a job.

I've been trying to get this to work as well.  I can create a job without parameters, and that works fine.  But if I want to kick off a job that does have parameters, the ones I send aren't received by Azure Automation.  The documentation for this is next to non-existent, but based on the work you did and my own experiments, I'm pretty sure this is right at the Power Apps end:

Set(
    Result,
    AzureAutomation.CreateJob(
        "acbbba1c-d56e-4185-88cc-a0603e5def6d",
        "AzureAutomation",
        "PowerAutomateHelpers",
        {
            runbookName: "TinyTest",
            wait:true,
            properties: {
                parameters: {
                    Colour:"Blue",
                    Size:"Big"
                },
                runOn: ""
            }
        }
    )
)

 

 Has anyone had more luck than me on this?  I know I can use a Flow to do what I need to do, and that does work fine, but I'd like to do it purely within Power Apps if I can...

Hi evrebody !

 

unfortunatly i've try to do same thing and i failed on the same problem. The runbook is triggered but no input parmeters are visible or pass. Are they any news of that but or any document for this connector ? 

I experienced the same problem last year and opened a Microsoft support case. Result from that was that PowerApps does not support x-ms-dynamic-schema used by Automation and so parameters cannot be passed correctly.

I've opened a feeback for this : https://feedback.azure.com/forums/287593-logic-apps/suggestions/38841196-automation

Maybe they'll fix this if this gets upvoted.

 

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (78,085)