Filter Flag
You can display specific Azure resources by Filter flag with the describe command.
Filter criteria is based on JMESPath whichis a query language for JSON. You can extract and transform elements from a JSON document.
Make sure to export the encryption key and path to the fernet file as an environment variable as described in the authentication section before trying the commands below
We will use describe directive and the specific Azure Resource and the Filter flag to display specific resources.
idem describe azure.[ supported Azure State].[Azure Resource] --filter= "<JMESPath Query Language>"
Example, if we want to filter and specific existing Azure VM named “cmac-test-idem” under the account profile “tmm”
idem describe azure.compute.virtual_machines --filter="[?resource[?vm_name=='cmac-test-idem']]" --acct-profile tmm
or inspect the existing Azure Virtual Network named “vNet1-MoffCAS01” under the default account profile.
idem describe azure.virtual_networks.virtual_networks --filter="[?resource[?virtual_network_name=='vNet1-MoffCAS01']]"