CloudQuery only runs with ./cloudquery command not without it

Why is CloudQuery running only with ./cloudquery --help and why can’t we run cloudquery --help?

Hi Ravi :wave:,

Assuming you have cloudquery installed locally in a directory (e.g. Linux Install), then the difference lies in how the system finds the cloudquery program:

  1. ./cloudquery --help works because ./ directs the system to use the cloudquery in the current directory.
  2. cloudquery --help might not work if cloudquery isn’t in a directory listed in your PATH environment variable.

I hope this answers your question.

I have following this article to set-up CSPM, where it has written in step 3 says as, refer the screenshot:

How to Guides: Open Source CSPM

  1. My first question, how can CloudQuery execute the step 3 commands in order to post results to azure_policy_results? I am getting the below error that says the table exists even after deleting the table and re-doing the same step 3. It is just creating the table azure_policy_results but no data is being stored in that table.

  2. See the azure_policy_results table; no data exists.

Have you run a cloudquery sync with Azure at this stage? If so, can you post the configuration with any sensitive information redacted? The errors you posted look to be saying that the azure_policy_assignments table is missing - which is probably why the policies are not fully running.

Thanks, I was able to run the CSPM article related queries in Step 3. I should add all my Azure source tables to get the results. Please see attached my Sync Configuration.

However, while I am able to run CloudQuery with ./cloudquery sync, as per the CSPM article step 3, I should go to the cloudquery/azure/policies folder. For that, I am deleting the cloudquery directory and installing again for sync.

This is not good; I need some advice to run both the CSPM article and the sync operation.