1. Packages
  2. Azure Classic
  3. API Docs
  4. automation
  5. getVariables

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.automation.getVariables

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to get all variables in an Automation Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.automation.getAccount({
    name: "example-account",
    resourceGroupName: "example-resources",
});
const exampleGetVariables = example.then(example => azure.automation.getVariables({
    automationAccountId: example.id,
}));
export const stringVars = exampleAzurermAutomationVariableString.string;
Copy
import pulumi
import pulumi_azure as azure

example = azure.automation.get_account(name="example-account",
    resource_group_name="example-resources")
example_get_variables = azure.automation.get_variables(automation_account_id=example.id)
pulumi.export("stringVars", example_azurerm_automation_variable_string["string"])
Copy
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.LookupAccount(ctx, &automation.LookupAccountArgs{
			Name:              "example-account",
			ResourceGroupName: "example-resources",
		}, nil)
		if err != nil {
			return err
		}
		_, err = automation.GetVariables(ctx, &automation.GetVariablesArgs{
			AutomationAccountId: example.Id,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("stringVars", exampleAzurermAutomationVariableString.String)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.Automation.GetAccount.Invoke(new()
    {
        Name = "example-account",
        ResourceGroupName = "example-resources",
    });

    var exampleGetVariables = Azure.Automation.GetVariables.Invoke(new()
    {
        AutomationAccountId = example.Apply(getAccountResult => getAccountResult.Id),
    });

    return new Dictionary<string, object?>
    {
        ["stringVars"] = exampleAzurermAutomationVariableString.String,
    };
});
Copy
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.GetAccountArgs;
import com.pulumi.azure.automation.inputs.GetVariablesArgs;
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.getAccount(GetAccountArgs.builder()
            .name("example-account")
            .resourceGroupName("example-resources")
            .build());

        final var exampleGetVariables = AutomationFunctions.getVariables(GetVariablesArgs.builder()
            .automationAccountId(example.applyValue(getAccountResult -> getAccountResult.id()))
            .build());

        ctx.export("stringVars", exampleAzurermAutomationVariableString.string());
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:automation:getAccount
      arguments:
        name: example-account
        resourceGroupName: example-resources
  exampleGetVariables:
    fn::invoke:
      function: azure:automation:getVariables
      arguments:
        automationAccountId: ${example.id}
outputs:
  stringVars: ${exampleAzurermAutomationVariableString.string}
Copy

Using getVariables

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 getVariables(args: GetVariablesArgs, opts?: InvokeOptions): Promise<GetVariablesResult>
function getVariablesOutput(args: GetVariablesOutputArgs, opts?: InvokeOptions): Output<GetVariablesResult>
Copy
def get_variables(automation_account_id: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetVariablesResult
def get_variables_output(automation_account_id: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetVariablesResult]
Copy
func GetVariables(ctx *Context, args *GetVariablesArgs, opts ...InvokeOption) (*GetVariablesResult, error)
func GetVariablesOutput(ctx *Context, args *GetVariablesOutputArgs, opts ...InvokeOption) GetVariablesResultOutput
Copy

> Note: This function is named GetVariables in the Go SDK.

public static class GetVariables 
{
    public static Task<GetVariablesResult> InvokeAsync(GetVariablesArgs args, InvokeOptions? opts = null)
    public static Output<GetVariablesResult> Invoke(GetVariablesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVariablesResult> getVariables(GetVariablesArgs args, InvokeOptions options)
public static Output<GetVariablesResult> getVariables(GetVariablesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:automation/getVariables:getVariables
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AutomationAccountId This property is required. string
The resource ID of the automation account.
AutomationAccountId This property is required. string
The resource ID of the automation account.
automationAccountId This property is required. String
The resource ID of the automation account.
automationAccountId This property is required. string
The resource ID of the automation account.
automation_account_id This property is required. str
The resource ID of the automation account.
automationAccountId This property is required. String
The resource ID of the automation account.

getVariables Result

The following output properties are available:

AutomationAccountId string
Bools List<GetVariablesBool>
One or more variable blocks as defined below for each boolean variable.
Datetimes List<GetVariablesDatetime>
One or more variable blocks as defined below for each datetime variable.
Encrypteds List<GetVariablesEncrypted>
Specifies if the Automation Variable is encrypted.
Id string
The provider-assigned unique ID for this managed resource.
Ints List<GetVariablesInt>
One or more variable blocks as defined below for each int variable.
Nulls List<GetVariablesNull>
One or more variable blocks as defined below for each null variable.
Objects List<GetVariablesObject>
Strings List<GetVariablesString>
One or more variable blocks as defined below for each string variable.
AutomationAccountId string
Bools []GetVariablesBool
One or more variable blocks as defined below for each boolean variable.
Datetimes []GetVariablesDatetime
One or more variable blocks as defined below for each datetime variable.
Encrypteds []GetVariablesEncrypted
Specifies if the Automation Variable is encrypted.
Id string
The provider-assigned unique ID for this managed resource.
Ints []GetVariablesInt
One or more variable blocks as defined below for each int variable.
Nulls []GetVariablesNull
One or more variable blocks as defined below for each null variable.
Objects []GetVariablesObject
Strings []GetVariablesString
One or more variable blocks as defined below for each string variable.
automationAccountId String
bools List<GetVariablesBool>
One or more variable blocks as defined below for each boolean variable.
datetimes List<GetVariablesDatetime>
One or more variable blocks as defined below for each datetime variable.
encrypteds List<GetVariablesEncrypted>
Specifies if the Automation Variable is encrypted.
id String
The provider-assigned unique ID for this managed resource.
ints List<GetVariablesInt>
One or more variable blocks as defined below for each int variable.
nulls List<GetVariablesNull>
One or more variable blocks as defined below for each null variable.
objects List<GetVariablesObject>
strings List<GetVariablesString>
One or more variable blocks as defined below for each string variable.
automationAccountId string
bools GetVariablesBool[]
One or more variable blocks as defined below for each boolean variable.
datetimes GetVariablesDatetime[]
One or more variable blocks as defined below for each datetime variable.
encrypteds GetVariablesEncrypted[]
Specifies if the Automation Variable is encrypted.
id string
The provider-assigned unique ID for this managed resource.
ints GetVariablesInt[]
One or more variable blocks as defined below for each int variable.
nulls GetVariablesNull[]
One or more variable blocks as defined below for each null variable.
objects GetVariablesObject[]
strings GetVariablesString[]
One or more variable blocks as defined below for each string variable.
automation_account_id str
bools Sequence[GetVariablesBool]
One or more variable blocks as defined below for each boolean variable.
datetimes Sequence[GetVariablesDatetime]
One or more variable blocks as defined below for each datetime variable.
encrypteds Sequence[GetVariablesEncrypted]
Specifies if the Automation Variable is encrypted.
id str
The provider-assigned unique ID for this managed resource.
ints Sequence[GetVariablesInt]
One or more variable blocks as defined below for each int variable.
nulls Sequence[GetVariablesNull]
One or more variable blocks as defined below for each null variable.
objects Sequence[GetVariablesObject]
strings Sequence[GetVariablesString]
One or more variable blocks as defined below for each string variable.
automationAccountId String
bools List<Property Map>
One or more variable blocks as defined below for each boolean variable.
datetimes List<Property Map>
One or more variable blocks as defined below for each datetime variable.
encrypteds List<Property Map>
Specifies if the Automation Variable is encrypted.
id String
The provider-assigned unique ID for this managed resource.
ints List<Property Map>
One or more variable blocks as defined below for each int variable.
nulls List<Property Map>
One or more variable blocks as defined below for each null variable.
objects List<Property Map>
strings List<Property Map>
One or more variable blocks as defined below for each string variable.

Supporting Types

GetVariablesBool

Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. bool
The value of the Automation Variable.
Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. bool
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. Boolean
The value of the Automation Variable.
description This property is required. string
The description of the Automation Variable.
encrypted This property is required. boolean
Specifies if the Automation Variable is encrypted.
id This property is required. string
name This property is required. string
The name of the Automation Variable.
value This property is required. boolean
The value of the Automation Variable.
description This property is required. str
The description of the Automation Variable.
encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
id This property is required. str
name This property is required. str
The name of the Automation Variable.
value This property is required. bool
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. Boolean
The value of the Automation Variable.

GetVariablesDatetime

Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.
description This property is required. string
The description of the Automation Variable.
encrypted This property is required. boolean
Specifies if the Automation Variable is encrypted.
id This property is required. string
name This property is required. string
The name of the Automation Variable.
value This property is required. string
The value of the Automation Variable.
description This property is required. str
The description of the Automation Variable.
encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
id This property is required. str
name This property is required. str
The name of the Automation Variable.
value This property is required. str
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.

GetVariablesEncrypted

Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.
description This property is required. string
The description of the Automation Variable.
encrypted This property is required. boolean
Specifies if the Automation Variable is encrypted.
id This property is required. string
name This property is required. string
The name of the Automation Variable.
value This property is required. string
The value of the Automation Variable.
description This property is required. str
The description of the Automation Variable.
encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
id This property is required. str
name This property is required. str
The name of the Automation Variable.
value This property is required. str
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.

GetVariablesInt

Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. int
The value of the Automation Variable.
Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. int
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. Integer
The value of the Automation Variable.
description This property is required. string
The description of the Automation Variable.
encrypted This property is required. boolean
Specifies if the Automation Variable is encrypted.
id This property is required. string
name This property is required. string
The name of the Automation Variable.
value This property is required. number
The value of the Automation Variable.
description This property is required. str
The description of the Automation Variable.
encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
id This property is required. str
name This property is required. str
The name of the Automation Variable.
value This property is required. int
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. Number
The value of the Automation Variable.

GetVariablesNull

Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.
description This property is required. string
The description of the Automation Variable.
encrypted This property is required. boolean
Specifies if the Automation Variable is encrypted.
id This property is required. string
name This property is required. string
The name of the Automation Variable.
value This property is required. string
The value of the Automation Variable.
description This property is required. str
The description of the Automation Variable.
encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
id This property is required. str
name This property is required. str
The name of the Automation Variable.
value This property is required. str
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.

GetVariablesObject

Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.
description This property is required. string
The description of the Automation Variable.
encrypted This property is required. boolean
Specifies if the Automation Variable is encrypted.
id This property is required. string
name This property is required. string
The name of the Automation Variable.
value This property is required. string
The value of the Automation Variable.
description This property is required. str
The description of the Automation Variable.
encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
id This property is required. str
name This property is required. str
The name of the Automation Variable.
value This property is required. str
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.

GetVariablesString

Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
Description This property is required. string
The description of the Automation Variable.
Encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
Id This property is required. string
Name This property is required. string
The name of the Automation Variable.
Value This property is required. string
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.
description This property is required. string
The description of the Automation Variable.
encrypted This property is required. boolean
Specifies if the Automation Variable is encrypted.
id This property is required. string
name This property is required. string
The name of the Automation Variable.
value This property is required. string
The value of the Automation Variable.
description This property is required. str
The description of the Automation Variable.
encrypted This property is required. bool
Specifies if the Automation Variable is encrypted.
id This property is required. str
name This property is required. str
The name of the Automation Variable.
value This property is required. str
The value of the Automation Variable.
description This property is required. String
The description of the Automation Variable.
encrypted This property is required. Boolean
Specifies if the Automation Variable is encrypted.
id This property is required. String
name This property is required. String
The name of the Automation Variable.
value This property is required. String
The value of the Automation Variable.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi