def main():
<EOL>if '<STR_LIT>' in os.environ and '<STR_LIT>' in os.environ:<EOL><INDENT>access_token = azurerm.get_access_token_from_cli()<EOL>subscription_id = azurerm.get_subscription_from_cli()<EOL><DEDENT>else: <EOL><INDENT>try:<EOL><INDENT>with open('<STR_LIT>') as configfile:<EOL><INDENT>configdata = json.load(configfile)<EOL><DEDENT><DEDENT>except FileNotFoundError:<EOL><INDENT>sys.exit('<STR_LIT>')<EOL><DEDENT>tenant_id = configdata['<STR_LIT>']<EOL>app_id = configdata['<STR_LIT>']<EOL>app_secret = configdata['<STR_LIT>']<EOL>subscription_id = configdata['<STR_LIT>']<EOL>access_token = azurerm.get_access_token(tenant_id, app_id, app_secret)<EOL><DEDENT>resource_groups = azurerm.list_resource_groups(access_token, subscription_id)<EOL>for rgname in resource_groups['<STR_LIT:value>']:<EOL><INDENT>print(rgname['<STR_LIT:name>'] + '<STR_LIT:U+002CU+0020>' + rgname['<STR_LIT:location>'])<EOL>'''<STR_LIT>'''<EOL><DEDENT>
Main routine.