MLogdberg / APIManagementARMTemplateCreator

Azure API Management Template Extractor, extracts ARM templates for your API's to be used in the CI/CD process.
MIT License
45 stars 43 forks source link

API Filters not working #103

Closed madilgul closed 1 year ago

madilgul commented 3 years ago

Not sure, if this is an issue with the code. I was able to previously successfully generate API templates following the steps described. But this time around I have been trying to make this work for hours now but it keeps giving me below error.

_Get-APIManagementTemplate : Aggregation Exception thrown, One or more errors occurred., first Exception message is: Object reference not set to an instance of an object., for more information read the output file. At line:1 char:1

below is the powershell command.

Get-APIManagementTemplate -APIManagement api-dev -APIFilters \"productname eq 'xxxx-api'\" -ResourceGroup api-dev-rg01 -SubscriptionId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -ExportPIManagementInstance $false | Out-File C:\temp\APItemplate.json

MLogdberg commented 3 years ago

Hi, This could be something else than it looks like, could you potentially just make sure the filter would return 0 result? aka set 'procutname eq 'false'' and see if it still breaks?

mikaelsand commented 3 years ago

I had a similar issue. Turned out to be me forgetting to change the subscription ID.

madilgul commented 3 years ago

Thanks for the reply. Still not sure what was the root cause of error, but a simple old fashioned restart of computer resolved the issue for me :)