mivano / azure-cost-cli

CLI tool to perform cost analysis on your Azure subscription
Apache License 2.0
866 stars 110 forks source link

azure-cost what-if region -s xxx-xxx-xxx throwing error #178

Open satyaki1008 opened 2 months ago

satyaki1008 commented 2 months ago

Hi,

This particular feature is a personal favorite and I want to use it very much. Currently I am experiencing the error below:(is it something to do with my subscription which is by the way a free trial)

PS C:\Users\SATYGUHA> azure-cost what-if region -s xxx-xxx-xxx System.ArgumentNullException: Value cannot be null. (Parameter 'uriString') at System.ArgumentNullException.Throw(String paramName) at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName) at System.Uri..ctor(String uriString) at AzureCostCli.CostApi.AzurePriceRetriever.GetAzurePricesAsync(String currencyCode, String filter) in /home/runner/work/azure-cost-cli/azure-cost-cli/src/CostApi/AzurePriceRetriever.cs:line 20 at AzureCostCli.Commands.WhatIf.RegionWhatIfCommand.FetchPricesForAllRegions(String skuName, String meterId, String currency) in /home/runner/work/azure-cost-cli/azure-cost-cli/src/Commands/WhatIf/RegionWhatIfCommand.cs:line 165 at AzureCostCli.Commands.WhatIf.RegionWhatIfCommand.<>c__DisplayClass4_0.<<ExecuteAsync>b__0>d.MoveNext() in /home/runner/work/azure-cost-cli/azure-cost-cli/src/Commands/WhatIf/RegionWhatIfCommand.cs:line 136 --- End of stack trace from previous location --- at AzureCostCli.OutputFormatters.SpectreConsole.StatusExt.<>c__DisplayClass16_0.<<StartAsync>b__0>d.MoveNext() in /home/runner/work/azure-cost-cli/azure-cost-cli/src/OutputFormatters/SpectreConsole/StatusExt.cs:line 99 --- End of stack trace from previous location --- at AzureCostCli.OutputFormatters.SpectreConsole.StatusExt.<>c__DisplayClass17_01.<b0>d.MoveNext() in /home/runner/work/azure-cost-cli/azure-cost-cli/src/OutputFormatters/SpectreConsole/StatusExt.cs:line 141 --- End of stack trace from previous location --- at Spectre.Console.Progress.<>cDisplayClass32_01.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Progress/Progress.cs:line 138 --- End of stack trace from previous location --- at Spectre.Console.Internal.DefaultExclusivityMode.RunAsync[T](Func1 func) in //src/Spectre.Console/Internal/DefaultExclusivityMode.cs:line 40 at Spectre.Console.Progress.StartAsync[T](Func`2 action) in //src/Spectre.Console/Live/Progress/Progress.cs:line 121 at AzureCostCli.OutputFormatters.SpectreConsole.StatusExt.StartAsync[T](String status, Func2 func) in /home/runner/work/azure-cost-cli/azure-cost-cli/src/OutputFormatters/SpectreConsole/StatusExt.cs:line 138 at AzureCostCli.OutputFormatters.SpectreConsole.StatusExt.StartAsync(String status, Func2 action) in /home/runner/work/azure-cost-cli/azure-cost-cli/src/OutputFormatters/SpectreConsole/StatusExt.cs:line 97 at AzureCostCli.Commands.WhatIf.RegionWhatIfCommand.ExecuteAsync(CommandContext context, WhatIfSettings settings) in /home/runner/work/azure-cost-cli/azure-cost-cli/src/Commands/WhatIf/RegionWhatIfCommand.cs:line 68 at Spectre.Console.Cli.CommandExecutor.Execute(CommandTree leaf, CommandTree tree, CommandContext context, ITypeResolver resolver, IConfiguration configuration) in /_/src/Spectre.Console.Cli/Internal/CommandExecutor.cs:line 166 PS C:\Users\SATYGUHA>`

finkinfridom commented 1 month ago

The issue is here: https://github.com/mivano/azure-cost-cli/blob/4f0e0908537233681ddc1f969166a71778fc6a77/src/CostApi/AzurePriceRetriever.cs#L20 but even trying with the --priceApiAddress "https://prices.azure.com/" flag, the error is not fixed. Any updates?