def main():
<EOL>try:<EOL><INDENT>with open('<STR_LIT>') as config_file:<EOL><INDENT>config_data = json.load(config_file)<EOL><DEDENT><DEDENT>except FileNotFoundError:<EOL><INDENT>sys.exit('<STR_LIT>')<EOL><DEDENT>tenant_id = config_data['<STR_LIT>']<EOL>app_id = config_data['<STR_LIT>']<EOL>app_secret = config_data['<STR_LIT>']<EOL>subscription_id = config_data['<STR_LIT>']<EOL>access_token = azurerm.get_access_token(tenant_id, app_id, app_secret)<EOL>count = <NUM_LIT:0><EOL>vmimglist = azurerm.list_vm_images_sub(access_token, subscription_id)<EOL>print(json.dumps(vmimglist, sort_keys=False, indent=<NUM_LIT:2>, separators=('<STR_LIT:U+002C>', '<STR_LIT>')))<EOL>for vm_image in vmimglist['<STR_LIT:value>']:<EOL><INDENT>count += <NUM_LIT:1><EOL>name = vm_image['<STR_LIT:name>']<EOL>location = vm_image['<STR_LIT:location>']<EOL>offer = vm_image['<STR_LIT>']['<STR_LIT>']['<STR_LIT>']['<STR_LIT>']<EOL>sku = vm_image['<STR_LIT>']['<STR_LIT>']['<STR_LIT>']['<STR_LIT>']<EOL>print('<STR_LIT>'.join([str(count), '<STR_LIT>', name,<EOL>'<STR_LIT>', location,<EOL>'<STR_LIT>', offer, '<STR_LIT:U+0020>', sku]))<EOL><DEDENT>
Main routine.