Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query.
Azure Image Builder is a service that makes it easy to create custom images for Azure Virtual Machines and other services. In addition to the GUI-based Image Builder user interface, you can also customize images via PowerShell Inline. This allows you to further automate your image creation process, and even map file shares, either from an internal server or an Azure file share.
Map File Shares with PowerShell Inline
Mapping file shares with PowerShell Inline is a simple process. First, create a PowerShell script that defines the file shares you wish to map to the image. The PowerShell script should use the New-PSDrive cmdlet with the File parameter set to true for each file share you wish to map. For example:
New-PSDrive -Name "share1" -PSProvider FileSystem -Root "\server1\share1" -File
New-PSDrive -Name "share2" -PSProvider FileSystem -Root "\server2\share2" -File
Then, add the script to your Image Template within the PowerShellInline block. For example:
"scriptInline": "[New-PSDrive -Name "share1" -PSProvider FileSystem -Root "\server1\share1" -File]
[New-PSDrive -Name "share2" -PSProvider FileSystem -Root "\server2\share2" -File]"
When the image is built, the file shares will be mapped to the image and available at the next boot. Note that your file shares must be accessible to the image builder service.
Ask Azure Image Builder Developers Questions
If you have any questions about using Azure Image Builder, there are several resources available to you. You can search the Azure documentation for more information, or you can use the Azure Image Builder tag on Stack Overflow to ask a specific question. You can also join the [Azure Image Builder Slack channel https://join.slack.com/t/azureimagebuilder/shared_invite/zt-hbryn7zf-SNSjJ8zvnQI
If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.