Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Deploying to Azure Blob Storage in BitBucket Pipeline

Andrew Edwards
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!
October 17, 2018

I have an 'npm run build' as part of my Pipeline and I need to be able to deploy the resulting contents of the dist folder to Azure Container Blob storage.

What's the easiest way to achieve this?

How can I find out what commands are supported? e.g. AzCopy?

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 2, 2018

Hi Andrew,

There's an Azure Docker image that is supported by Microsoft which you can try using: https://hub.docker.com/r/microsoft/azure-cli/ This should be able to provide you the Azure CLI. Then you should be able to do a deployment just like your local CLI environment.

If you need to re-install NPM on that image, you can follow the instructions here: https://superuser.com/a/1187246

i.e. Run 

$ apk add --update nodejs nodejs-npm

as part of your build step.

Thanks,

Phil

James
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!
December 3, 2018

Hey Phil, 
I forgot I was watching this question and your answer looks interesting I think I'll give it a try.

I thought I'd let both you and Andrew know that I've had some luck with using AzCopy on a docker image "promact/docker-dotnet-nodejs"

- step: 
deployment: staging
trigger: manual
script:
  -
apt-get update && apt-get -y upgrade
- apt-get -y install rsync libunwind8
-
wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64
-
tar -xzf azcopy.tar.gz
- ./install.sh - azcopy --source ../mybuildfolder --destination $url --dest-key $storageKey --recursive --set-content-type --quiet

 I set the $storageKey to one of the storage keys for my container and the $url to https://<my container name>.blob.core.windows.net/$web/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events