Zhiliang
Zhiliang

Reputation: 172

Azure SDK not available on Hosted VS2017 VSTS Build Agent?

Our .Net projects are using VS 2017, and requires Azure Storage Emulator in Azure SDK to run unit tests. Our CI/CD is running in VSTS. We want to use some hosted build agent in VSTS agent pools. There are two issues we encountered. Firstly, according to official document, Hosted VS2017 seems don't have Azure SDK installed. Secondly, when running command C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe start, it failed with Error: Unable to start the storage emulator.

Upvotes: 3

Views: 486

Answers (2)

Cocowalla
Cocowalla

Reputation: 14350

I've been running the Azure Storage Emulator on a VS2017 hosted build agent for a long time now.

The trick is to initialise SQL LocalDB first (the emulator uses it), and then start the emulator. You can do this with a command line task that runs:

sqllocaldb create MSSQLLocalDB
sqllocaldb start MSSQLLocalDB
sqllocaldb info MSSQLLocalDB

"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start

Upvotes: 0

starian chen-MSFT
starian chen-MSFT

Reputation: 33728

The VSTS Hosted agent is running as service that you can’t start storage emulator (init is ok).

Check the related thread: Failed to start AzureStorageEmulator on VSTS Hosted VS2017 Agent

Upvotes: 0

Related Questions