How to connect azure vm using ssh protocol(.pem) file using bitbucket-pipeline.yml?

dhananjay waghe
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 28, 2024

Hello Folks,

Can someone help me to how to connect azure vm through bitbucket.yml file?

I have downloaded .pem file while creation of azure vm.

after that i have add same file content as pipeline variable in variable section as same has called in yml file.

but still that is not working?

could you please suggest what should be the done here to get connect with azure vm?

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 2, 2024

Hi Dhananjay,

You mentioned that you have added the file content as a pipeline variable. Please keep in mind that Pipelines does not currently support line breaks in environment variables, and I believe that PEM files include line breaks.

What you can do is base-64 encode the file (locally, on your machine) and store the encoded value in a Pipelines variable. Then, in your yml file's script, in the step that you want to use this file, you can create it by adding a command to base-64 decode the variable's encoded value.

In the following documentation you can find the commands you can use to base-64 encode a file and a sample yml that decodes the variable:

Kind regards,

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events