Skip to content

Commit 80c5444

Browse files
author
RoseHJM
committed
MDB - customization image definition updates - it2
1 parent e028b63 commit 80c5444

7 files changed

+78
-7
lines changed

articles/dev-box/how-to-write-image-definition-file.md

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ To enable the use of project-level catalogs at the dev center level:
8383
For more information about adding catalogs to projects, see [Add and configure a catalog from GitHub or Azure Repos](../deployment-environments/how-to-configure-catalog.md).
8484

8585
## Create an image definition file
86-
You can create and test image definition files by using VS Code. In addition to using the built-in tasks, you can use the Microsoft Dev Box extension in VS Code to discover the custom tasks available through your dev center.
86+
You can create and test image definition files by using VS Code. In addition to using the built-in tasks, you can use the Microsoft Dev Box extension in VS Code to discover the custom tasks available through your dev center.
8787

88-
For detailed information about using cutom tasks, see the [schema reference](../reference-dev-box-customizations.md).
88+
For detailed information about using custom tasks, see the [Customizations schema reference](../reference-dev-box-customizations.md).
8989

9090
1. Create a dev box (or use an existing dev box) for testing.
9191
1. On the test dev box, install VS Code and then install the Dev Box extension.
@@ -100,12 +100,21 @@ For detailed information about using cutom tasks, see the [schema reference](../
100100

101101
1. The image definition file runs and applies the specified tasks to your test dev box. Inspect the changes and check the VS Code terminal for any errors or warnings generated during the task execution.
102102
1. When the image definition file runs successfully, upload it to your catalog.
103+
104+
### System Tasks and User Tasks
105+
106+
All tasks in the userTasks section run as the user after the user's first sign-in to the Dev Box. Tasks in the tasks section run as LocalSystem during the Dev Box provisioning stage. Both sections share the same parameters based on the task definitions in your catalog.
107+
108+
### When should I use Run-as-user Tasks?
109+
110+
Use run-as-user tasks to install software and packages under user context. For example, users often prefer to install Python and Visual Studio Code under user context instead of system-wide. Put WinGet tasks in the userTasks section for better results when they don't work under tasks.
103111

104-
## Optional: Customize your dev box by using existing WinGet Configuration files
105-
WinGet configuration uses a config-as-code approach to define the software and settings needed to prepare your Windows environment for coding.
112+
## Optional: Customize your dev box by using existing Desired State Configuration files
113+
Desired State Configuration (DSC) is a management platform in PowerShell that enables you to manage your development environment with configuration as code. You can use DSC to define the desired state of your dev box, including software installations, configurations, and settings.
106114

107-
You can also use these configuration files to set up a dev box, by using a WinGet task included in the Microsoft-provided quickstart catalog.
108-
The following example shows a dev box image definition file that calls an existing WinGet Desired State Configuration (DSC) file:
115+
You can also use DSC configuration files to set up a dev box, by using a built-in WinGet task.
116+
117+
The following example shows a dev box image definition file that calls an existing WinGet DSC file:
109118

110119
```yaml
111120
tasks:
@@ -116,9 +125,71 @@ tasks:
116125
117126
To learn more, see [WinGet configuration](https://aka.ms/winget-configuration).
118127
128+
## Configure catalog sync settings for the project
129+
130+
Configure your project to sync image definitions from the catalog. With this setting, you can use the image definitions in the catalog to create dev box pools.
131+
132+
1. Sign in to the [Azure portal](https://portal.azure.com).
133+
1. In the search box, enter **projects**. In the list of results, select **Projects**.
134+
1. Open the Dev Box project for which you want to configure catalog sync settings.
135+
1. Select **Catalogs**.
136+
1. Select **Sync settings**.
137+
138+
:::image type="content" source="./media/how-to-write-image-definition-file/customizations-project-sync-settings-small.png" alt-text="Screenshot of the Catalogs pane in the Azure portal, with the button for sync settings highlighted." lightbox="./media/how-to-write-image-definition-file/customizations-project-sync-settings.png":::
139+
140+
1. On the **Sync settings** pane, select **Image definitions**, and then select **Save**.
141+
142+
:::image type="content" source="./media/how-to-write-image-definition-file/customizations-project-sync-image-definitions.png" alt-text="Screenshot of the pane for sync settings in the Azure portal, with the checkbox for image definitions highlighted." lightbox="./media/how-to-write-image-definition-file/customizations-project-sync-image-definitions.png":::
143+
144+
## Attach a catalog that contains the definition file
145+
146+
Before you can use a customization file as an image definition, you must attach a catalog that contains the definition file to your dev center or project. The catalog can be from GitHub or Azure Repos.
147+
148+
The **Image definitions** pane lists the image definitions that your project can access.
149+
150+
:::image type="content" source="media/how-to-write-image-definition-file/team-customizations-image-definitions-small.png" alt-text="Screenshot of the Azure portal pane that lists accessible image definitions for a project." lightbox="media/how-to-write-image-definition-file/team-customizations-image-definitions.png":::
151+
152+
For more information about attaching catalogs, see [Add and configure a catalog from GitHub or Azure Repos](../deployment-environments/how-to-configure-catalog.md).
153+
154+
## Configure a dev box pool to use an image definition
155+
156+
Make customizations available to your development teams by configuring a dev box pool to use a customization file (imagedefinition.yaml). Store the customization file in a repository linked to a catalog in your dev center or project. Specify this file as the image definition for the pool, and the customizations are applied to new dev boxes.
157+
158+
The following steps show you how to create a dev box pool and specify an image definition:
159+
160+
1. Sign in to the [Azure portal](https://portal.azure.com).
161+
1. In the search box, enter **projects**. In the list of results, select **Projects**.
162+
1. Open the Dev Box project with which you want to associate the new dev box pool.
163+
1. Select **Dev box pools**, and then select **Create**.
164+
1. On the **Create a dev box pool** pane, enter the following values:
165+
166+
| Setting | Value |
167+
|---|---|
168+
| **Name** |Enter a name for the pool. The pool name is visible to developers to select when they're creating dev boxes. It must be unique within a project. |
169+
| **Definition** | This box lists image definitions from accessible catalogs and dev box definitions. Select an image definition file. |
170+
| **Network connection** | Select **Deploy to a Microsoft hosted network**, or use an existing network connection. |
171+
|**Enable single sign-on** | Select **Yes** to enable single sign-on for the dev boxes in this pool. Single sign-on must be configured for the organization. For more information, see [Enable single sign-on for dev boxes](https://aka.ms/dev-box/single-sign-on). |
172+
| **Dev box Creator Privileges** | Select **Local Administrator** or **Standard User**. |
173+
| **Enable Auto-stop** | **Yes** is the default. Select **No** to disable an autostop schedule. You can configure an autostop schedule after the pool is created. |
174+
| **Stop time** | Select a time to shut down all the dev boxes in the pool. |
175+
| **Time zone** | Select the time zone that the stop time is in. |
176+
| **Licensing** | Select this checkbox to confirm that your organization has Azure Hybrid Benefit licenses that you want to apply to the dev boxes in this pool. |
177+
178+
:::image type="content" source="./media/how-to-write-image-definition-file/pool-specify-image-definition.png" alt-text="Screenshot of the pane for creating a dev box pool." lightbox="./media/how-to-write-image-definition-file/pool-specify-image-definition.png":::
179+
180+
1. Select **Create**.
181+
1. Verify that the new dev box pool appears in the list. You might need to refresh the screen.
182+
183+
### Create a dev box by using the developer portal
184+
185+
To verify that customizations from the image definition file are applied, create a dev box in the Microsoft Dev Box developer portal. Follow the steps in [Quickstart: Create and connect to a dev box by using the Microsoft Dev Box developer portal](quickstart-create-dev-box.md). Then connect to the newly created dev box and verify that the customizations work as you expected.
186+
187+
You can make adjustments to the customization file and create a new dev box to test the changes. When you're happy that the customizations are correct, you can build a reusable image.
188+
189+
119190
## Next step
120191
121-
Now that you have created an image definition file, upload it to a catalog and attach the catalog to a project. The image definition file will be used to configure and create dev boxes for your development teams.
192+
Now that you have an image definition file, upload it to a catalog and attach the catalog to a project. The image definition file is used to configure and create dev boxes for your development teams.
122193
123194
> [!div class="nextstepaction"]
124195
> [Configure imaging for Dev Box team customizations](how-to-configure-customization-imaging.md)
18.6 KB
Loading
68.5 KB
Loading
49.5 KB
Loading
38 KB
Loading
97.5 KB
Loading
70.9 KB
Loading

0 commit comments

Comments
 (0)