We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.automation.getVariables
Start a Neo task
Explain and create an azure.automation.getVariables resource
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;
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"])
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
})
}
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,
};
});
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.id())
.build());
ctx.export("stringVars", exampleAzurermAutomationVariableString.string());
}
}
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}
API Providers
This data source uses the following Azure API Providers:
Microsoft.Automation- 2023-11-01
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>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]func GetVariables(ctx *Context, args *GetVariablesArgs, opts ...InvokeOption) (*GetVariablesResult, error)
func GetVariablesOutput(ctx *Context, args *GetVariablesOutputArgs, opts ...InvokeOption) GetVariablesResultOutput> 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)
}public static CompletableFuture<GetVariablesResult> getVariables(GetVariablesArgs args, InvokeOptions options)
public static Output<GetVariablesResult> getVariables(GetVariablesArgs args, InvokeOptions options)
fn::invoke:
function: azure:automation/getVariables:getVariables
arguments:
# arguments dictionaryThe following arguments are supported:
- Automation
Account stringId - The resource ID of the automation account.
- Automation
Account stringId - The resource ID of the automation account.
- automation
Account StringId - The resource ID of the automation account.
- automation
Account stringId - The resource ID of the automation account.
- automation_
account_ strid - The resource ID of the automation account.
- automation
Account StringId - The resource ID of the automation account.
getVariables Result
The following output properties are available:
- Automation
Account stringId - Bools
List<Get
Variables Bool> - One or more
variableblocks as defined below for each boolean variable. - Datetimes
List<Get
Variables Datetime> - One or more
variableblocks as defined below for each datetime variable. - Encrypteds
List<Get
Variables Encrypted> - Specifies if the Automation Variable is encrypted.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ints
List<Get
Variables Int> - One or more
variableblocks as defined below for each int variable. - Nulls
List<Get
Variables Null> - One or more
variableblocks as defined below for each null variable. - Objects
List<Get
Variables Object> - Strings
List<Get
Variables String> - One or more
variableblocks as defined below for each string variable.
- Automation
Account stringId - Bools
[]Get
Variables Bool - One or more
variableblocks as defined below for each boolean variable. - Datetimes
[]Get
Variables Datetime - One or more
variableblocks as defined below for each datetime variable. - Encrypteds
[]Get
Variables Encrypted - Specifies if the Automation Variable is encrypted.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ints
[]Get
Variables Int - One or more
variableblocks as defined below for each int variable. - Nulls
[]Get
Variables Null - One or more
variableblocks as defined below for each null variable. - Objects
[]Get
Variables Object - Strings
[]Get
Variables String - One or more
variableblocks as defined below for each string variable.
- automation
Account StringId - bools
List<Get
Variables Bool> - One or more
variableblocks as defined below for each boolean variable. - datetimes
List<Get
Variables Datetime> - One or more
variableblocks as defined below for each datetime variable. - encrypteds
List<Get
Variables Encrypted> - Specifies if the Automation Variable is encrypted.
- id String
- The provider-assigned unique ID for this managed resource.
- ints
List<Get
Variables Int> - One or more
variableblocks as defined below for each int variable. - nulls
List<Get
Variables Null> - One or more
variableblocks as defined below for each null variable. - objects
List<Get
Variables Object> - strings
List<Get
Variables String> - One or more
variableblocks as defined below for each string variable.
- automation
Account stringId - bools
Get
Variables Bool[] - One or more
variableblocks as defined below for each boolean variable. - datetimes
Get
Variables Datetime[] - One or more
variableblocks as defined below for each datetime variable. - encrypteds
Get
Variables Encrypted[] - Specifies if the Automation Variable is encrypted.
- id string
- The provider-assigned unique ID for this managed resource.
- ints
Get
Variables Int[] - One or more
variableblocks as defined below for each int variable. - nulls
Get
Variables Null[] - One or more
variableblocks as defined below for each null variable. - objects
Get
Variables Object[] - strings
Get
Variables String[] - One or more
variableblocks as defined below for each string variable.
- automation_
account_ strid - bools
Sequence[Get
Variables Bool] - One or more
variableblocks as defined below for each boolean variable. - datetimes
Sequence[Get
Variables Datetime] - One or more
variableblocks as defined below for each datetime variable. - encrypteds
Sequence[Get
Variables Encrypted] - Specifies if the Automation Variable is encrypted.
- id str
- The provider-assigned unique ID for this managed resource.
- ints
Sequence[Get
Variables Int] - One or more
variableblocks as defined below for each int variable. - nulls
Sequence[Get
Variables Null] - One or more
variableblocks as defined below for each null variable. - objects
Sequence[Get
Variables Object] - strings
Sequence[Get
Variables String] - One or more
variableblocks as defined below for each string variable.
- automation
Account StringId - bools List<Property Map>
- One or more
variableblocks as defined below for each boolean variable. - datetimes List<Property Map>
- One or more
variableblocks 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
variableblocks as defined below for each int variable. - nulls List<Property Map>
- One or more
variableblocks as defined below for each null variable. - objects List<Property Map>
- strings List<Property Map>
- One or more
variableblocks as defined below for each string variable.
Supporting Types
GetVariablesBool
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value bool
- The value of the Automation Variable.
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value bool
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value Boolean
- The value of the Automation Variable.
- description string
- The description of the Automation Variable.
- encrypted boolean
- Specifies if the Automation Variable is encrypted.
- id string
- name string
- The name of the Automation Variable.
- value boolean
- The value of the Automation Variable.
- description str
- The description of the Automation Variable.
- encrypted bool
- Specifies if the Automation Variable is encrypted.
- id str
- name str
- The name of the Automation Variable.
- value bool
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value Boolean
- The value of the Automation Variable.
GetVariablesDatetime
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
- description string
- The description of the Automation Variable.
- encrypted boolean
- Specifies if the Automation Variable is encrypted.
- id string
- name string
- The name of the Automation Variable.
- value string
- The value of the Automation Variable.
- description str
- The description of the Automation Variable.
- encrypted bool
- Specifies if the Automation Variable is encrypted.
- id str
- name str
- The name of the Automation Variable.
- value str
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
GetVariablesEncrypted
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
- description string
- The description of the Automation Variable.
- encrypted boolean
- Specifies if the Automation Variable is encrypted.
- id string
- name string
- The name of the Automation Variable.
- value string
- The value of the Automation Variable.
- description str
- The description of the Automation Variable.
- encrypted bool
- Specifies if the Automation Variable is encrypted.
- id str
- name str
- The name of the Automation Variable.
- value str
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
GetVariablesInt
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value int
- The value of the Automation Variable.
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value int
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value Integer
- The value of the Automation Variable.
- description string
- The description of the Automation Variable.
- encrypted boolean
- Specifies if the Automation Variable is encrypted.
- id string
- name string
- The name of the Automation Variable.
- value number
- The value of the Automation Variable.
- description str
- The description of the Automation Variable.
- encrypted bool
- Specifies if the Automation Variable is encrypted.
- id str
- name str
- The name of the Automation Variable.
- value int
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value Number
- The value of the Automation Variable.
GetVariablesNull
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
- description string
- The description of the Automation Variable.
- encrypted boolean
- Specifies if the Automation Variable is encrypted.
- id string
- name string
- The name of the Automation Variable.
- value string
- The value of the Automation Variable.
- description str
- The description of the Automation Variable.
- encrypted bool
- Specifies if the Automation Variable is encrypted.
- id str
- name str
- The name of the Automation Variable.
- value str
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
GetVariablesObject
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
- description string
- The description of the Automation Variable.
- encrypted boolean
- Specifies if the Automation Variable is encrypted.
- id string
- name string
- The name of the Automation Variable.
- value string
- The value of the Automation Variable.
- description str
- The description of the Automation Variable.
- encrypted bool
- Specifies if the Automation Variable is encrypted.
- id str
- name str
- The name of the Automation Variable.
- value str
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
GetVariablesString
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- Description string
- The description of the Automation Variable.
- Encrypted bool
- Specifies if the Automation Variable is encrypted.
- Id string
- Name string
- The name of the Automation Variable.
- Value string
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value String
- The value of the Automation Variable.
- description string
- The description of the Automation Variable.
- encrypted boolean
- Specifies if the Automation Variable is encrypted.
- id string
- name string
- The name of the Automation Variable.
- value string
- The value of the Automation Variable.
- description str
- The description of the Automation Variable.
- encrypted bool
- Specifies if the Automation Variable is encrypted.
- id str
- name str
- The name of the Automation Variable.
- value str
- The value of the Automation Variable.
- description String
- The description of the Automation Variable.
- encrypted Boolean
- Specifies if the Automation Variable is encrypted.
- id String
- name String
- The name of the Automation Variable.
- value 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
azurermTerraform Provider.
