3
votes

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
The Azure SDK is available on Hosted VS 2017 agent, you can add Command Line task to check it: Tool: C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe; Arguments: init /server (localdb)\MSSQLLocalDb.starian chen-MSFT
What's the detail scenario of your issue and what's the error?starian chen-MSFT
There seem to be two issues. First, unlike Hosted agent the official document doesn't say that Azure SDK is installed on Hosted VS2017 agent. Second, command C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe start fails probably due to insufficient permission.Zhiliang

2 Answers

0
votes

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

0
votes

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