Step 2 - Optimize your team's customizations through Dev Center Imaging
In this articleTarget audience: Dev Center Administrator/Project Administrator
In this quickstart, we’ll walk you through the steps you need to optimize a team customization as an image, to get optimal performance
- Prerequisite: make sure you have set up a team customization
- Download Dev Center Imaging powershell scripts
- Trigger creation of an image
- Create a new Dev Box in the same pool
Prerequisite: make sure you have set up a team customization
Dev Center imaging provides a way to optimize your team customizations by flattening them into an image. To generate an image, make sure you have created a team customization first.
Give the Windows 365 Application permissions
We generate a Dev Box behind the scenes to create an image for you, and we export that to an Azure Compute Gallery in a special managed-by resource group we create for you. In order for us to create an image in that resource group we would need you to give us permissions for that action. We are streamlining this process so while you need to do this step today, it will not be needed in the near future (ETA: end of Aug ‘24)
Go to Resource Groups and search for a resource group that is of the name DevCenter(yourProjectName)(a random number)
. Under the resource group, navigate to Access Control, and give the “Windows 365” application and “Project Fidalgo” the roles “Storage Account Contributor”, “Storage Blob Data Contributor” and “Reader”.
Download convenience scripts
You will need Powershell 7, and the Azure Powershell module to run these scripts.
Install-Module -Name Az -Repository PSGallery -Force
(from this doc.)
Before running these scripts, you will want to make sure you signed into Azure on Powershell, and you have set the subscription to match the one containing your Project.
The azure portal UI for this feature is under development. In the mean time, we have a few convenience powershell 7 scripts that help you generate an image, get status of an image build, and get logs for each customization you have in your team customization that we try and image for you. Download them here:
BuildImage GetImageStatus GetImageLogs
Trigger creation of an image
To optimize your team customization by flattening it into an image, you can trigger a new image build using:
.\BuildImage.ps1 -ResourceGroupName <rgname> -ProjectName <projectname> -CatalogName <imagedefinition catalog name> -ImageDefinitionName <image definitionname>
We plan to introduce automated (schedule-based) triggers soon - stay tuned! For now, you can use this command to trigger creation of a new image. Note: this image build process can take upto 90 minutes today, depending on how complex your team customizations are.
Get status of an image build
To check the status of your current image build (there can only be one build per image definition at this time), use:
.\GetImageStatus.ps1 <rgname> -ProjectName <projectname> -CatalogName <imagedefinition catalog name> -ImageDefinitionName <image definitionname>
In the response, you can see the status of your image build
{
"imageReference": {
"id": ""
},
"status": "Failed",
"startTime": "",
"endTime": "",
"errorDetails": {},
...
You can also see the different steps we take to customize a dev box and generate an image from it.
...
"taskGroups": [
{
"name": "Customization",
"status": "Failed",
"logUrl": "https://..."
}
],
...
Get logs for debugging
For each step, you will see an associated log URL. Should one of the steps fail, you can fetch logs using:
./Get-ImageLogs.ps1 -LogUri https://72f988bf-86f1-41af-91ab-2d7cd011db47-angel-euap-dc.centraluseuap.devcenter.azure.com/projects/angel-euap-proj/catalogs/dhruv/imagedefinitions/dhruv-def/builds/b5bec08e-7c96-49ce-9006-2f3063427d79/customizationGroups/16f6ac60-d9c7-43cb-9d11-cb705cbca5b7/logs/d3d01e03-d0b6-4fed-af42-be3ecea515f0?api-version=2024-08-01-privatepreview
Using this image as your team customization
There are no additional steps needed for you to use this now-optimized team customizations. The pool that was configured to use this image definition will now use an image instead of running your customizations during dev box creation. Depending on the complexity of the team customizations you apply, you should see a substantial improvement in dev box creation time.
To verify that your Dev Box indeed used an image instead of running your customizations on the fly, you can check if your new dev box has a customizations section in the context menu - it should not, because no customizations were run on the fly but were baked into an image ahead of time.