我可以远程执行存储在Azure DevOps存储库中的代码吗?

时间:2019-08-26 14:02:47

标签: git azure-devops npx

我是Azure DevOps,Git的新手,并使用存储库进行版本控制。我研究发现,可以通过使用npx命令here运行存储在Github存储库中的代码,但这需要进行未解释的设置。是否可以以编程方式(C#/ ASP.NET或Typescript / Angular 7)和远程执行存储在存储库中的代码?这样一来,Web应用程序的前端用户只需单击一个按钮即可运行服务,而无需将文件下载到其本地计算机上的特定文件夹中。

更具体地说,这是针对Azure中目前正在运行的Indexer服务,如下所示:

public void Post([FromBody]string value)
        {
            string SearchServiceName = "serviceName";
            string SearchServiceAdminApiKey = "adminKey";

            var searchService = new SearchServiceClient(
                SearchServiceName, credentials: new SearchCredentials(SearchServiceAdminApiKey));

            searchService.Indexers.Run("nameOfIndexer");
        }

这会为文档建立索引,以便我们的搜索服务可以找到它们。但是,它并不能完成我们需要的一切,因此需要在存储库中运行代码。是否可以以编程方式运行存储库中的代码?

1 个答案:

答案 0 :(得分:1)

否,您必须下载/克隆它并在“本地”运行它。