Azure SDK not available on Hosted VS2017 VSTS Build Agent?

477 views Asked by At

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.

2

There are 2 answers

0
Cocowalla On

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
0
starian chen-MSFT On

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