best practice on file copy to azure resources post bicep resource deployment #5850
-
Hello community, I searched for topics on similar lines but could not answer on the best practice to be followed using bicep. We have few configuration files that need to be copied (either as-it-is or after some changes made on the configuration files) into the Azure resource (eg. VM) once the resource deployment via bicep modules are completed. Also we have a scenario to upload few files to the storage account. At present we manage it via the Az CLI's (as a post bicep deployment action). But somehow, we would like to avoid this and make it integrated as part of the bicep module deployment itself. Is there any suggestion in bicep way for this or Az CLI's are the recommended approach? Regards, Saba. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
If it's a VM, then you can setup the Azure DSC extension to perform copy file tasks. https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/dsc-overview You would also use the script extension, however that does not scale as well as the DSC extension. |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for the feedback. The VM is in a virtual network which can be accessed either from Azure Cloud shell. Will the Azure DSC help here? Sorry to ask if it is a basic question, since we have not used before. |
Beta Was this translation helpful? Give feedback.
-
I am interested in this as well, but am not using VMs. Specifically, I would like to copy blobs from an existing storage account to the one that Bicep created. 🤔 |
Beta Was this translation helpful? Give feedback.
If it's a VM, then you can setup the Azure DSC extension to perform copy file tasks.
https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/dsc-overview
You would also use the script extension, however that does not scale as well as the DSC extension.