Function to zip files from a blob Storage. The initial purpose of this function is to use it as part of a Logic Apps flow.
After the deployment is sucessful
- Create a new Azure Blob Storage Account -- Yes. Another account. Do not re-use the account created by the Azure functions deployment.
- Create a new container.
- Go to Access Keys and obtain a Connection String
- Create the parameter StorageAccountConnectionString and input the value obtain in the previous step
Drop some files to zip into the container.
Go to the Azure function and select Code + Test
Replace the body with a proper message. See an example below
Input message example:
{
"containerpath": "container01",
"filelist": [
"in/2021071156857-08585755930712445680477052973CU30-SalesOrderHeaderV2Entity.csv,SalesOrderHeaderV2Entity.csv",
"in/2021071156857-08585755930712445680477052973CU30-SalesOrderLineV2Entity.csv,SalesOrderLineV2Entity.csv",
"config-files/salesorders/Manifest.xml,Manifest.xml",
"config-files/salesorders/PackageHeader.xml,PackageHeader.xml"
],
"zipfilename": "in/zipFile/2021071156857-08585755930712445680477052973CU30.zip"
}
Optional use the parameter "validatezip" to check if the final package contains validate data file extensions.
"validatezip": true
the example above will take zip all the files listed in "filelist" array in a file name "zipfilename". It will also rename each of the files if specified.
Also, read this post: https://ccampora.blogspot.com/2021/12/creating-dmf-data-package-from-files.html