New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
simonsabin opened this Issue Oct 5, 2015 · 6 comments

Comments

Projects
None yet
8 participants
@GillesZunino

This comment has been minimized.

Show comment
Hide comment
@GillesZunino

GillesZunino Oct 6, 2015

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)

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

This comment has been minimized.

Show comment
Hide comment
@jfatticq

jfatticq Oct 14, 2015

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

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

@robplank

This comment has been minimized.

Show comment
Hide comment
@robplank

robplank Oct 14, 2015

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.

Contributor

robplank commented Oct 14, 2015

@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

This comment has been minimized.

Show comment
Hide comment
@crshnbrn66

crshnbrn66 Mar 14, 2016

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?

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?

@weznagwama

This comment has been minimized.

Show comment
Hide comment
@weznagwama

weznagwama Mar 6, 2017

Bump for this. Currently, saving custom templates is broken in the portal and non-existent via powershell et .

Bump for this. Currently, saving custom templates is broken in the portal and non-existent via powershell et .

@maddieclayton maddieclayton removed the Gallery label Mar 19, 2018

@markcowl

This comment has been minimized.

Show comment
Hide comment
@markcowl

markcowl Mar 21, 2018

Member

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.

Member

markcowl commented Mar 21, 2018

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.

@markcowl markcowl closed this Mar 21, 2018

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