Skip to main content
Solved

local file extractor configuration yaml environment variable setup


Forum|alt.badge.img

I am new bee for this mammal, to Setup the Cognite file extractor for the local file upload to CDF, how to I config the environment variable in the yaml?
according to the example-local.yaml I need to read:
COGNITE_BASE_URL
COGNITE_PROJECT
COGNITE_CLIENT_ID
COGNITE_TOKEN_URL
COGNITE_CLIENT_SECRET

I am little confuse, should I create a .env file to have all of those environment variables in that file and put it in the same folder as the yaml config file or can I inject those variables in the configuration file itself, if so any example?  need someone lighting me up.

Best answer by Thomas Sjølshagen

Yes, the file extractor supports reading an .env file stored in the local directory for the file extractor binary.

View original
Did this topic help you find an answer to your question?

4 replies

Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img

Hope this documentation here will help you. 


Forum|alt.badge.img

In short:

You have to specify the environment variables in the config.yaml file.

 

cognite:

   secret: ${CLIENT_SECRET}

 

Then you need some way to populate the environment variable with the correct value. 

Some (most) of the extractors support adding an .env file in the same directory as where you’re running the extractor binary from. Other approaches depend on how (and on what platform) you start/run the extractor. 

IIRC, we recently updated the extractors to prevent traversal searches for .env files, so the location of the .env file will matter :)


Forum|alt.badge.img
  • Author
  • Committed
  • 2 replies
  • March 31, 2025
Thomas Sjølshagen wrote:

In short:

You have to specify the environment variables in the config.yaml file.

 

cognite:

   secret: ${CLIENT_SECRET}

 

Then you need some way to populate the environment variable with the correct value. 

Some (most) of the extractors support adding an .env file in the same directory as where you’re running the extractor binary from. Other approaches depend on how (and on what platform) you start/run the extractor. 

IIRC, we recently updated the extractors to prevent traversal searches for .env files, so the location of the .env file will matter :)

Thank you for the clarification, so in general, does the Local file extractor support the .env? of course I put the .env file in the same directory as the yaml configuration file.


Forum|alt.badge.img

Yes, the file extractor supports reading an .env file stored in the local directory for the file extractor binary.


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings