2
votes

I am trying to figure out how to update the associated tags with an Azure DevOps Environment Resource (virtual machine) through the Azure DevOps API.

I have figured out how to get the resources for a specific Environment - https://dev.azure.com/{organization}/{project}/_apis/distributedtask/environments/{environmentId}?api-version=6.0-preview.1

However, if I try to update and then post back the Environment JSON with the updated resource tags, it does not actually update the resources. I think it is only for updating the Environment Name and Description?

I have trying to figure out how to use the following API endpoint (I think this is the one I should be using?) - https://dev.azure.com/{organization}/{project}/_apis/distributedtask/environments/{environmentId}/providers/virtualmachinegroups/{resourceId}/virtualmachines?api-version=6.0-preview.1.

The API endpoint wants a "resourceId" but I am not able to get anything back besides a 404 error when I put in the Environment Resource Id's for my Environment. I am not sure if I am doing something wrong, or this is the wrong end point.

Does anyone have an experience with using the API to update resource tags?

1
I don't have a definitive answer for you on this but I can confirm that this API is completely broken; I've had a support case open with Microsoft for over 2 months. They have confirmed the API is broken and suggested an alternate API, but haven't yet provided me with the necessary documentation to consume it. I will provide an answer to this question if I ever get it working.Daniel Mann
Thanks @DanielMann. A little disappointing that this API is broken and it is taking them so long to resolve the issue.smithran1212

1 Answers

1
votes

I can reproduce above issue. Currently, You have to manually edit the Environment Virtual machine Resource Tags.

Azure devops Environment Resource Rest API is not fully developed yet. Some features may be broken and unavailable currently.

You can report this issue to Microsoft Development Team. Hope they will fix it in the future sprint.