Home > Software engineering >  how to upload data to storage account from CICD?
how to upload data to storage account from CICD?

Time:11-05

We need to save the "artifacts" from the build/release pipeline. How do we upload some data into a storage account from the deployment pipeline?

For exaample, here is my data:

{"mydata":"some stuff"}

I'd like to upload this into mystorageaccount/mystoragecontainer/fea8e047-0dc4-4f96-8499-aee5c3929be3.json.

How do we create blobs from the CICD pipeline?

CodePudding user response:

I have tested in my environment

I created build and release pipelines to copy data to the Azure Blob Storage

I followed these steps :

I created a file in a folder in Azure Repos

enter image description here

Now, I created a build pipeline with two tasks: Copy Files, Publish Artifact

I configured Copy Files task to copy files from the folder I created in the Azure Repos to Azure Artifacts

enter image description here

I configured Publish Artifact task to publish the Artifact data to Azure Pipelines

enter image description here

Now I ran the pipeline and the files in the folder got copied to the Artifact and the Artifact data is published to the Azure Pipelines

enter image description here

Now, I created a release pipeline with task as Azure File Copy to deploy the artifact data to Azure Blob Storage

enter image description here

I configured the Azure File Copy task with version 3.0, source as the artifact data, Destination Type as Azure Blob, Azure Service connection, storage account and the container names

enter image description here

Now I ran the release pipeline, and the file is created in the Azure Blob Storage

enter image description here

enter image description here

  • Related