We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.automation.getRunbook
Explore with Pulumi AI
Use this data source to access information about an existing Automation Runbook.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.automation.getRunbook({
    name: "existing-runbook",
    resourceGroupName: "existing",
    automationAccountName: "existing-automation",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.automation.get_runbook(name="existing-runbook",
    resource_group_name="existing",
    automation_account_name="existing-automation")
pulumi.export("id", example.id)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/automation"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := automation.GetRunbook(ctx, &automation.GetRunbookArgs{
			Name:                  "existing-runbook",
			ResourceGroupName:     "existing",
			AutomationAccountName: "existing-automation",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.Automation.GetRunbook.Invoke(new()
    {
        Name = "existing-runbook",
        ResourceGroupName = "existing",
        AutomationAccountName = "existing-automation",
    });
    return new Dictionary<string, object?>
    {
        ["id"] = example.Apply(getRunbookResult => getRunbookResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.automation.AutomationFunctions;
import com.pulumi.azure.automation.inputs.GetRunbookArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = AutomationFunctions.getRunbook(GetRunbookArgs.builder()
            .name("existing-runbook")
            .resourceGroupName("existing")
            .automationAccountName("existing-automation")
            .build());
        ctx.export("id", example.applyValue(getRunbookResult -> getRunbookResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:automation:getRunbook
      arguments:
        name: existing-runbook
        resourceGroupName: existing
        automationAccountName: existing-automation
outputs:
  id: ${example.id}
Using getRunbook
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRunbook(args: GetRunbookArgs, opts?: InvokeOptions): Promise<GetRunbookResult>
function getRunbookOutput(args: GetRunbookOutputArgs, opts?: InvokeOptions): Output<GetRunbookResult>def get_runbook(automation_account_name: Optional[str] = None,
                name: Optional[str] = None,
                resource_group_name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetRunbookResult
def get_runbook_output(automation_account_name: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                resource_group_name: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetRunbookResult]func GetRunbook(ctx *Context, args *GetRunbookArgs, opts ...InvokeOption) (*GetRunbookResult, error)
func GetRunbookOutput(ctx *Context, args *GetRunbookOutputArgs, opts ...InvokeOption) GetRunbookResultOutput> Note: This function is named GetRunbook in the Go SDK.
public static class GetRunbook 
{
    public static Task<GetRunbookResult> InvokeAsync(GetRunbookArgs args, InvokeOptions? opts = null)
    public static Output<GetRunbookResult> Invoke(GetRunbookInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRunbookResult> getRunbook(GetRunbookArgs args, InvokeOptions options)
public static Output<GetRunbookResult> getRunbook(GetRunbookArgs args, InvokeOptions options)
fn::invoke:
  function: azure:automation/getRunbook:getRunbook
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AutomationAccount stringName 
- The name of the Automation Account the runbook belongs to.
- Name string
- The name of the Automation Runbook.
- ResourceGroup stringName 
- The name of the Resource Group where the Automation exists.
- AutomationAccount stringName 
- The name of the Automation Account the runbook belongs to.
- Name string
- The name of the Automation Runbook.
- ResourceGroup stringName 
- The name of the Resource Group where the Automation exists.
- automationAccount StringName 
- The name of the Automation Account the runbook belongs to.
- name String
- The name of the Automation Runbook.
- resourceGroup StringName 
- The name of the Resource Group where the Automation exists.
- automationAccount stringName 
- The name of the Automation Account the runbook belongs to.
- name string
- The name of the Automation Runbook.
- resourceGroup stringName 
- The name of the Resource Group where the Automation exists.
- automation_account_ strname 
- The name of the Automation Account the runbook belongs to.
- name str
- The name of the Automation Runbook.
- resource_group_ strname 
- The name of the Resource Group where the Automation exists.
- automationAccount StringName 
- The name of the Automation Account the runbook belongs to.
- name String
- The name of the Automation Runbook.
- resourceGroup StringName 
- The name of the Resource Group where the Automation exists.
getRunbook Result
The following output properties are available:
- AutomationAccount stringName 
- Content string
- The content of the Runbook.
- Description string
- The description of the Runbook.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region where the Runbook exists.
- LogActivity intTrace Level 
- The activity-level tracing of the Runbook.
- LogProgress bool
- The Progress log option of the Runbook.
- LogVerbose bool
- The Verbose log option of the Runbook.
- Name string
- ResourceGroup stringName 
- RunbookType string
- The type of Runbook.
- Dictionary<string, string>
- A mapping of tags assigned to the Runbook.
- AutomationAccount stringName 
- Content string
- The content of the Runbook.
- Description string
- The description of the Runbook.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region where the Runbook exists.
- LogActivity intTrace Level 
- The activity-level tracing of the Runbook.
- LogProgress bool
- The Progress log option of the Runbook.
- LogVerbose bool
- The Verbose log option of the Runbook.
- Name string
- ResourceGroup stringName 
- RunbookType string
- The type of Runbook.
- map[string]string
- A mapping of tags assigned to the Runbook.
- automationAccount StringName 
- content String
- The content of the Runbook.
- description String
- The description of the Runbook.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region where the Runbook exists.
- logActivity IntegerTrace Level 
- The activity-level tracing of the Runbook.
- logProgress Boolean
- The Progress log option of the Runbook.
- logVerbose Boolean
- The Verbose log option of the Runbook.
- name String
- resourceGroup StringName 
- runbookType String
- The type of Runbook.
- Map<String,String>
- A mapping of tags assigned to the Runbook.
- automationAccount stringName 
- content string
- The content of the Runbook.
- description string
- The description of the Runbook.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The Azure Region where the Runbook exists.
- logActivity numberTrace Level 
- The activity-level tracing of the Runbook.
- logProgress boolean
- The Progress log option of the Runbook.
- logVerbose boolean
- The Verbose log option of the Runbook.
- name string
- resourceGroup stringName 
- runbookType string
- The type of Runbook.
- {[key: string]: string}
- A mapping of tags assigned to the Runbook.
- automation_account_ strname 
- content str
- The content of the Runbook.
- description str
- The description of the Runbook.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The Azure Region where the Runbook exists.
- log_activity_ inttrace_ level 
- The activity-level tracing of the Runbook.
- log_progress bool
- The Progress log option of the Runbook.
- log_verbose bool
- The Verbose log option of the Runbook.
- name str
- resource_group_ strname 
- runbook_type str
- The type of Runbook.
- Mapping[str, str]
- A mapping of tags assigned to the Runbook.
- automationAccount StringName 
- content String
- The content of the Runbook.
- description String
- The description of the Runbook.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region where the Runbook exists.
- logActivity NumberTrace Level 
- The activity-level tracing of the Runbook.
- logProgress Boolean
- The Progress log option of the Runbook.
- logVerbose Boolean
- The Verbose log option of the Runbook.
- name String
- resourceGroup StringName 
- runbookType String
- The type of Runbook.
- Map<String>
- A mapping of tags assigned to the Runbook.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.