I am porting a simple webpack based static client side application from GitLab to Azure DevOps. Following the build stage I need to deploy the contents of the dist
folder to an Azure ADLSg2 storage container that hosts the client side application.
The following partial shows the working deployment stage from the .gitlab-ci.yaml
that uses the Azure CLI:
prod-deploy-azure:
stage: deploy
image: mcr.microsoft.com/azure-cli
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
dependencies:
- 'prod-build'
before_script:
- 'az login --service-principal -u ${AZURE_SP_ID} -p ${AZURE_SP_SECRET} --tenant ${AZURE_TENANT}'
- 'STORAGE_KEY=`az storage account keys list --account-name ${AZURE_STORAGE_NAME_DEV} --output json --query "[0].value"`'
- 'az storage container create --auth-mode key --account-key ${STORAGE_KEY} --account-name ${AZURE_STORAGE_NAME_DEV} --name ${AZURE_STORAGE_CONTAINER} --public-access blob'
script: # Check that the dist directory exists from the build stage
- |
if [ -d 'dist' ] ; then
cd dist
pwd;
ls -latrR;
az storage blob upload-batch --auth-mode key --account-key ${STORAGE_KEY} --account-name ${AZURE_STORAGE_NAME_DEV} --overwrite true --source ${PWD} --destination ${AZURE_STORAGE_CONTAINER}
else
echo 'No dist directory abort deployment to ' ${AZURE_STORAGE_NAME_DEV} ${AZURE_STORAGE_CONTAINER}
fi;
However, despite some investigation on this site and MS knowledge sites I am unable to figure out how this might be done in ADO. Any pointers or assistace would be gratefully received.