简体   繁体   English

将Azure功能从门户导入Visual Studio

[英]Import Azure Function from portal into Visual Studio

I really like working with Azure functions in the portal but am starting to need some more tooling that I'm used to for committing to my git repo, easily adding assemblies, and just plain working in a more familiar environment. 我真的很喜欢在门户网站中使用Azure功能,但是我开始需要一些我以前用于提交我的git仓库的工具,轻松添加程序集,并且只是在更熟悉的环境中工作。

Is it possible to create your Azure function app and possibly the functions themselves in the portal and then move over to Visual Studio and import that function app as a project? 是否可以在门户中创建Azure功能应用程序以及可能的功能本身,然后转移到Visual Studio并将该功能应用程序作为项目导入? Or am I approaching this wrong? 或者我接近这个错误? I understand we can create straight from Visual Studio and then publish up to Azure and maybe that is the way we should be doing it in the first place. 我知道我们可以直接从Visual Studio创建,然后发布到Azure,也许这就是我们应该首先做的方式。

A few pieces you could do. 你可以做几件事。 You can start development in the portal and then download the app settings (connection strings, etc.) via the azure-function-core-tools with a CLI command like func azure functionapp fetch-app-settings <appName> - but that will just pull the settings into an existing local project. 您可以在门户中开始开发,然后通过azure-function-core-tools下载应用程序设置(连接字符串等),并使用CLI命令,如func azure functionapp fetch-app-settings <appName> - 但这只是将设置拉入现有的本地项目。

You could also go to the Platform Settings tab and open the App Service Editor which would let you download the workspace as pictured below. 您还可以转到“ 平台设置”选项卡并打开“ 应用程序服务编辑器” ,以便下载工作区,如下图所示。 That will download the function project into a folder you could check into source control and use with CI/CD. 这会将函数项目下载到一个文件夹中,您可以将其检入源代码控制并与CI / CD一起使用。

However one important note is the portal for C# projects use C# script files (.csx), and the Visual Studio tools for Functions create .NET assemblies (.dll), so if using C# you wouldn't be able to download the workspace and open it up in Visual Studio - you'd likely be better off just copy/pasting the code into a Visual Studio project. 然而,一个重要的注意事项是C#项目的门户使用C#脚本文件(.csx),而函数的Visual Studio工具创建.NET程序集(.dll),因此如果使用C#,您将无法下载工作区和在Visual Studio中打开它 - 您可能最好只将代码复制/粘贴到Visual Studio项目中。

Personally since the latest v3 update of VS 2017 I find starting in Visual Studio is even more convenient than the portal was for Function apps. 个人自从VS 2017的最新v3更新后,我发现从Visual Studio开始比功能应用程序的门户更方便。

应用服务编辑器

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Azure门户中查看通过Visual Studio创建/部署的功能的代码,但是当我通过门户进行功能创建时可以 - Cannot view code in Azure portal for function created / deployed via Visual Studio, yet I can when I make the function via the portal 如何将已发布的Web应用程序从Azure导入到Visual Studio for Web - How to import a published Web app from azure to visual studio for web 无法从Visual Studio 2017调试和发布Azure Function - Unable to debug and publish Azure Function from Visual Studio 2017 Visual Studio 中的 Azure Function 样板代码找不到命名空间 - Azure Function boilerplate code from visual studio cannot find namespaces 如何从 Azure 门户上的 Azure 函数读取 json 文件? - How to read json files from an Azure function on Azure portal? 从Visual Studio将Azure函数发布到Azure不会生成绑定 - Publishing a azure function from Visual Studio to Azure does not generate out bindings 如何使用Azure Function CLI的--usehttps(运行主机选项),但使用Visual Studio Tooling for Azure Functions - How to use Azure Function CLI's --usehttps (run host option) but from Visual Studio Tooling for Azure Functions 如何编写Azure函数以从Web门户接收数据? - How to code An Azure function to receive data from a web portal? 如何从 .NET Core API 调用 Azure 门户中的函数应用程序 - How to call function App in Azure portal from .NET Core API 如何在 Visual Studio 中打开现有的 azure 函数? - How to open an existing azure function in visual studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM