splunk / splunk-add-on-microsoft-azure

Splunk Add-on for Microsoft Azure
Apache License 2.0
11 stars 9 forks source link

Management URI hard-coded in various places #72

Closed beaunewcomb79 closed 1 month ago

beaunewcomb79 commented 7 months ago

Troubleshooting an issue pulling a full set of VMs from a subscription that lives in GovCloud, and noticed a bunch of 404's in the debug logs... manually updating lines 23 and 42 of utils.py to change uri to {management_base_url} made the 404's go away, but still not getting the entire list of VMs (despite getting them in full via the AZ CLI)

JasonConger commented 7 months ago

Are you selecting "Azure Government" as the environment when creating the input? This will control which base URL to use => https://github.com/splunk/splunk-add-on-microsoft-azure/blob/8330f66d155af431fb4e704239d8f12517b68785/package/bin/ta_azure_utils/utils.py#L254

image
beaunewcomb79 commented 7 months ago

Yeah, I did.. after I updated the hardcoded management url's the 404's stopped showing in the debug logs, but the pull stops at 100 VMs exactly. This tells me there's an equivalent to --first 100 (default) with the AZ CLI... I just can't figure out how to work the equivalent into the python... looks like its setup to handle nextLink, but it doesn't appear it is

JasonConger commented 7 months ago

What URL did you have to hardcode? The add-on should have selected the right endpoint depending on which environment you chose.

beaunewcomb79 commented 7 months ago

I "UN-HARDCODED" a few places where the public management URI was in utils.py and azure_comp.py

Line 212 in azure_comp.py is an example

After variablizing the URI, 404s went away for instanceView, but nextLink doesn't seem to be handled correctly because it just stops at 100 VMs, and there's no debug error logged as to why.

JasonConger commented 1 month ago

Addressed in version 4.1.0