Score:0

Using PS New-AzContainerInstanceVolumeMountObject for mounting Azure file share to container

in flag

What I'm actually trying to do is regularly run an azcopy command to copy files from a file share account to a blob account.

I'm primarily using the following: https://charbelnemnom.com/sync-between-azure-file-share-and-azure-blob-container/

So we have an Azure Automation Account, PowerShell runbook, and an existing docker image with azcopy in it.

This has been very helpful. One big snag is that for no reasons I can identify but I am able to verify, you can no longer specify a full command when creating a container instance, only an executable. If I'm missing something on this point PLEASE correct me with details!

I'm building a complex azcopy command so I'm looking at uploading a script at the time of the container instance creation in my automation runbook.

I'm using New-AzContainerInstanceObject to create my instance and it has a -VolumeMount parameter which allows you to specify an instance of a Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210301.IVolumeMount[] That can be created with the New-AzContainerInstanceVolumeMountObject command: https://docs.microsoft.com/en-us/powershell/module/az.containerinstance/new-azcontainerinstancevolumemountobject?view=azps-6.3.0

Great, seem like I'm getting close. I know I could just modify the docker image I'm using but I'm pulling it directly from the repo and want to keep doing that.

Issue with the last command is that there is no example of how to use it and since I know I have to specify the RG, storage account as well as a SAS, the simple parameters asked for are not going to do it.

I did find this: https://docs.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files

But it uses az cli which will not help me with a PowerShell runbook. Really wish that equivalents were kept in sync between cli and PS.

Thanks!

ng flag
Why do you think you can only pass an exe as the command? You can very much still pas parameters
Richard Amerman avatar
in flag
There is some indication that the command issue is actually a bug rather than an intended change. I have submitted an issue on this per recommendation from an MS engineer. https://github.com/Azure/azure-powershell/issues/15793
Richard Amerman avatar
in flag
While my evidence is only specific to Azure Automation PowerShell runbook, it is very clear. For a verified path/command, the exe on its own works, but the second you add any parameters it fails. Could be due to something in the Azure Automation Account but not sure how to even look into that.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.