[英]How to open an existing azure function in visual studio?
I'm pretty new to Azure and using the portal, wrote an Azure Function.我对 Azure 还很陌生,使用门户网站编写了一个 Azure 函数。 Now I would like to continue working on it using Visual Studio 2017. I can't seem to find a way to open/edit this existing function in Visual Studio though.现在我想继续使用 Visual Studio 2017 处理它。不过,我似乎找不到在 Visual Studio 中打开/编辑此现有函数的方法。
I'm sure I could create a new Azure Function in VS, copy code over, setup/connect to storage, etc. and deploy a new instance and delete the current instance, but would like to avoid that.我确信我可以在 VS 中创建一个新的 Azure 函数、复制代码、设置/连接到存储等,然后部署一个新实例并删除当前实例,但我想避免这种情况。
Ideally, was hoping there was some kind of open/connect to Azure account in VS, or maybe an "edit in VS" button in the portal, etc.理想情况下,希望在 VS 中有某种打开/连接到 Azure 帐户的功能,或者可能是门户中的“在 VS 中编辑”按钮等。
TIA!蒂亚!
Well, as close as you can get to that is to go to the portal, your Function App, then click Download app content
button and ask for Visual Studio solution:好吧,尽可能接近该门户,即您的 Function App,然后单击“ Download app content
按钮并询问 Visual Studio 解决方案:
This will give you a zip file with Functions, including csproj
file.这将为您提供一个带有函数的 zip 文件,包括csproj
文件。
The problem is that portal functions are C# scripts ( csx
files), and Visual Studio isn't great to work with them.问题在于门户函数是 C# 脚本( csx
文件),Visual Studio 不适合使用它们。 When you create a new Function App in Visual Studio 2017, it will make a precompiled function project - a normal class library with cs
files.当你在 Visual Studio 2017 中创建一个新的 Function App 时,它会生成一个预编译的函数项目——一个带有cs
文件的普通类库。
Unfortunately, there is no automated way to convert script functions to precompiled ones.不幸的是,没有将脚本函数转换为预编译函数的自动化方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.