Search code examples
c#azuretfsazure-storagetfsbuild

TFS Error when writing logs to drop location: "The user name or password is incorrect."


I've used Azure File storage to configure a shared storage space that my Build Server has access to - https://azure.microsoft.com/en-us/blog/azure-file-storage-now-generally-available/

I used the following command to attach the space:

net use Z: \\portalxyz.file.core.windows.net\drops /u:portalxyz abcdef==

This works on both my Azure VMs (Build server included, with agents on it) and my local machine - I can see the drive and read/write to it.

However when I attempt a build after setting the drop location (in the build definition) to this share \\portalxyz.file.core.windows.net\drops, I get the following:

Exception Message: The user name or password is incorrect.

Looking at the exception details in the Event Log on the server, I can see that a service user is being used. I've logged into the machine as that user and mapped the space using the above command, but the error persists.

What am I doing wrong?


Solution

  • You Build Server needs to have the storage account key to access the Azure file share, There are two options to achieve this

    1) Create a system/service account using your Azure storage account name and key and then run the build server with this account

    2) Use CMDKey to persistent the credential under current user context (refer to this blog for details)