#89 ๐ Connect Bitbucket to Dataform ๐๐ง
Are you ready to streamline your data workflows by connecting Bitbucket with Dataform? Letโs dive into this guide and make your data integration journey smoother than ever. ๐
Dataform empowers you to orchestrate and manage your SQL-based workflows, and by linking it with Bitbucket, you can version-control your data projects like a pro! ๐พ But hereโs the catch: Dataform only supports SSH for connecting with Bitbucket repositories. No worriesโweโll cover everything you need to set this up step by step. ๐
๐ ๏ธ Prerequisites
Before we dive into the setup, make sure you have the following ready:
- A Bitbucket repository to store your Dataform project.
- A Dataform account with an active workspace.
- An SSH key pair (public and private keys).
- A basic understanding of Git.
๐ Step 1: Generate SSH Keys
To connect Dataform to Bitbucket via SSH, you need an SSH key pair.
๐ Generating an SSH Key Pair
- Open a terminal (Linux/Mac) or Git Bash (Windows).
-
Run the following command to generate your SSH key pair:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
- Save the key in the default location (press Enter when prompted).
- Provide a passphrase for additional security (optional).
- Your SSH key pair will be generated at:
- Public key:
~/.ssh/id_rsa.pub
- Private key:
~/.ssh/id_rsa
- Public key:
๐ Step 2: Add Your SSH Key to Bitbucket
Now that you have your SSH keys, letโs add the public key to Bitbucket.
- Log in to your Bitbucket account.
- Navigate to Personal Settings > SSH Keys.
- Click Add Key.
-
Paste the content of your public key (
id_rsa.pub
) into the text field.cat ~/.ssh/id_rsa.pub
- Give your key a recognizable label (e.g., โDataform Integrationโ) and save it.
๐ฅ๏ธ Step 3: Configure Your Dataform Project
Now, letโs connect your Bitbucket repository with your Dataform workspace.
Add the SSH Key to Dataform
- Create Repository in your Dataform account.
- Go to your repository.
- Under the Settings section, choose CONNECT WITH GIT.
- Choose SSH
- Put your SSH link from created repository (from bitbucket) to the field
Remote Git repository URL
- e.g. ` git@bitbucket.org:/dataform-production.git` - In new tab in GCP - go to
Secret Manager
and there go toCREATE SECRET
-
Upload your private SSH key (
id_rsa
) you generated earlier.โ ๏ธ Important: Ensure the private key file does not have a passphrase. If it does, remove it using:
ssh-keygen -p -f ~/.ssh/id_rsa
- Go back to your
DataForm
tab in your browser after you uploaded your key. Choose your key fromSecret
drop down menu. - Open your terminal and type
ssh-keyscan bitbucket.org
- For the public host key value put the value you got - currently it is
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQeJzhupRu0u0cdegZIa8e86EG2qOCsIsD1Xw0xSeiPDlCr7kq97NLmMbpKTX6Esc30NuoqEEHCuc7yWtwp8dI76EEEB1VqY9QJq6vk+aySyboD5QF61I/1WeTwu+deCbgKMGbUijeXhtfbxSxm6JwGrXrhBdofTsbKRUsrN1WoNgUa8uqN1Vx6WAJw1JHPhglEGGHea6QICwJOAr/6mrui/oB7pkaWKHj3z7d1IC4KWLtY47elvjbaTlkN04Kc/5LFEirorGYVbt15kAUlqGM65pk6ZBxtaO3+30LVlORZkxOh+LKL/BvbZ/iRNhItLqNyieoQj/uh/7Iv4uyH/cV/0b4WDSd3DptigWq84lJubb9t/DnZlrJazxyDCulTmKdOR7vs9gMTo+uoIrPSb8ScTtvw65+odKAlBj59dhnVp9zd7QUojOpXlL62Aw56U4oO+FALuevvMjiWeavKhJqlR7i5n9srYcrNV7ttmDw7kf/97P5zauIhxcjX+xHv4M=
- You are done!
โ
๐ Conclusion
Congratulations! ๐ Youโve successfully connected Bitbucket with Dataform using SSH. With this setup, you can now manage your Dataform projects like a Git proโtrack changes, collaborate efficiently, and automate workflows.
Happy coding! ๐ปโจ
If you have any questions or face any hiccups, drop a comment below. Letโs build something amazing together! ๐