You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Create and access an environment by using the Azure CLI
3
+
titleSuffix: Azure Deployment Environments
4
+
description: Learn how to create and access an environment in an Azure Deployment Environments Preview project by using the AzureCLI.
5
+
author: RoseHJM
6
+
ms.author: rosemalcolm
7
+
ms.service: deployment-environments
8
+
ms.custom: ignite-2022
9
+
ms.topic: quickstart
10
+
ms.date: 01/26/2022
11
+
---
12
+
13
+
# Create and access an environment by using the Azure CLI
14
+
15
+
This article shows you how to create and access an [environment](concept-environments-key-concepts.md#environments) in an existing Azure Deployment Environments Preview project.
16
+
17
+
> [!IMPORTANT]
18
+
> Azure Deployment Environments currently is in preview. For legal terms that apply to Azure features that are in beta, in preview, or otherwise not yet released into general availability, see the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
19
+
20
+
## Prerequisites
21
+
22
+
-[Create and configure a dev center](quickstart-create-and-configure-devcenter.md).
23
+
-[Create and configure a project](quickstart-create-and-configure-projects.md).
24
+
- Install the Azure Deployment Environments Azure CLI extension:
25
+
26
+
1.[Download and install the Azure CLI](/cli/azure/install-azure-cli).
27
+
1. Install the Azure Deployment Environments AZ CLI extension:
28
+
29
+
**Automated installation**
30
+
31
+
In PowerShell, run the https://aka.ms/DevCenter/Install-DevCenterCli.ps1 script:
The script uninstalls any existing dev center extension and installs the latest version.
38
+
39
+
**Manual installation**
40
+
41
+
Run the following command in the Azure CLI:
42
+
43
+
```azurecli
44
+
az extension add --source https://fidalgosetup.blob.core.windows.net/cli-extensions/devcenter-0.1.0-py3-none-any.whl
45
+
```
46
+
47
+
## Create an environment
48
+
49
+
Complete the following steps in the Azure CLI to create an environment and configure resources. You can view the outputs as defined in the specific Azure Resource Manager template (ARM template).
50
+
51
+
> [!NOTE]
52
+
> Only a user who has the [Deployment Environments User](how-to-configure-deployment-environments-user.md) role, the [DevCenter Project Admin](how-to-configure-project-admin.md) role, or a [built-in role](../role-based-access-control/built-in-roles.md) that has appropriate permissions can create an environment.
53
+
54
+
55
+
1. Sign in to the Azure CLI:
56
+
57
+
```azurecli
58
+
az login
59
+
```
60
+
61
+
1. List all the Azure Deployment Environments projects you have access to:
62
+
63
+
```azurecli
64
+
az graph query -q "Resources | where type =~ 'microsoft.devcenter/projects'" -o table
65
+
```
66
+
67
+
1. Configure the default subscription as the subscription that contains the project:
68
+
69
+
```azurecli
70
+
az account set --subscription <name>
71
+
```
72
+
73
+
1. Configure the default resource group as the resource group that contains the project:
74
+
75
+
```azurecli
76
+
az config set defaults.group=<name>
77
+
```
78
+
79
+
1. List the type of environments you can create in a specific project:
80
+
81
+
```azurecli
82
+
az devcenter dev environment-type list --dev-center <name> --project-name <name> -o table
83
+
```
84
+
85
+
1. List the [catalog items](concept-environments-key-concepts.md#catalog-items) that are available to a specific project:
86
+
87
+
```azurecli
88
+
az devcenter dev catalog-item list --dev-center <name> --project-name <name> -o table
89
+
```
90
+
91
+
1. Create an environment by using a *catalog-item* (an infrastructure-as-code template defined in the [manifest.yaml](configure-catalog-item.md#add-a-new-catalog-item) file) from the list of available catalog items:
92
+
93
+
```azurecli
94
+
az devcenter dev environment create --dev-center-name <devcenter-name>
> You can use `--help` to view more details about any command, accepted arguments and examples. For example, use `az devcenter dev environment create --help` to view more details about creating an environment.
111
+
112
+
### Troubleshoot permission error
113
+
114
+
You must have the [Deployment Environments User](how-to-configure-deployment-environments-user.md) role, the [DevCenter Project Admin](how-to-configure-project-admin.md) role, or a [built-in role](../role-based-access-control/built-in-roles.md) that has appropriate permissions can create an environment.
115
+
116
+
If you don't have the correct permissions, creation of the environment will fail, and you may receive an error message like this:
117
+
118
+
```
119
+
(EnvironmentNotFound) The environment resource was not found.
120
+
Code: EnvironmentNotFound
121
+
Message: The environment resource was not found.
122
+
```
123
+
124
+
To resolve the issue, assign the correct permissions: [Give project access to the development team](quickstart-create-and-configure-projects.md#give-project-access-to-the-development-team).
125
+
126
+
## Access an environment
127
+
128
+
To access an environment:
129
+
130
+
1. List existing environments that are available in a specific project:
131
+
132
+
```azurecli
133
+
az devcenter dev environment list --dev-center <devcenter-name> --project-name <project-name>
134
+
```
135
+
136
+
1. View the access endpoints to various resources as defined in the ARM template outputs.
137
+
1. Access the specific resources by using the endpoints.
138
+
139
+
## Next steps
140
+
141
+
- Learn how to [add and configure a catalog](how-to-configure-catalog.md).
142
+
- Learn how to [add and configure a catalog item](configure-catalog-item.md).
This quickstart shows you how to create and access an [environment](concept-environments-key-concepts.md#environments) in an existing Azure Deployment Environments Preview project.
16
16
17
-
Only a user who has the [Deployment Environments User](how-to-configure-deployment-environments-user.md) role, the [DevCenter Project Admin](how-to-configure-project-admin.md) role, or a [built-in role](../role-based-access-control/built-in-roles.md) that has appropriate permissions can create an environment.
18
-
19
17
In this quickstart, you learn how to:
20
18
21
19
> [!div class="checklist"]
@@ -24,122 +22,49 @@ In this quickstart, you learn how to:
24
22
> - Access an environment
25
23
26
24
> [!IMPORTANT]
27
-
> Azure Deployment Environments currently is in preview. For legal terms that apply to Azure features that are in beta, in preview, or otherwise not yet released into general availability, see the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
25
+
> Azure Deployment Environments currently is in preview. For legal terms that apply to Azure features that are in beta, in preview, or otherwise not yet released into general availability, go to the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
28
26
29
27
## Prerequisites
30
28
31
29
-[Create and configure a dev center](quickstart-create-and-configure-devcenter.md).
32
30
-[Create and configure a project](quickstart-create-and-configure-projects.md).
33
-
- Install the Azure Deployment Environments Azure CLI extension:
34
-
35
-
1.[Download and install the Azure CLI](/cli/azure/install-azure-cli).
36
-
1. Install the Azure Deployment Environments AZ CLI extension:
37
-
38
-
**Automated installation**
39
-
40
-
In PowerShell, run the https://aka.ms/DevCenter/Install-DevCenterCli.ps1 script:
The script uninstalls any existing dev center extension and installs the latest version.
47
-
48
-
**Manual installation**
49
-
50
-
Run the following command in the Azure CLI:
51
-
52
-
```azurecli
53
-
az extension add --source https://fidalgosetup.blob.core.windows.net/cli-extensions/devcenter-0.1.0-py3-none-any.whl
54
-
```
55
31
56
32
## Create an environment
57
-
58
-
Complete the following steps in the Azure CLI to create an environment and configure resources. You can view the outputs as defined in the specific Azure Resource Manager template (ARM template).
59
-
60
-
1. Sign in to the Azure CLI:
61
-
62
-
```azurecli
63
-
az login
64
-
```
65
-
66
-
1. List all the Azure Deployment Environments projects you have access to:
67
-
68
-
```azurecli
69
-
az graph query -q "Resources | where type =~ 'microsoft.devcenter/projects'" -o table
70
-
```
71
-
72
-
1. Configure the default subscription as the subscription that contains the project:
73
-
74
-
```azurecli
75
-
az account set --subscription <name>
76
-
```
77
-
78
-
1. Configure the default resource group as the resource group that contains the project:
79
-
80
-
```azurecli
81
-
az config set defaults.group=<name>
82
-
```
83
-
84
-
1. List the type of environments you can create in a specific project:
85
-
86
-
```azurecli
87
-
az devcenter dev environment-type list --dev-center <name> --project-name <name> -o table
88
-
```
89
-
90
-
1. List the [catalog items](concept-environments-key-concepts.md#catalog-items) that are available to a specific project:
91
-
92
-
```azurecli
93
-
az devcenter dev catalog-item list --dev-center <name> --project-name <name> -o table
94
-
```
95
-
96
-
1. Create an environment by using a *catalog-item* (an infrastructure-as-code template defined in the [manifest.yaml](configure-catalog-item.md#add-a-new-catalog-item) file) from the list of available catalog items:
97
-
98
-
```azurecli
99
-
az devcenter dev environment create --dev-center-name <devcenter-name>
You can create an environment from the developer portal.
113
34
114
35
> [!NOTE]
115
-
> You can use `--help` to view more details about any command, accepted arguments and examples. For example, use `az devcenter dev environment create --help` to view more details about creating an environment.
116
-
117
-
### Troubleshoot permission error
36
+
> Only a user who has the [Deployment Environments User](how-to-configure-deployment-environments-user.md) role, the [DevCenter Project Admin](how-to-configure-project-admin.md) role, or a [built-in role](../role-based-access-control/built-in-roles.md) that has appropriate permissions can create an environment.
118
37
119
-
You must have the [Deployment Environments User](how-to-configure-deployment-environments-user.md) role, the [DevCenter Project Admin](how-to-configure-project-admin.md) role, or a [built-in role](../role-based-access-control/built-in-roles.md) that has appropriate permissions can create an environment.
38
+
1. Sign in to the [developer portal](https://devportal.microsoft.com).
39
+
1. From the **New** menu at the top right, select **New environment**.
40
+
41
+
:::image type="content" source="media/quickstart-create-access-environments/new-environment.png" alt-text="Screenshot showing the new menu with new environment highlighted.":::
42
+
43
+
1. In the Add an environment pane, select the following information:
120
44
121
-
If you don't have the correct permissions, creation of the environment will fail, and you may receive an error message like this:
45
+
|Field |Value |
46
+
|---------|---------|
47
+
|Name | Enter a descriptive name for your environment. |
48
+
|Project | Select the project you want to create the environment in. If you have access to more than one project, you'll see a list of the available projects. |
49
+
|Type | Select the environment type you want to create. If you have access to more than one environment type, you'll see a list of the available types. |
50
+
|Catalog item | Select the catalog item you want to use to create the environment. You'll see a list of the catalog items available from the catalogs associated with your dev center. |
122
51
123
-
```
124
-
(EnvironmentNotFound) The environment resource was not found.
To resolve the issue, assign the correct permissions: [Give project access to the development team](quickstart-create-and-configure-projects.md#give-project-access-to-the-development-team).
54
+
If your environment is configured to accept parameters, you'll be able to enter them on a separate pane. In this example, you don't need to specify any parameters.
130
55
56
+
1. Select **Create**. You'll see your environment in the developer portal immediately, with an indicator that shows creation in progress.
57
+
131
58
## Access an environment
59
+
You can access and manage your environments in the Microsoft Developer portal.
132
60
133
-
To access an environment:
134
-
135
-
1. List existing environments that are available in a specific project:
61
+
1. Sign in to the [developer portal](https://devportal.microsoft.com).
136
62
137
-
```azurecli
138
-
az devcenter dev environment list --dev-center <devcenter-name> --project-name <project-name>
139
-
```
63
+
1. You'll be able to view all of your existing environments. To access the specific resources created as part of an Environment, select the **Environment Resources** link.
64
+
:::image type="content" source="media/quickstart-create-access-environments/environment-resources.png" alt-text="Screenshot showing an environment card, with the environment resources link highlighted.":::
140
65
141
-
1.View the access endpoints to various resources as defined in the ARM template outputs.
142
-
1. Access the specific resources by using the endpoints.
66
+
1.You'll be able to view the resources in your environment listed in the Azure portal.
67
+
:::image type="content" source="media/quickstart-create-access-environments/azure-portal-view-of-environment.png" alt-text="Screenshot showing Azure portal list of environment resources.":::
0 commit comments