get-azureresourcegroupgallerytemplate returning "missing api version in the query string" #1064

Open
simonsabin opened this Issue Oct 5, 2015 · 4 comments

Projects

None yet

6 participants

@GillesZunino

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)

@jfatticq

Is there a replacement command for Get-AzureResourceGroupGalleryTemplate yet? If not, can we have the old API back for now please?

@robplank
Contributor

@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.

@markcowl markcowl added the Gallery label Oct 21, 2015
@crshnbrn66

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment