We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.automation.getVariables
Explore with Pulumi AI
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.applyValue(getAccountResult -> getAccountResult.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}
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:
- AutomationAccount stringId 
- The resource ID of the automation account.
- AutomationAccount stringId 
- The resource ID of the automation account.
- automationAccount StringId 
- The resource ID of the automation account.
- automationAccount stringId 
- The resource ID of the automation account.
- automation_account_ strid 
- The resource ID of the automation account.
- automationAccount StringId 
- The resource ID of the automation account.
getVariables Result
The following output properties are available:
- AutomationAccount stringId 
- Bools
List<GetVariables Bool> 
- One or more variableblocks as defined below for each boolean variable.
- Datetimes
List<GetVariables Datetime> 
- One or more variableblocks as defined below for each datetime variable.
- Encrypteds
List<GetVariables Encrypted> 
- Specifies if the Automation Variable is encrypted.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ints
List<GetVariables Int> 
- One or more variableblocks as defined below for each int variable.
- Nulls
List<GetVariables Null> 
- One or more variableblocks as defined below for each null variable.
- Objects
List<GetVariables Object> 
- Strings
List<GetVariables String> 
- One or more variableblocks as defined below for each string variable.
- AutomationAccount stringId 
- Bools
[]GetVariables Bool 
- One or more variableblocks as defined below for each boolean variable.
- Datetimes
[]GetVariables Datetime 
- One or more variableblocks as defined below for each datetime variable.
- Encrypteds
[]GetVariables Encrypted 
- Specifies if the Automation Variable is encrypted.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ints
[]GetVariables Int 
- One or more variableblocks as defined below for each int variable.
- Nulls
[]GetVariables Null 
- One or more variableblocks as defined below for each null variable.
- Objects
[]GetVariables Object 
- Strings
[]GetVariables String 
- One or more variableblocks as defined below for each string variable.
- automationAccount StringId 
- bools
List<GetVariables Bool> 
- One or more variableblocks as defined below for each boolean variable.
- datetimes
List<GetVariables Datetime> 
- One or more variableblocks as defined below for each datetime variable.
- encrypteds
List<GetVariables Encrypted> 
- Specifies if the Automation Variable is encrypted.
- id String
- The provider-assigned unique ID for this managed resource.
- ints
List<GetVariables Int> 
- One or more variableblocks as defined below for each int variable.
- nulls
List<GetVariables Null> 
- One or more variableblocks as defined below for each null variable.
- objects
List<GetVariables Object> 
- strings
List<GetVariables String> 
- One or more variableblocks as defined below for each string variable.
- automationAccount stringId 
- bools
GetVariables Bool[] 
- One or more variableblocks as defined below for each boolean variable.
- datetimes
GetVariables Datetime[] 
- One or more variableblocks as defined below for each datetime variable.
- encrypteds
GetVariables Encrypted[] 
- Specifies if the Automation Variable is encrypted.
- id string
- The provider-assigned unique ID for this managed resource.
- ints
GetVariables Int[] 
- One or more variableblocks as defined below for each int variable.
- nulls
GetVariables Null[] 
- One or more variableblocks as defined below for each null variable.
- objects
GetVariables Object[] 
- strings
GetVariables String[] 
- One or more variableblocks as defined below for each string variable.
- automation_account_ strid 
- bools
Sequence[GetVariables Bool] 
- One or more variableblocks as defined below for each boolean variable.
- datetimes
Sequence[GetVariables Datetime] 
- One or more variableblocks as defined below for each datetime variable.
- encrypteds
Sequence[GetVariables Encrypted] 
- Specifies if the Automation Variable is encrypted.
- id str
- The provider-assigned unique ID for this managed resource.
- ints
Sequence[GetVariables Int] 
- One or more variableblocks as defined below for each int variable.
- nulls
Sequence[GetVariables Null] 
- One or more variableblocks as defined below for each null variable.
- objects
Sequence[GetVariables Object] 
- strings
Sequence[GetVariables String] 
- One or more variableblocks as defined below for each string variable.
- automationAccount 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.