# Importing Bitbucket Secured Variables to Doppler

**URL:** https://community.doppler.com/t/importing-bitbucket-secured-variables-to-doppler/1783
**Category:** Show & Tell
**Tags:** integration
**Created:** [March 26, 2025, 10:40am UTC](https://community.doppler.com/t/importing-bitbucket-secured-variables-to-doppler/1783 "2025-03-26T10:40:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Shyamsundar\_Rajkumar](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/shyamsundar_rajkumar/32/1245_2.png) [@Shyamsundar\_Rajkumar](https://community.doppler.com/u/Shyamsundar_Rajkumar)
#### Post date: [March 26, 2025, 10:40am UTC](https://community.doppler.com/t/importing-bitbucket-secured-variables-to-doppler/1783/1 "2025-03-26T10:40:25Z")

</div>

Hi everyone! 👋

While working on integrating Doppler with Bitbucket Pipelines, I came across a limitation with the default method of importing environment variables — specifically **secured variables**.

**🧩 The Problem**

The [official Doppler documentation](https://docs.doppler.com/docs/bitbucket-pipelines-doppler-cli#optional-cli-variables-import) provides a curl-based approach to import variables. However, this method doesn’t handle **secured variables** properly — they end up being imported as null because Bitbucket doesn’t allow viewing or exporting secured values once set.

This poses a challenge when trying to bring all your environment settings into Doppler for centralized management.

**💡 The Solution**

I realized that Bitbucket variables — including secured ones — are accessible during pipeline execution. So, I came up with a workaround using **custom Bitbucket pipelines** to securely transfer these values into Doppler via the CLI.

Here’s how to do it:

```auto
import-variables:
  - step:
      name: Import Bitbucket variables to Doppler
      image: alpine:3.12
      script:
        - apk add wget gnupg
        - wget -t 3 -qO- https://cli.doppler.com/install.sh | sh
        - doppler secrets set DOPPLER_VAR="$BITBUCKET_VAR" --project dopplerprojectname --config dopplerconfigname

```

🔐 Note: Replace DOPPLER\_VAR and BITBUCKET\_VAR with your actual variable names. You’ll need to repeat the doppler secrets set line for each variable you’d like to import. Also, you need to give Collaborator role to the doppler API token.

This method ensures that even secured Bitbucket variables can be seamlessly imported into Doppler, without ever exposing their values.

⸻

Hope this helps others facing the same challenge!
