You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, a lab user created a VM with 24 hr expiry and now wishes to keep it longer due to testing which has not concluded.
Whatever we try we just get the following error back on the Set-AzureRmResource command:
Set-AzureRmResource : MissingRequiredProperties : One of the following properties must be specified: customImageId, galleryImageReference.
Note our lab VM is created from an ARM template and from a lab attached shared image gallery (so a custom image in our private shared image gallery, not a public/marketplace image). As it's a private shared image gallery, it's not a true lab custom image either as such. So, in our ARM template we do not provide gallery reference or custom image ID, but more SharedImageID and SharedImageVersion.
We have tried to provide null values, or what we think may be suitable values for the "missing" properties but then we get error Set-AzureRmResource : CannotSetProperty : Cannot set or update property galleryImageReference. or Set-AzureRmResource : CannotSetProperty : Cannot set or update property customImageId.
Using AzureRm 6.13.1 but also tried Az in pwsh core and same issue.
Note that we get this error if we just get the VM object (using Get-AzureRmResource) change no properties and then set it back using Set-AzureRmResource.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi - Good question, this is probably because of the API Version. There are some properties that have been added in a later API version. To resolve this, you can either:
First get the object, modify properties and write it back, or
Specify the API version
I have a handy script for updating the expiration date (prompts you for resources) that might be helpful, take a look at the attached!
Thanks and sorry for the delay in my response. 1. I have tried to get the object, modify and set back and I get the error I described. It will not allow it as the object get does not seem complete (possibly for the API version I am using). I also tried to get, make no modifications and set back with the same error.
I will have a look at your script - many thanks for providing it!
Hi,
Searching the internet we found some articles regarding how to use Azure PowerShell to extend a date on a lab VM for expiry.
Examples:
etc.
So, a lab user created a VM with 24 hr expiry and now wishes to keep it longer due to testing which has not concluded.
Whatever we try we just get the following error back on the
Set-AzureRmResource
command:Set-AzureRmResource : MissingRequiredProperties : One of the following properties must be specified: customImageId, galleryImageReference.
Note our lab VM is created from an ARM template and from a lab attached shared image gallery (so a custom image in our private shared image gallery, not a public/marketplace image). As it's a private shared image gallery, it's not a true lab custom image either as such. So, in our ARM template we do not provide gallery reference or custom image ID, but more SharedImageID and SharedImageVersion.
We have tried to provide null values, or what we think may be suitable values for the "missing" properties but then we get error
Set-AzureRmResource : CannotSetProperty : Cannot set or update property galleryImageReference.
orSet-AzureRmResource : CannotSetProperty : Cannot set or update property customImageId.
Using AzureRm 6.13.1 but also tried Az in pwsh core and same issue.
Note that we get this error if we just get the VM object (using
Get-AzureRmResource
) change no properties and then set it back usingSet-AzureRmResource
.Thanks!
The text was updated successfully, but these errors were encountered: