Azure SDK not available on Hosted VS2017 VSTS Build Agent?

妖精的绣舞 提交于 2019-12-07 15:11:34

问题


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.


回答1:


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




回答2:


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


来源:https://stackoverflow.com/questions/46108199/azure-sdk-not-available-on-hosted-vs2017-vsts-build-agent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!