Runbook
Definition of the runbook type. API Version: 2019-06-01.
Example Usage
Create or update runbook and publish it
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var runbook = new AzureNative.Automation.Runbook("runbook", new()
{
AutomationAccountName = "ContoseAutomationAccount",
Description = "Description of the Runbook",
Location = "East US 2",
LogActivityTrace = 1,
LogProgress = true,
LogVerbose = false,
Name = "Get-AzureVMTutorial",
PublishContentLink = new AzureNative.Automation.Inputs.ContentLinkArgs
{
ContentHash = new AzureNative.Automation.Inputs.ContentHashArgs
{
Algorithm = "SHA256",
Value = "115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80",
},
Uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1",
},
ResourceGroupName = "rg",
RunbookName = "Get-AzureVMTutorial",
RunbookType = "PowerShellWorkflow",
Tags =
{
{ "tag01", "value01" },
{ "tag02", "value02" },
},
});
});
Content copied to clipboard
package main
import (
automation "github.com/pulumi/pulumi-azure-native-sdk/automation"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := automation.NewRunbook(ctx, "runbook", &automation.RunbookArgs{
AutomationAccountName: pulumi.String("ContoseAutomationAccount"),
Description: pulumi.String("Description of the Runbook"),
Location: pulumi.String("East US 2"),
LogActivityTrace: pulumi.Int(1),
LogProgress: pulumi.Bool(true),
LogVerbose: pulumi.Bool(false),
Name: pulumi.String("Get-AzureVMTutorial"),
PublishContentLink: automation.ContentLinkResponse{
ContentHash: &automation.ContentHashArgs{
Algorithm: pulumi.String("SHA256"),
Value: pulumi.String("115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80"),
},
Uri: pulumi.String("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"),
},
ResourceGroupName: pulumi.String("rg"),
RunbookName: pulumi.String("Get-AzureVMTutorial"),
RunbookType: pulumi.String("PowerShellWorkflow"),
Tags: pulumi.StringMap{
"tag01": pulumi.String("value01"),
"tag02": pulumi.String("value02"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.automation.Runbook;
import com.pulumi.azurenative.automation.RunbookArgs;
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) {
var runbook = new Runbook("runbook", RunbookArgs.builder()
.automationAccountName("ContoseAutomationAccount")
.description("Description of the Runbook")
.location("East US 2")
.logActivityTrace(1)
.logProgress(true)
.logVerbose(false)
.name("Get-AzureVMTutorial")
.publishContentLink(Map.ofEntries(
Map.entry("contentHash", Map.ofEntries(
Map.entry("algorithm", "SHA256"),
Map.entry("value", "115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80")
)),
Map.entry("uri", "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1")
))
.resourceGroupName("rg")
.runbookName("Get-AzureVMTutorial")
.runbookType("PowerShellWorkflow")
.tags(Map.ofEntries(
Map.entry("tag01", "value01"),
Map.entry("tag02", "value02")
))
.build());
}
}
Content copied to clipboard
Create runbook as draft
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var runbook = new AzureNative.Automation.Runbook("runbook", new()
{
AutomationAccountName = "ContoseAutomationAccount",
Description = "Description of the Runbook",
Draft = null,
Location = "East US 2",
LogProgress = false,
LogVerbose = false,
Name = "Get-AzureVMTutorial",
ResourceGroupName = "rg",
RunbookName = "Get-AzureVMTutorial",
RunbookType = "PowerShellWorkflow",
Tags =
{
{ "tag01", "value01" },
{ "tag02", "value02" },
},
});
});
Content copied to clipboard
package main
import (
automation "github.com/pulumi/pulumi-azure-native-sdk/automation"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := automation.NewRunbook(ctx, "runbook", &automation.RunbookArgs{
AutomationAccountName: pulumi.String("ContoseAutomationAccount"),
Description: pulumi.String("Description of the Runbook"),
Draft: nil,
Location: pulumi.String("East US 2"),
LogProgress: pulumi.Bool(false),
LogVerbose: pulumi.Bool(false),
Name: pulumi.String("Get-AzureVMTutorial"),
ResourceGroupName: pulumi.String("rg"),
RunbookName: pulumi.String("Get-AzureVMTutorial"),
RunbookType: pulumi.String("PowerShellWorkflow"),
Tags: pulumi.StringMap{
"tag01": pulumi.String("value01"),
"tag02": pulumi.String("value02"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.automation.Runbook;
import com.pulumi.azurenative.automation.RunbookArgs;
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) {
var runbook = new Runbook("runbook", RunbookArgs.builder()
.automationAccountName("ContoseAutomationAccount")
.description("Description of the Runbook")
.draft()
.location("East US 2")
.logProgress(false)
.logVerbose(false)
.name("Get-AzureVMTutorial")
.resourceGroupName("rg")
.runbookName("Get-AzureVMTutorial")
.runbookType("PowerShellWorkflow")
.tags(Map.ofEntries(
Map.entry("tag01", "value01"),
Map.entry("tag02", "value02")
))
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:automation:Runbook Get-AzureVMTutorial /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial
Content copied to clipboard
Properties
Link copied to clipboard
Gets or sets the creation time.
Link copied to clipboard
Gets or sets the description.
Link copied to clipboard
Gets or sets the draft runbook properties.
Link copied to clipboard
Gets or sets the last modified by.
Link copied to clipboard
Gets or sets the last modified time.
Link copied to clipboard
Gets or sets the option to log activity trace of the runbook.
Link copied to clipboard
Gets or sets progress log option.
Link copied to clipboard
Gets or sets verbose log option.
Link copied to clipboard
Gets or sets the runbook output types.
Link copied to clipboard
Gets or sets the runbook parameters.
Link copied to clipboard
Gets or sets the provisioning state of the runbook.
Link copied to clipboard
Gets or sets the published runbook content link.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Gets or sets the type of the runbook.