Get runbook details API in Azure automation doesn't return parameters for python runbooks?

Debangshu Banerjee 20 Reputation points
2023-09-17T21:05:21.69+00:00

Can someone please confirm on the API response of the API : https://learn.microsoft.com/en-us/rest/api/automation/runbook/get?tabs=HTTP&tryIt=true&source=docs#code-try-0 for python runbooks?

It returns parameters list for Powershell (Normal and Graphical) types of runbooks in API response. But, not sure for python runbooks.

Python runbooks may not support returning API response with parameters list as per - https://learn.microsoft.com/en-us/azure/automation/runbook-input-parameters.

Is there any way to bypass this?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,368 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,996 Reputation points Moderator
    2023-09-26T09:04:40.3666667+00:00

    Debangshu Banerjee Welcome to Microsoft Q & A community Forum. As you already know, Unlike PowerShell, PowerShell Workflow, and graphical runbooks, Python runbooks do not take named parameters. The runbook editor parses all input parameters as an array of argument values. You can access the array by importing the sys module into your Python script, and then using the sys.argv array.

    As python doesn't take named parameters, you will receive null values within parameter list. To view the parameters within python runbook you can try retrieving the content of runbook using https://learn.microsoft.com/en-us/rest/api/automation/runbook/get-content?tabs=HTTP API.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.