Share via


Get content of a published runbook

 

The Get content of a published runbook operation returns the content of a published runbook.

Use the Get content of a draft runbook operation to get the content of a runbook draft.

Request

To specify the request, replace <subscription-id> with your subscription ID, <cloud-service-name> with the name of the cloud service to use for making the request, <automation-account-name> with the name of the automation account to use for making the request, and <runbook-name> with the name of the runbook to get content from. Include required URI parameters.

Method

Request URI

GET

https://management.core.windows.net/<subscription-id>/cloudServices/<cloud-service-naame>/resources/automation/~/automationAccounts/<automation-account-name>/runbooks/<runbook-name>/content?api-version=2014-12-08

URI Parameters

Parameter

Description

api-version

Required. Must be set to 2014-12-08.

Request Headers

The request header in the following table is required.

Request Header

Description

x-ms-version

Specifies the version of the operation. Set to 2013-06-01 or a later version.

Request Body

None

Response

Status Code

A successful operation returns 200 (OK). For information about common error codes, see HTTP/1.1 Status Code Definitions.

Response Headers

Request Header

Description

x-ms-request-id

A unique identifier for the current operation.

Response Body

The runbook is provided after the response headers with the content type of text/powershell, as shown in the following example:

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 1009
Content-Type: text/powershell
Expires: -1
Vary: Accept-Encoding
Server: 1.0.6198.202 (rd_rdfe_stable.150307-1902) Microsoft-HTTPAPI/2.0
Strict-Transport-Security: max-age=31536000; includeSubDomains,max-age=31536000; includeSubDomains
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET,ASP.NET
x-ms-request-id: 50e171bfee1f2fc0b14384fd5b3da932
Date: Mon, 27 Apr 2015 04:05:21 GMT

<#
.SYNOPSIS
    Provides a simple example of a Azure Automation runbook.  

.DESCRIPTION
    This runbook provides the "Hello World" example for Azure Automation.  If you are 
    brand new to Automation in Azure, you can use this runbook to explore testing 
    and publishing capabilities.  

    The runbook takes in an optional string parameter.  If you leave the parameter blank, the 
    default of $Name will equal "World".  The runbook then prints "Hello" concatenated with $Name.


.PARAMETER Name
    String value to print as output

.EXAMPLE
    Write-HelloWorld -Name "World"

.NOTES
Author: System Center Automation Team 
Last Updated: 3/3/2014   
#>


workflow Write-HelloWorld {
    param (

        # Optional parameter of type string. 
        # If you do not enter anything, the default value of Name 
        # will be World
        [parameter(Mandatory=$false)]
        [String]$Name = "World"
    )

        Write-Output "Hello $Name"

}

See Also

Automation Runbooks
Operations on Automation