Azure Virtual Machine — Visual Studio Platform Image Not Found

Raf Daru
Raf Daru
Sep 2, 2019 · 5 min read

If you are trying to spin up a Visual Studio Virtual Machine on Azure but struggling with the Platform Image Not Found error, here is a solution that might help you. I was not able to find the solution in any documentation or MSDN forums (or may be I just like debugging and troubleshooting more than searching :D). Most forum responses were along the lines of restart or redeploy but they didn’t seem to help. Since this image is provided by Microsoft and available through Azure Marketplace, most of us would assume it should work out of the box just by clicking on Create a Resource and selecting this item. I assume you know the basics like creating an Azure account, creating resources and deploying virtual machines. There are lots of great quick-starts for those on Microsoft docs.

Here is the error I encountered verbatim on Azure Visual Studio Virtual Machine Image deployment.

{“code”:”DeploymentFailed”,”message”:”At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.”,”details”:[{“code”:”NotFound”,”message”:”error”: “code”: “PlatformImageNotFound”,”message”: “The platform image ‘microsoftvisualstudio:visualstudio2019latest:vs-2019-comm-latest-win10-n:latest’ is not available. Verify that all fields in the storage profile are correct.”, “target”: “imageReference”}]}

If you read the error message carefully, you will observe that even though Visual Studio Virtual Machine Images are available out of the box, there seems to be an issue with the way the default resource deployment for Visual Studio VMs is set up and this results in deployment failing over the name of the image — ‘microsoftvisualstudio:visualstudio2019latest:vs-2019-comm-latest-win10-n:latest’ — in this case. So in order to identify the root cause and fix this error we will follow the below process:

  1. Identify the configuration settings where image name value is defined or interpreted from during the virtual machine resource creation process
  2. Compare the values specified in the default deployment with the values that the virtual machine image publisher specified in the virtual machine registry
  3. Update the location / config setting from (1) with values from (2)
  4. Re-deploy with the update configuration

The image name is made up of parameters that are defined in the resource’s deployment template. So first we need to locate where these values are defined. On the “Review + Create” tab of “Create a Virtual Machine” resource option, click the “Download a template for automation” . Click the virtual machine resource as shown in the screenshot below and scroll down to the storageProfile / imageReference section to locate the values that the template is passing to the deployment job. This completes step (1) of the 4 step process defined above.

Configuration settings for the virtual machine
Image Reference Details under Storage Profile section

Now we know where these values are coming from and since the deployment is failing with image reference not found error, we know something is off here. We need to find the right values and the easiest way to do this is to open up the Cloud Shell and run a couple of commands.

Cloud Shell Launcher

It may request you to select between PowerShell and also create new storage. Once the command line is open, type the below command. You can replace the sku in the example below with sku from the imageReference screenshot above. Essentially we are trying to locate details for the image specified in image reference of the resource deployment.

Retrieve the virtual machine details (Replace the value after sku to the value from your VM)

The command will return a list of VMs that match the sku.

List of VMs matching the sku

Comparing the response from the command with the values in the default resource template we observe two things that don’t match:

  1. URN does not exist in the virtual machine image reference template. Ignore this as the URN seems like a concatenation of all the other values.
  2. At least in this case, the version did not match — in such cases I just the use the most recent value to get all the latest features. In your case, you may find a mismatch with some of the other parameters like offer, publisher, etc.

OK at this stage we have identified that one or more values returned from the az vm list command does not match the values specified in the default virtual machine resource’s image reference configuration. This completes step (2) of the 4 step process defined above.

Go back to the failed virtual machine resource and click Redeploy. You can create a new one too, if needed. But we need to update the template prior to deploying it. If you chose Redeploy, click “Edit Template”. Locate the Image Reference details as described above and update the image reference values from the values returned by the az vm image command that was run in the command line tool. Click Save to go back to the usual deployment screen. This completes step (3) of the 4 step process defined above.

Updated version from “latest” to “2019.8.19”

As the deployment proceeds, you will observe that you no longer get the Image Not Found error.

While the issue here was deploying a Visual Studio Virtual Machine image to Azure, this procedure will assist you with any similar image not found errors that you encounter with any virtual machine deployment.

Thanks for reading and hope you found this article not only useful for fixing your issue but also educational for understanding the inner workings of Azure resources, specifically virtual machines.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade