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
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
I configured Publish Artifact task to publish the Artifact data to Azure Pipelines
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
Now, I created a release pipeline with task as Azure File Copy to deploy the artifact data to Azure Blob Storage
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
Now I ran the release pipeline, and the file is created in the Azure Blob Storage