![](/img/trans.png)
[英]Where to place the dependencies for shared assemblies in Azure Functions
[英]Deployment of Azure Function with Shared Assemblies
我正在构建一个Azure功能,我使用一种预编译方法。 在函数本身中,我们只有一个调用“Process.Run()”来启动预编译的私有DLL。 这些dll保存在Web应用程序根目录下的Shared文件夹中。
就我们所见,一切都在完美运行,但现在我们想通过ARM模板或PowerShell脚本(ZIP)进行部署。 我们还使用Visual Studio预览功能模板。
我们想要部署的形式是
-- Host
---Shared (Deploy DLL's in this folder)
---HttpTriggerFunctionCSharep1
----(Deploy the needed files to this directory)
您可以通过多种方式部署Azure功能。 这是关于它的一个很好的博客文章,我将在下面为您总结并添加第四点。
我首选的方法是#4。 您需要为此部署执行几个步骤。
{
"name": "MSDeploy",
"type": "extensions",
"location": "[resourceGroup().location]",
"apiVersion": "2015-08-01",
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('functionAppName'))]"
],
"properties": {
"packageUri": "[concat('https://',parameters('storageAccount'), '.blob.core.windows.net/', parameters('storageContainer'), '/', parameters('zipFile'))]",
"dbType": "None",
"connectionString": ""
}
}
我还发现了这个示例实现,它也基于我上面描述的原则: https : //github.com/ianalderman/AZF_Samples/tree/master/DeploymentExample 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.