environments
Creates, updates, deletes, gets or lists an environments resource.
Overview
| Name | environments |
| Type | Resource |
| Id | azure.developer_devcenter.environments |
Fields
The following fields are returned by SELECT queries:
- get_environment
- list_environments
| Name | Datatype | Description |
|---|---|---|
name | string | Environment name. Required. |
catalogName | string | Name of the catalog. Required. |
environmentDefinitionName | string | Name of the environment definition. Required. |
environmentType | string | Environment type. Required. |
error | object | Provisioning error details. Populated only for error states. |
parameters | object | Parameters object for the environment. |
provisioningState | string | The 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) |
resourceGroupId | string | The identifier of the resource group containing the environment's resources. |
user | string | The AAD object id of the owner of this Environment. |
| Name | Datatype | Description |
|---|---|---|
name | string | Environment name. Required. |
catalogName | string | Name of the catalog. Required. |
environmentDefinitionName | string | Name of the environment definition. Required. |
environmentType | string | Environment type. Required. |
error | object | Provisioning error details. Populated only for error states. |
parameters | object | Parameters object for the environment. |
provisioningState | string | The 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) |
resourceGroupId | string | The identifier of the resource group containing the environment's resources. |
user | string | The AAD object id of the owner of this Environment. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_environment | select | project_name, user_id, environment_name, endpoint | Gets an environment. | |
list_environments | select | project_name, user_id, endpoint | Lists the environments for a project and user. | |
create_or_update_environment | insert | project_name, user_id, environment_name, endpoint, environmentType, catalogName, environmentDefinitionName | Creates or updates an environment. | |
create_or_update_environment | replace | project_name, user_id, environment_name, endpoint, environmentType, catalogName, environmentDefinitionName | Creates or updates an environment. | |
delete_environment | delete | project_name, user_id, environment_name, endpoint | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
endpoint | string | The service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: ) |
environment_name | string | The name of the environment. Required. |
project_name | string | The DevCenter Project upon which to execute operations. Required. |
user_id | string | The AAD object id of the user. If value is 'me', the identity is taken from the authentication context. Required. |
SELECT examples
- get_environment
- list_environments
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
;
Lists the environments for a project and user.
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 endpoint = '{{ endpoint }}' -- required
;
INSERT examples
- create_or_update_environment
- Manifest
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
;
# Description fields are for documentation purposes
- name: environments
props:
- name: project_name
value: "{{ project_name }}"
description: Required parameter for the environments resource.
- name: user_id
value: "{{ user_id }}"
description: Required parameter for the environments resource.
- name: environment_name
value: "{{ environment_name }}"
description: Required parameter for the environments resource.
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the environments resource.
- name: parameters
value: "{{ parameters }}"
description: |
Parameters object for the environment.
- name: environmentType
value: "{{ environmentType }}"
description: |
Environment type. Required.
- name: catalogName
value: "{{ catalogName }}"
description: |
Name of the catalog. Required.
- name: environmentDefinitionName
value: "{{ environmentDefinitionName }}"
description: |
Name of the environment definition. Required.
REPLACE examples
- create_or_update_environment
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
- delete_environment
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
;