Forum Discussion
Can I use "not" filters in Azure Pricing API
I don't think you can combine not and endswith.
Try ne instead.
Something like this ?filter=SkuName ne 'Spot' or ?filter=Location ne 'UK-South'
https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter
- ChrisBradshawJan 24, 2021Iron Contributor
Jan Bakker Unfortunately, the VM Instance size isn't called "Spot", it's called something like "D2s Spot"- so the ne test doesn't pick that up as it's doing an exact match.
- vincentssJan 20, 2022Copper Contributor
I am taking the storage data from the pricing api , but i need to exclude the "Azure Netapp files" from my query , please help.
Thanks in advance.
Regards Vincent S
- ChrisBradshawJan 21, 2022Iron Contributor
vincentss A different problem here, but can that just be accomplished by adding
$filter=productName ne 'Azure NetApp Files'
to your query? For example
https://prices.azure.com/api/retail/prices?$filter=productName%20ne%20%27Azure%20NetApp%20Files%27