turbot / steampipe-plugin-azure

Use SQL to instantly query Azure resources across regions and subscriptions. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/azure
Apache License 2.0
34 stars 15 forks source link

Add `resource_attached` column in table `azure_network_interface` #778

Closed marcbrlcln closed 2 weeks ago

marcbrlcln commented 3 weeks ago

Is your feature request related to a problem? Please describe. I can't see which resource is attached to a network interface.

Describe the solution you'd like Have a column with the name of the resource attached to the network interface.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

ParthaI commented 3 weeks ago

Hello, @marcbrlcln, As per my knowledge, there is no direct Azure CLI command/ API that lists all attached resources to a Network Interface (NIC) in one go. However, we can aggregate the columns(network_security_group_id, virtual_machine_id, dscp_configuration, private_link_service, private_endpoint, etc...) to distinguish the attached resources.

BTW, I noticed a few missing columns in the table that are present in the API response.

I have raised a draft PR to address the missing columns. Please take a look at the PR and let us know if this helps.

We would also love to hear your thoughts if you have any.

Thanks!

marcbrlcln commented 3 weeks ago

Hi, yes it's what I needed. Thank you !

ParthaI commented 3 weeks ago

Thanks @marcbrlcln, for your confirmation. Did you get a chance to try it in the PR branch?

marcbrlcln commented 3 weeks ago

I have tried my query on the PR branch and yes it's working fine. It's missing a column for the resource Azure NetApp File volume, because some Network interfaces are attached to a volume. But I don't see this resource in the API response.

marcbrlcln commented 3 weeks ago

I found this : https://github.com/Azure/azure-sdk-for-go/tree/v68.0.0/services/netapp/mgmt But I don't know if it's helpful.

ParthaI commented 2 weeks ago

Hi @marcbrlcln, I was having a look at the Network Interface Properties return by the API.

I did not find any properties related to Azure NetApp Files.

Additionally, there is no such API for network interfaces that returns details about attached Azure NetApp Files.

I'm not sure how helpful it would be to have a separate table for volumes, but it might be beneficial. Here are the properties for the volume we will get.

Alternatively, could we consider joining the azure_compute_* tables to retrieve the necessary details?

Thanks!

marcbrlcln commented 2 weeks ago

Hi, I've succeded to do what I wanted with column hosted_workloads. Thanks for the other columns.