Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

Get-AzAutoscaleSetting doesnt produce a detailed output even when -DetailedOutput flag is specified #11786

Open suhasaraos opened 4 years ago

suhasaraos commented 4 years ago

The REST API seems to be returning the required resultset, but the following command Get-AzAutoscaleSetting -ResourceGroup "Default-Web-EastUS" -DetailedOutput

doesnt produce detailed output including metric details.

Checked on Az module v3.8

Refer: https://docs.microsoft.com/en-us/powershell/module/az.monitor/get-azautoscalesetting?view=azps-3.8.0#code-try-1

PS: While result output displays this flag being deprecated, docs doesnt talk about the same.

dingmeng-xue commented 4 years ago

@VeryEarly , please look into this issue.

VeryEarly commented 4 years ago

Hi @suhasaraos ,

It's possible the API version used in powershell cmdlet is outdated, can you please share the REST API uri/version you are using?

suhasaraos commented 4 years ago

This issue still exists with AZ module 5.0 - looks like a cmdlet issue. A Fiddler capture reveals that the REST response has the required information.

GET /subscriptions/8c98d9ee-59e7-4a29-a204-2e7c8471fda1/resourcegroups/appservice_demo_rg/providers/microsoft.insights/autoscalesettings?api-version=2015-04-01 HTTP/1.1

image

image

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzMonEssential.

Issue Details
The REST API seems to be returning the required resultset, but the following command Get-AzAutoscaleSetting -ResourceGroup "Default-Web-EastUS" -DetailedOutput doesnt produce detailed output including metric details. Checked on Az module v3.8 Refer: https://docs.microsoft.com/en-us/powershell/module/az.monitor/get-azautoscalesetting?view=azps-3.8.0#code-try-1 PS: While result output displays this flag being deprecated, docs doesnt talk about the same.
Author: suhasaraos
Assignees: VeryEarly
Labels: `Azure PS Team`, `Investigate :mag:`, `Monitor - Autoscale`, `Service Attention`
Milestone: -
VeryEarly commented 3 years ago

Hi @AzMonEssential,

This parameter -DetailedOutput was indicated deprecated. And I cannot find any clue of what it was supposed to be (not in changelog or github history)

Can you help me understand what was expected from this parameter? Or what is the reason why it need to be deprecated?

asheniam commented 3 years ago

@VeryEarly I don't recall the entire history of this parameter but I believe it's intended to print out the entire autoscale setting, including all the autoscale profiles and metric triggers.

VeryEarly commented 3 years ago

Hi @suhasaraos ,

please try $setting=Get-AzAutoscaleSetting -ResourceGroup "Default-Web-EastUS" $setting.Profiles.Rules should be able to see metric details