We recommend using Azure Native.
Viewing docs for Azure v6.33.0
published on Monday, Feb 23, 2026 by Pulumi
published on Monday, Feb 23, 2026 by Pulumi
We recommend using Azure Native.
Viewing docs for Azure v6.33.0
published on Monday, Feb 23, 2026 by Pulumi
published on Monday, Feb 23, 2026 by Pulumi
Use this data source to access information about an existing Automation Object Variable.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as std from "@pulumi/std";
const example = azure.automation.getVariableObject({
name: "tfex-example-var",
resourceGroupName: "tfex-example-rg",
automationAccountName: "tfex-example-account",
});
export const variable = example.then(example => std.jsondecode({
input: example.value,
})).then(invoke => invoke.result);
import pulumi
import pulumi_azure as azure
import pulumi_std as std
example = azure.automation.get_variable_object(name="tfex-example-var",
resource_group_name="tfex-example-rg",
automation_account_name="tfex-example-account")
pulumi.export("variable", std.jsondecode(input=example.value).result)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/automation"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := automation.LookupVariableObject(ctx, &automation.LookupVariableObjectArgs{
Name: "tfex-example-var",
ResourceGroupName: "tfex-example-rg",
AutomationAccountName: "tfex-example-account",
}, nil)
if err != nil {
return err
}
ctx.Export("variable", pulumi.Any(std.Jsondecode(ctx, &std.JsondecodeArgs{
Input: example.Value,
}, nil).Result))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = Azure.Automation.GetVariableObject.Invoke(new()
{
Name = "tfex-example-var",
ResourceGroupName = "tfex-example-rg",
AutomationAccountName = "tfex-example-account",
});
return new Dictionary<string, object?>
{
["variable"] = Std.Jsondecode.Invoke(new()
{
Input = example.Apply(getVariableObjectResult => getVariableObjectResult.Value),
}).Apply(invoke => invoke.Result),
};
});
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.GetVariableObjectArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.JsondecodeArgs;
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.getVariableObject(GetVariableObjectArgs.builder()
.name("tfex-example-var")
.resourceGroupName("tfex-example-rg")
.automationAccountName("tfex-example-account")
.build());
ctx.export("variable", StdFunctions.jsondecode(JsondecodeArgs.builder()
.input(example.value())
.build()).result());
}
}
variables:
example:
fn::invoke:
function: azure:automation:getVariableObject
arguments:
name: tfex-example-var
resourceGroupName: tfex-example-rg
automationAccountName: tfex-example-account
outputs:
variable:
fn::invoke:
function: std:jsondecode
arguments:
input: ${example.value}
return: result
Using getVariableObject
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 getVariableObject(args: GetVariableObjectArgs, opts?: InvokeOptions): Promise<GetVariableObjectResult>
function getVariableObjectOutput(args: GetVariableObjectOutputArgs, opts?: InvokeOptions): Output<GetVariableObjectResult>def get_variable_object(automation_account_name: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVariableObjectResult
def get_variable_object_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[GetVariableObjectResult]func LookupVariableObject(ctx *Context, args *LookupVariableObjectArgs, opts ...InvokeOption) (*LookupVariableObjectResult, error)
func LookupVariableObjectOutput(ctx *Context, args *LookupVariableObjectOutputArgs, opts ...InvokeOption) LookupVariableObjectResultOutput> Note: This function is named LookupVariableObject in the Go SDK.
public static class GetVariableObject
{
public static Task<GetVariableObjectResult> InvokeAsync(GetVariableObjectArgs args, InvokeOptions? opts = null)
public static Output<GetVariableObjectResult> Invoke(GetVariableObjectInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVariableObjectResult> getVariableObject(GetVariableObjectArgs args, InvokeOptions options)
public static Output<GetVariableObjectResult> getVariableObject(GetVariableObjectArgs args, InvokeOptions options)
fn::invoke:
function: azure:automation/getVariableObject:getVariableObject
arguments:
# arguments dictionaryThe following arguments are supported:
- Automation
Account stringName - The name of the automation account in which the Automation Variable exists.
- Name string
- The name of the Automation Variable.
- Resource
Group stringName - The Name of the Resource Group where the automation account exists.
- Automation
Account stringName - The name of the automation account in which the Automation Variable exists.
- Name string
- The name of the Automation Variable.
- Resource
Group stringName - The Name of the Resource Group where the automation account exists.
- automation
Account StringName - The name of the automation account in which the Automation Variable exists.
- name String
- The name of the Automation Variable.
- resource
Group StringName - The Name of the Resource Group where the automation account exists.
- automation
Account stringName - The name of the automation account in which the Automation Variable exists.
- name string
- The name of the Automation Variable.
- resource
Group stringName - The Name of the Resource Group where the automation account exists.
- automation_
account_ strname - The name of the automation account in which the Automation Variable exists.
- name str
- The name of the Automation Variable.
- resource_
group_ strname - The Name of the Resource Group where the automation account exists.
- automation
Account StringName - The name of the automation account in which the Automation Variable exists.
- name String
- The name of the Automation Variable.
- resource
Group StringName - The Name of the Resource Group where the automation account exists.
getVariableObject Result
The following output properties are available:
- Automation
Account stringName - Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted. Defaults to
false. - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource
Group stringName - Value string
- The value of the Automation Variable as a json encoded
string.
- Automation
Account stringName - Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted. Defaults to
false. - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource
Group stringName - Value string
- The value of the Automation Variable as a json encoded
string.
- automation
Account StringName - description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted. Defaults to
false. - id String
- The provider-assigned unique ID for this managed resource.
- name String
- resource
Group StringName - value String
- The value of the Automation Variable as a json encoded
string.
- automation
Account stringName - description string
- The description of the Automation Variable.
- encrypted boolean
- Specifies if the Automation Variable is encrypted. Defaults to
false. - id string
- The provider-assigned unique ID for this managed resource.
- name string
- resource
Group stringName - value string
- The value of the Automation Variable as a json encoded
string.
- automation_
account_ strname - description str
- The description of the Automation Variable.
- encrypted bool
- Specifies if the Automation Variable is encrypted. Defaults to
false. - id str
- The provider-assigned unique ID for this managed resource.
- name str
- resource_
group_ strname - value str
- The value of the Automation Variable as a json encoded
string.
- automation
Account StringName - description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted. Defaults to
false. - id String
- The provider-assigned unique ID for this managed resource.
- name String
- resource
Group StringName - value String
- The value of the Automation Variable as a json encoded
string.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
Viewing docs for Azure v6.33.0
published on Monday, Feb 23, 2026 by Pulumi
published on Monday, Feb 23, 2026 by Pulumi
