Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
Resource are grouped under Subscription and Resource groups - these are the logical groupings in Azure used to get or list resources.
I am not aware of any REST API to list NICs based on their subnet.
Instead, you can use Azure Resource Graph
Resources
| where type =~ 'microsoft.network/networkinterfaces'
| project id, ipConfigurations = properties.ipConfigurations
| mvexpand ipConfigurations
| project id, subnetId = tostring(ipConfigurations.properties.subnet.id)
| parse kind=regex subnetId with '/resourceGroups/' resourceGroup '/providers/Microsoft.Network' provider '/virtualNetworks/' virtualNetwork '/subnets/' subnet
| where virtualNetwork == "<NAMEOFVNETOFTHESUBNET>" and subnet == "<NAMEOFSUBNET>" and resourceGroup == "<NAMEOFRGOFTHESUBNET>"
| project id, virtualNetwork, subnet, resourceGroup
And directly download the results as a CSV File.
Kindly let us know if this helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.