get-azureresourcegroupgallerytemplate returning "missing api version in the query string"
Reported in the forums https://social.msdn.microsoft.com/Forums/azure/en-US/1a5a32c8-3975-4c3e-afae-8797dba2af36/getazureresourcegroupgallerytemplate-error-missing-api-version-query-string-allowed-values-are?forum=windowsazuremanagement
Using Microsoft Azure Powershell 9.8
Thank you for reaching out - We deprecated Get-AzureResourceGroupGalleryTemplate and removed the API that supported it too early. Please accept our apologies about this.
We are working on a replacement for these cmdlets. It will enable all the current capabilities add ability to save "non default" templates (like variations on SQL images), will not require to authenticate to save public items, among other improvements. Let us know if there is anything you'd like to see in the new Cmdlets that will replace Get/Save AzureResourceGroupGaleryTemplate.
In the meantime, here are some powershell snippets which will allow you to do the same thing (and in fact, more):
Retrieve all available items
$allGalleryItems = Invoke-WebRequest -Uri "https://gallery.azure.com/Microsoft.Gallery/GalleryItems?api-version=2015-04-01&includePreview=true" | ConvertFrom-Json
Get all items published by Microsoft
$allGalleryItems | Where-Object { $_.PublisherDisplayName -eq "Microsoft" }
Get all gallery items with "SQL" in the description
$allGalleryItems | Where-Object { $_.Description -match "SQL" }
Save default template for all items under directory "C:\Templates"
$allGalleryItems | Foreach-Object { $path = Join-Path -Path "C:\templates" -ChildPath $_.Identity New-Item -type Directory -Path $path
$.Artifacts | Where-Object { $.type -eq "template" } | ForEach-Object { $templatePath = Join-Path -Path $path -ChildPath ( $_.Name + ".json" )
(Invoke-WebRequest -Uri $_.Uri).Content | Out-File -FilePath $templatePath } }
Thanks,
-Gilles (MSFT)
Is there a replacement command for Get-AzureResourceGroupGalleryTemplate yet? If not, can we have the old API back for now please?
@GillesZunino you lost a couple of underscores in the code snips you provided.
Thanks for the code snips.
the removal of an API that is still used by the most current version of the azure powershell module is very concerning, Powershell is used to automate workflows, if Microsoft is going to remove APIs like this in the future we need some notification and usable replacement API/solution and time to implement the new solution before the old API/solution is just removed.
the information is great for finding out what is available ... How do I find out what my subscriptions are using from the marketplace? What is the best means to do this?
Bump for this. Currently, saving custom templates is broken in the portal and non-existent via powershell et .
The Gallery service is no longer supported. If you are having issues with templates, please file an issue for the particular problem you are experiencing.