Skip to content

Commit 993a5bc

Browse files
authored
Merge pull request #225212 from RoseHJM/ade-developerUX-updates
New developer UX updates
2 parents c5c086e + 529b6ab commit 993a5bc

File tree

7 files changed

+169
-100
lines changed

7 files changed

+169
-100
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
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:
32+
33+
```powershell
34+
iex "& { $(irm https://aka.ms/DevCenter/Install-DevCenterCli.ps1 ) }"
35+
```
36+
37+
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>
95+
--project-name <project-name> --environment-type <environment-type-name>
96+
--catalog-item-name <catalog-item-name> --catalog-name <catalog-name>
97+
```
98+
99+
If the specific *catalog-item* requires any parameters, use `--parameters` and provide the parameters as a JSON string or a JSON file. For example:
100+
101+
```json
102+
$params = "{ 'name': 'firstMsi', 'location': 'northeurope' }"
103+
az devcenter dev environment create --dev-center-name <devcenter-name>
104+
--project-name <project-name> -n <name> --environment-type <environment-type-name>
105+
--catalog-item-name <catalog-item-name> --catalog-name <catalog-name>
106+
--parameters $params
107+
```
108+
109+
> [!NOTE]
110+
> 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).
22.4 KB
Loading
Loading
72.7 KB
Loading
6.71 KB
Loading

articles/deployment-environments/quickstart-create-access-environments.md

Lines changed: 25 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ ms.date: 10/26/2022
1414

1515
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.
1616

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-
1917
In this quickstart, you learn how to:
2018

2119
> [!div class="checklist"]
@@ -24,122 +22,49 @@ In this quickstart, you learn how to:
2422
> - Access an environment
2523
2624
> [!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/).
2826
2927
## Prerequisites
3028

3129
- [Create and configure a dev center](quickstart-create-and-configure-devcenter.md).
3230
- [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:
41-
42-
```powershell
43-
iex "& { $(irm https://aka.ms/DevCenter/Install-DevCenterCli.ps1 ) }"
44-
```
45-
46-
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-
```
5531

5632
## 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>
100-
--project-name <project-name> --environment-type <environment-type-name>
101-
--catalog-item-name <catalog-item-name> --catalog-name <catalog-name>
102-
```
103-
104-
If the specific *catalog-item* requires any parameters, use `--parameters` and provide the parameters as a JSON string or a JSON file. For example:
105-
106-
```json
107-
$params = "{ 'name': 'firstMsi', 'location': 'northeurope' }"
108-
az devcenter dev environment create --dev-center-name <devcenter-name>
109-
--project-name <project-name> -n <name> --environment-type <environment-type-name>
110-
--catalog-item-name <catalog-item-name> --catalog-name <catalog-name>
111-
--parameters $params
112-
```
33+
You can create an environment from the developer portal.
11334

11435
> [!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.
11837
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:
12044

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. |
12251

123-
```
124-
(EnvironmentNotFound) The environment resource was not found.
125-
Code: EnvironmentNotFound
126-
Message: The environment resource was not found.
127-
```
52+
:::image type="content" source="media/quickstart-create-access-environments/add-environment.png" alt-text="Screenshot showing add environment pane.":::
12853

129-
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.
13055

56+
1. Select **Create**. You'll see your environment in the developer portal immediately, with an indicator that shows creation in progress.
57+
13158
## Access an environment
59+
You can access and manage your environments in the Microsoft Developer portal.
13260

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).
13662

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.":::
14065

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.":::
14368

14469
## Next steps
14570

articles/deployment-environments/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ items:
4141
href: how-to-configure-project-admin.md
4242
- name: Provide access to developers
4343
href: how-to-configure-deployment-environments-user.md
44+
- name: Create environments with the CLI
45+
href: how-to-create-access-environments.md
4446
- name: Reference
4547
items:
4648
- name: REST API

0 commit comments

Comments
 (0)