1. Packages
  2. Azure Native v2
  3. API Docs
  4. devtestlab
  5. Environment
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.devtestlab.Environment

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

An environment, which is essentially an ARM template deployment. Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15.

Example Usage

Environments_CreateOrUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var environment = new AzureNative.DevTestLab.Environment("environment", new()
    {
        DeploymentProperties = new AzureNative.DevTestLab.Inputs.EnvironmentDeploymentPropertiesArgs
        {
            ArmTemplateId = "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}",
            Parameters = new() { },
        },
        LabName = "{labName}",
        Name = "{environmentName}",
        ResourceGroupName = "resourceGroupName",
        UserName = "@me",
    });

});
Copy
package main

import (
	devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := devtestlab.NewEnvironment(ctx, "environment", &devtestlab.EnvironmentArgs{
			DeploymentProperties: &devtestlab.EnvironmentDeploymentPropertiesArgs{
				ArmTemplateId: pulumi.String("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"),
				Parameters:    devtestlab.ArmTemplateParameterPropertiesArray{},
			},
			LabName:           pulumi.String("{labName}"),
			Name:              pulumi.String("{environmentName}"),
			ResourceGroupName: pulumi.String("resourceGroupName"),
			UserName:          pulumi.String("@me"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.devtestlab.Environment;
import com.pulumi.azurenative.devtestlab.EnvironmentArgs;
import com.pulumi.azurenative.devtestlab.inputs.EnvironmentDeploymentPropertiesArgs;
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 environment = new Environment("environment", EnvironmentArgs.builder()
            .deploymentProperties(EnvironmentDeploymentPropertiesArgs.builder()
                .armTemplateId("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}")
                .parameters()
                .build())
            .labName("{labName}")
            .name("{environmentName}")
            .resourceGroupName("resourceGroupName")
            .userName("@me")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const environment = new azure_native.devtestlab.Environment("environment", {
    deploymentProperties: {
        armTemplateId: "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}",
        parameters: [],
    },
    labName: "{labName}",
    name: "{environmentName}",
    resourceGroupName: "resourceGroupName",
    userName: "@me",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

environment = azure_native.devtestlab.Environment("environment",
    deployment_properties={
        "arm_template_id": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}",
        "parameters": [],
    },
    lab_name="{labName}",
    name="{environmentName}",
    resource_group_name="resourceGroupName",
    user_name="@me")
Copy
resources:
  environment:
    type: azure-native:devtestlab:Environment
    properties:
      deploymentProperties:
        armTemplateId: /subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}
        parameters: []
      labName: '{labName}'
      name: '{environmentName}'
      resourceGroupName: resourceGroupName
      userName: '@me'
Copy

Create Environment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Environment(name: string, args: EnvironmentArgs, opts?: CustomResourceOptions);
@overload
def Environment(resource_name: str,
                args: EnvironmentArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def Environment(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                lab_name: Optional[str] = None,
                resource_group_name: Optional[str] = None,
                user_name: Optional[str] = None,
                arm_template_display_name: Optional[str] = None,
                deployment_properties: Optional[EnvironmentDeploymentPropertiesArgs] = None,
                location: Optional[str] = None,
                name: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None)
func NewEnvironment(ctx *Context, name string, args EnvironmentArgs, opts ...ResourceOption) (*Environment, error)
public Environment(string name, EnvironmentArgs args, CustomResourceOptions? opts = null)
public Environment(String name, EnvironmentArgs args)
public Environment(String name, EnvironmentArgs args, CustomResourceOptions options)
type: azure-native:devtestlab:Environment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. EnvironmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. EnvironmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. EnvironmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. EnvironmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. EnvironmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var azure_nativeEnvironmentResource = new AzureNative.Devtestlab.Environment("azure-nativeEnvironmentResource", new()
{
    LabName = "string",
    ResourceGroupName = "string",
    UserName = "string",
    ArmTemplateDisplayName = "string",
    DeploymentProperties = 
    {
        { "armTemplateId", "string" },
        { "parameters", new[]
        {
            
            {
                { "name", "string" },
                { "value", "string" },
            },
        } },
    },
    Location = "string",
    Name = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := devtestlab.NewEnvironment(ctx, "azure-nativeEnvironmentResource", &devtestlab.EnvironmentArgs{
	LabName:                "string",
	ResourceGroupName:      "string",
	UserName:               "string",
	ArmTemplateDisplayName: "string",
	DeploymentProperties: map[string]interface{}{
		"armTemplateId": "string",
		"parameters": []map[string]interface{}{
			map[string]interface{}{
				"name":  "string",
				"value": "string",
			},
		},
	},
	Location: "string",
	Name:     "string",
	Tags: map[string]interface{}{
		"string": "string",
	},
})
Copy
var azure_nativeEnvironmentResource = new Environment("azure-nativeEnvironmentResource", EnvironmentArgs.builder()
    .labName("string")
    .resourceGroupName("string")
    .userName("string")
    .armTemplateDisplayName("string")
    .deploymentProperties(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .location("string")
    .name("string")
    .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .build());
Copy
azure_native_environment_resource = azure_native.devtestlab.Environment("azure-nativeEnvironmentResource",
    lab_name=string,
    resource_group_name=string,
    user_name=string,
    arm_template_display_name=string,
    deployment_properties={
        armTemplateId: string,
        parameters: [{
            name: string,
            value: string,
        }],
    },
    location=string,
    name=string,
    tags={
        string: string,
    })
Copy
const azure_nativeEnvironmentResource = new azure_native.devtestlab.Environment("azure-nativeEnvironmentResource", {
    labName: "string",
    resourceGroupName: "string",
    userName: "string",
    armTemplateDisplayName: "string",
    deploymentProperties: {
        armTemplateId: "string",
        parameters: [{
            name: "string",
            value: "string",
        }],
    },
    location: "string",
    name: "string",
    tags: {
        string: "string",
    },
});
Copy
type: azure-native:devtestlab:Environment
properties:
    armTemplateDisplayName: string
    deploymentProperties:
        armTemplateId: string
        parameters:
            - name: string
              value: string
    labName: string
    location: string
    name: string
    resourceGroupName: string
    tags:
        string: string
    userName: string
Copy

Environment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Environment resource accepts the following input properties:

LabName
This property is required.
Changes to this property will trigger replacement.
string
The name of the lab.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
UserName
This property is required.
Changes to this property will trigger replacement.
string
The name of the user profile.
ArmTemplateDisplayName string
The display name of the Azure Resource Manager template that produced the environment.
DeploymentProperties Pulumi.AzureNative.DevTestLab.Inputs.EnvironmentDeploymentProperties
The deployment properties of the environment.
Location string
The location of the resource.
Name Changes to this property will trigger replacement. string
The name of the environment.
Tags Dictionary<string, string>
The tags of the resource.
LabName
This property is required.
Changes to this property will trigger replacement.
string
The name of the lab.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
UserName
This property is required.
Changes to this property will trigger replacement.
string
The name of the user profile.
ArmTemplateDisplayName string
The display name of the Azure Resource Manager template that produced the environment.
DeploymentProperties EnvironmentDeploymentPropertiesArgs
The deployment properties of the environment.
Location string
The location of the resource.
Name Changes to this property will trigger replacement. string
The name of the environment.
Tags map[string]string
The tags of the resource.
labName
This property is required.
Changes to this property will trigger replacement.
String
The name of the lab.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
userName
This property is required.
Changes to this property will trigger replacement.
String
The name of the user profile.
armTemplateDisplayName String
The display name of the Azure Resource Manager template that produced the environment.
deploymentProperties EnvironmentDeploymentProperties
The deployment properties of the environment.
location String
The location of the resource.
name Changes to this property will trigger replacement. String
The name of the environment.
tags Map<String,String>
The tags of the resource.
labName
This property is required.
Changes to this property will trigger replacement.
string
The name of the lab.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
userName
This property is required.
Changes to this property will trigger replacement.
string
The name of the user profile.
armTemplateDisplayName string
The display name of the Azure Resource Manager template that produced the environment.
deploymentProperties EnvironmentDeploymentProperties
The deployment properties of the environment.
location string
The location of the resource.
name Changes to this property will trigger replacement. string
The name of the environment.
tags {[key: string]: string}
The tags of the resource.
lab_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the lab.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group.
user_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the user profile.
arm_template_display_name str
The display name of the Azure Resource Manager template that produced the environment.
deployment_properties EnvironmentDeploymentPropertiesArgs
The deployment properties of the environment.
location str
The location of the resource.
name Changes to this property will trigger replacement. str
The name of the environment.
tags Mapping[str, str]
The tags of the resource.
labName
This property is required.
Changes to this property will trigger replacement.
String
The name of the lab.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
userName
This property is required.
Changes to this property will trigger replacement.
String
The name of the user profile.
armTemplateDisplayName String
The display name of the Azure Resource Manager template that produced the environment.
deploymentProperties Property Map
The deployment properties of the environment.
location String
The location of the resource.
name Changes to this property will trigger replacement. String
The name of the environment.
tags Map<String>
The tags of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the Environment resource produces the following output properties:

CreatedByUser string
The creator of the environment.
Id string
The provider-assigned unique ID for this managed resource.
ProvisioningState string
The provisioning status of the resource.
ResourceGroupId string
The identifier of the resource group containing the environment's resources.
Type string
The type of the resource.
UniqueIdentifier string
The unique immutable identifier of a resource (Guid).
CreatedByUser string
The creator of the environment.
Id string
The provider-assigned unique ID for this managed resource.
ProvisioningState string
The provisioning status of the resource.
ResourceGroupId string
The identifier of the resource group containing the environment's resources.
Type string
The type of the resource.
UniqueIdentifier string
The unique immutable identifier of a resource (Guid).
createdByUser String
The creator of the environment.
id String
The provider-assigned unique ID for this managed resource.
provisioningState String
The provisioning status of the resource.
resourceGroupId String
The identifier of the resource group containing the environment's resources.
type String
The type of the resource.
uniqueIdentifier String
The unique immutable identifier of a resource (Guid).
createdByUser string
The creator of the environment.
id string
The provider-assigned unique ID for this managed resource.
provisioningState string
The provisioning status of the resource.
resourceGroupId string
The identifier of the resource group containing the environment's resources.
type string
The type of the resource.
uniqueIdentifier string
The unique immutable identifier of a resource (Guid).
created_by_user str
The creator of the environment.
id str
The provider-assigned unique ID for this managed resource.
provisioning_state str
The provisioning status of the resource.
resource_group_id str
The identifier of the resource group containing the environment's resources.
type str
The type of the resource.
unique_identifier str
The unique immutable identifier of a resource (Guid).
createdByUser String
The creator of the environment.
id String
The provider-assigned unique ID for this managed resource.
provisioningState String
The provisioning status of the resource.
resourceGroupId String
The identifier of the resource group containing the environment's resources.
type String
The type of the resource.
uniqueIdentifier String
The unique immutable identifier of a resource (Guid).

Supporting Types

ArmTemplateParameterProperties
, ArmTemplateParameterPropertiesArgs

Name string
The name of the template parameter.
Value string
The value of the template parameter.
Name string
The name of the template parameter.
Value string
The value of the template parameter.
name String
The name of the template parameter.
value String
The value of the template parameter.
name string
The name of the template parameter.
value string
The value of the template parameter.
name str
The name of the template parameter.
value str
The value of the template parameter.
name String
The name of the template parameter.
value String
The value of the template parameter.

ArmTemplateParameterPropertiesResponse
, ArmTemplateParameterPropertiesResponseArgs

Name string
The name of the template parameter.
Value string
The value of the template parameter.
Name string
The name of the template parameter.
Value string
The value of the template parameter.
name String
The name of the template parameter.
value String
The value of the template parameter.
name string
The name of the template parameter.
value string
The value of the template parameter.
name str
The name of the template parameter.
value str
The value of the template parameter.
name String
The name of the template parameter.
value String
The value of the template parameter.

EnvironmentDeploymentProperties
, EnvironmentDeploymentPropertiesArgs

ArmTemplateId string
The Azure Resource Manager template's identifier.
Parameters List<Pulumi.AzureNative.DevTestLab.Inputs.ArmTemplateParameterProperties>
The parameters of the Azure Resource Manager template.
ArmTemplateId string
The Azure Resource Manager template's identifier.
Parameters []ArmTemplateParameterProperties
The parameters of the Azure Resource Manager template.
armTemplateId String
The Azure Resource Manager template's identifier.
parameters List<ArmTemplateParameterProperties>
The parameters of the Azure Resource Manager template.
armTemplateId string
The Azure Resource Manager template's identifier.
parameters ArmTemplateParameterProperties[]
The parameters of the Azure Resource Manager template.
arm_template_id str
The Azure Resource Manager template's identifier.
parameters Sequence[ArmTemplateParameterProperties]
The parameters of the Azure Resource Manager template.
armTemplateId String
The Azure Resource Manager template's identifier.
parameters List<Property Map>
The parameters of the Azure Resource Manager template.

EnvironmentDeploymentPropertiesResponse
, EnvironmentDeploymentPropertiesResponseArgs

ArmTemplateId string
The Azure Resource Manager template's identifier.
Parameters List<Pulumi.AzureNative.DevTestLab.Inputs.ArmTemplateParameterPropertiesResponse>
The parameters of the Azure Resource Manager template.
ArmTemplateId string
The Azure Resource Manager template's identifier.
Parameters []ArmTemplateParameterPropertiesResponse
The parameters of the Azure Resource Manager template.
armTemplateId String
The Azure Resource Manager template's identifier.
parameters List<ArmTemplateParameterPropertiesResponse>
The parameters of the Azure Resource Manager template.
armTemplateId string
The Azure Resource Manager template's identifier.
parameters ArmTemplateParameterPropertiesResponse[]
The parameters of the Azure Resource Manager template.
arm_template_id str
The Azure Resource Manager template's identifier.
parameters Sequence[ArmTemplateParameterPropertiesResponse]
The parameters of the Azure Resource Manager template.
armTemplateId String
The Azure Resource Manager template's identifier.
parameters List<Property Map>
The parameters of the Azure Resource Manager template.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:devtestlab:Environment {environmentName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi