Skip to main content

environments

Creates, updates, deletes, gets or lists an environments resource.

Overview

Nameenvironments
TypeResource
Idazure.developer_devcenter.environments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringEnvironment name. Required.
catalogNamestringName of the catalog. Required.
environmentDefinitionNamestringName of the environment definition. Required.
environmentTypestringEnvironment type. Required.
errorobjectProvisioning error details. Populated only for error states.
parametersobjectParameters object for the environment.
provisioningStatestringThe provisioning state of the environment. Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Accepted", "Deleting", "Updating", "Preparing", "Running", "Syncing", "MovingResources", "TransientFailure", and "StorageProvisioningFailed". (Succeeded, Failed, Canceled, Creating, Accepted, Deleting, Updating, Preparing, Running, Syncing, MovingResources, TransientFailure, StorageProvisioningFailed)
resourceGroupIdstringThe identifier of the resource group containing the environment's resources.
userstringThe AAD object id of the owner of this Environment.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_environmentselectproject_name, user_id, environment_name, endpointGets an environment.
list_environmentsselectproject_name, user_id, endpointLists the environments for a project and user.
create_or_update_environmentinsertproject_name, user_id, environment_name, endpoint, environmentType, catalogName, environmentDefinitionNameCreates or updates an environment.
create_or_update_environmentreplaceproject_name, user_id, environment_name, endpoint, environmentType, catalogName, environmentDefinitionNameCreates or updates an environment.
delete_environmentdeleteproject_name, user_id, environment_name, endpointDeletes an environment and all its associated resources.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
environment_namestringThe name of the environment. Required.
project_namestringThe DevCenter Project upon which to execute operations. Required.
user_idstringThe AAD object id of the user. If value is 'me', the identity is taken from the authentication context. Required.

SELECT examples

Gets an environment.

SELECT
name,
catalogName,
environmentDefinitionName,
environmentType,
error,
parameters,
provisioningState,
resourceGroupId,
user
FROM azure.developer_devcenter.environments
WHERE project_name = '{{ project_name }}' -- required
AND user_id = '{{ user_id }}' -- required
AND environment_name = '{{ environment_name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;

INSERT examples

Creates or updates an environment.

INSERT INTO azure.developer_devcenter.environments (
parameters,
environmentType,
catalogName,
environmentDefinitionName,
project_name,
user_id,
environment_name,
endpoint
)
SELECT
'{{ parameters }}',
'{{ environmentType }}' /* required */,
'{{ catalogName }}' /* required */,
'{{ environmentDefinitionName }}' /* required */,
'{{ project_name }}',
'{{ user_id }}',
'{{ environment_name }}',
'{{ endpoint }}'
RETURNING
name,
catalogName,
environmentDefinitionName,
environmentType,
error,
parameters,
provisioningState,
resourceGroupId,
user
;

REPLACE examples

Creates or updates an environment.

REPLACE azure.developer_devcenter.environments
SET
parameters = '{{ parameters }}',
environmentType = '{{ environmentType }}',
catalogName = '{{ catalogName }}',
environmentDefinitionName = '{{ environmentDefinitionName }}'
WHERE
project_name = '{{ project_name }}' --required
AND user_id = '{{ user_id }}' --required
AND environment_name = '{{ environment_name }}' --required
AND endpoint = '{{ endpoint }}' --required
AND environmentType = '{{ environmentType }}' --required
AND catalogName = '{{ catalogName }}' --required
AND environmentDefinitionName = '{{ environmentDefinitionName }}' --required
RETURNING
name,
catalogName,
environmentDefinitionName,
environmentType,
error,
parameters,
provisioningState,
resourceGroupId,
user;

DELETE examples

Deletes an environment and all its associated resources.

DELETE FROM azure.developer_devcenter.environments
WHERE project_name = '{{ project_name }}' --required
AND user_id = '{{ user_id }}' --required
AND environment_name = '{{ environment_name }}' --required
AND endpoint = '{{ endpoint }}' --required
;