question

MohamadCHHIMI-7584 avatar image
0 Votes"
MohamadCHHIMI-7584 asked MohamadCHHIMI-7584 commented

Disconected File shares when using artifacts

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.
97120-disconnected-network-drive.png

Have you encounter such problems when using artifacts ? How can I resolve this issue.

Best regards
Mohamad


azure-storage-accountsazure-filesazure-devtestlabsazure-dtl-artifacts
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

kobulloc-MSFT avatar image
0 Votes"
kobulloc-MSFT answered kobulloc-MSFT edited

I went through the same steps and created a file share using an Azure storage account:
https://docs.microsoft.com/en-us/azure/storage/files/storage-files-quick-create-use-windows

Like you, I ran the script and was able to access the file share:

98865-image.png


I believe the issue is with the custom artifact. I'll reach out to you directly if you are comfortable sharing it and see if I can't troubleshoot this further.



image.png (130.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.