-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Accessing Government Cloud (High) #115
Comments
Thanks for opening your first issue! Reports like these help improve the project! |
Unfortunately, it can not. It connects to the public cloud version only. I do not have a Government Cloud account, so I m unsure if the same calls can be made. If so, it might be an option to change the base url to try out? |
I would certainly try that out and report back! Would I change the base URL with a CLI switch/option?
…-------- Original Message --------
On Mar 11, 2024, 23:57, Michiel van Oudheusden wrote:
Unfortunately, it can not. It connects to the public cloud version only. I do not have a Government Cloud account, so I m unsure if the same calls can be made. If so, it might be an option to change the base url to try out?
—
Reply to this email directly, [view it on GitHub](#115 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AEUSURFDSNQIQBTNBVLIZ5DYX2KNNAVCNFSM6AAAAABENN2HUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJQGQZDCMJZHA).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
At the moment, there is no CLI switch for it. So if you can run the source, you can change the url here: https://github.com/mivano/azure-cost-cli/blob/main/src/Program.cs#L24 |
That's exciting! According to their documentation here: Compare Azure Government and global Azure |
I m assuming it is similar for the other clouds (like German), but I m unable to verify, so do let me know and I will see how we can add an override in. |
So I forked it and made the change, but as I am not a developer, I cannot seem to figure out how to compile it into a binary :/ I am running ubuntu 22.04.4 LTS and have Thanks in advance :) |
From the |
Is this meaningful output? I did run user@jammy-gcch:~/git/src$ dotnet run --framework net6.0
/home/user/.nuget/packages/microsoft.build.tasks.git/8.0.0/build/Microsoft.Build.Tasks.Git.targets(25,5): warning : Repository '/home/user/git' has no remote. [/home/user/git/src/azure-cost-cli.csproj::TargetFramework=net6.0]
/home/user/.nuget/packages/microsoft.sourcelink.common/8.0.0/build/Microsoft.SourceLink.Common.targets(53,5): warning : Source control information is not available - the generated source link is empty. [/home/user/git/src/azure-cost-cli.csproj::TargetFramework=net6.0]
Unhandled exception. System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at AzureCostCli.CostApi.AzureCostApiRetriever.ExecuteCallToCostApi(Boolean includeDebugOutput, Object payload, Uri uri) in /home/user/git/src/CostApi/AzureCostApiRetriever.cs:line 150
at AzureCostCli.CostApi.AzureCostApiRetriever.RetrieveCosts(Boolean includeDebugOutput, Scope scope, String[] filter, MetricType metric, TimeframeType timeFrame, DateOnly from, DateOnly to) in /home/user/git/src/CostApi/AzureCostApiRetriever.cs:line 200
at AzureCostCli.Commands.AccumulatedCost.AccumulatedCostCommand.<>c__DisplayClass4_0.<<ExecuteAsync>b__0>d.MoveNext() in /home/user/git/src/Commands/AccumulatedCost/AccumulatedCostCommand.cs:line 107
--- End of stack trace from previous location ---
at AzureCostCli.OutputFormatters.SpectreConsole.StatusExt.<>c__DisplayClass16_0.<<StartAsync>b__0>d.MoveNext() in /home/user/git/src/OutputFormatters/SpectreConsole/StatusExt.cs:line 99
--- End of stack trace from previous location ---
at AzureCostCli.OutputFormatters.SpectreConsole.StatusExt.<>c__DisplayClass17_0`1.<<StartAsync>b__0>d.MoveNext() in /home/user/git/src/OutputFormatters/SpectreConsole/StatusExt.cs:line 141
--- End of stack trace from previous location ---
at Spectre.Console.Progress.<>c__DisplayClass32_0`1.<<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](Func`1 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, Func`2 func) in /home/user/git/src/OutputFormatters/SpectreConsole/StatusExt.cs:line 138
at AzureCostCli.OutputFormatters.SpectreConsole.StatusExt.StartAsync(String status, Func`2 action) in /home/user/git/src/OutputFormatters/SpectreConsole/StatusExt.cs:line 97
at AzureCostCli.Commands.AccumulatedCost.AccumulatedCostCommand.ExecuteAsync(CommandContext context, AccumulatedCostSettings settings) in /home/user/git/src/Commands/AccumulatedCost/AccumulatedCostCommand.cs:line 88
at Spectre.Console.Cli.CommandExecutor.Execute(IConfiguration configuration, IEnumerable`1 args) in /_/src/Spectre.Console.Cli/Internal/CommandExecutor.cs:line 83
at Spectre.Console.Cli.CommandApp.RunAsync(IEnumerable`1 args) in /_/src/Spectre.Console.Cli/CommandApp.cs:line 84
at Program.<Main>$(String[] args) in /home/user/git/src/Program.cs:line 115 Is there something else you wold like me to try? |
What did you change the url to? So the one that is used by the RetrieveCosts call? A 404 indicates that it cannot find it. |
I suppose we are at a dead end then. Thank you for the assistance |
According to this page (https://learn.microsoft.com/en-gb/azure/azure-government/compare-azure-government-global-azure#guidance-for-developers) it should be that URL. What you can do: when in the Azure portal (the government one), go the the Cost management page and inspect the network traffic and see where the calls to the Query endpoint go to. |
Hello again! Good news I believe! I had to supply the subscription id, since ours differs from our tenant id, but by running this command: I think I just need to figure out the querying, and I may be actually able to pull some useful data!! Thank you for your assistance! I'm not sure if I should close this issue or not. I'm also not very sure how to share the changes made with you, but you can see them over at my fork, since that's what I'm using: https://github.com/Bakan0/azure-cost-cli/tree/main |
Ah that is good to hear. I see in the diff what you changed, so I have to see how I can make this configurable. Give me some time please as I m traveling at the moment. |
Version 0.38.0 should contain the ability to change the base urls via the config param. See the readme for the options. |
Awesome tool! I'm hoping that it can connect to the government cloud. Is there a command or switch/option that exists to set that?
After loggin in, I receive the following error message:
Error: Response status code does not indicate success: 404 (Not Found).
The text was updated successfully, but these errors were encountered: