title: How to permanently set a local Prefect config file?
body: <p>As per the <code>Prefect</code> <a href="https://docs.prefect.io/core/concepts/configuration.html#environment-variables" rel="nofollow noreferrer">Configuration guide</a> I've set a local config file (i.e. in my current working directory) via <code>export PREFECT__USER_CONFIG_PATH=&quot;./config.toml&quot;</code>, however, this requires the environmental variable to be set each shell session.</p>
  <p>I tried setting the config in a Python script with <code>prefect.config.user_config_path = &quot;./config.toml&quot;</code> but this doesn't seem to load the config file in the same way as <code>export</code> because:</p>
  <blockquote>
  <p>(from docs) &quot;The configuration file is parsed when Prefect is first imported and is available as a live object in prefect.config.&quot;</p>
  </blockquote>
  <p>For my dummy <code>config.toml</code> data:</p>
  <pre><code>[api]
  host = &quot;localhost&quot;
  port = &quot;5432&quot;
  url = &quot;https://${api.host}:${api.port}&quot;
  </code></pre>
  <p><code>prefect.config</code> via environmental variable:</p>
  <pre><code>...'task_runner': {'default_class': 'prefect.engine.task_runner.TaskRunner'}}, 'api': {'host': 'localhost', 'port': 5432, 'url': 'https://localhost:5432'}, 'user_config_path': './config.toml'}&gt;
  </code></pre>
  <p><code>prefect.config</code> via script:</p>
  <pre><code>...'task_runner': {'default_class': 'prefect.engine.task_runner.TaskRunner'}}, 'user_config_path': './config.toml'}&gt;
  </code></pre>
  <p>So <code>config.toml</code> variables aren't loaded in second case</p>
  <p>Any ideas?</p>
  <p>(Application: I want to set a 'Prefect' secret in my local <code>config.toml</code> file hidden from source control)</p>