Hello,
I'm using a custom artifact that i create to installe a software on my VMs.
I tested the PowerShell script directly over the VM without using artifacts and it's work fine.
In the artifact i use the provided PowerShell code by AZURE for connecting a network drive created with the service "File shares" of a storage account. if i launch this code directly over the VM the drive is correctly connected. But when I'm using this code in the artifacts to connect the network drive, it appear as disconnected when I'm connected to the VM with RDP.
The code is :
**-----------------------------------------------------------------------------------------------------------------
$connectTestResult = Test-NetConnection -ComputerName apoclab505.file.core.windows.net -Port 445
if ($connectTestResult.TcpTestSucceeded) {
# Save the password so the drive will persist on reboot
cmd.exe /C "cmdkey /add:"apoclab505.file.core.windows.net
" /user:"Azure\apoclab505
" /pass:"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
""
# Mount the drive
New-PSDrive -Name Z -PSProvider FileSystem -Root "\apoclab505.file.core.windows.net\sharedfolder" -Persist
} else {
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
}
-------------------------------------------------------------------------------------------------------------------
**
in the following photo you can see that the DVD that i hosted on the network Drive has been correctly mounted and the software has correctly installed. The issue is that just the network drive appears as disconnected.
Have you encounter such problems when using artifacts ? How can I resolve this issue.
Best regards
Mohamad