在Linux应用服务计划上使用ARM模板(由节点无服务器执行)部署功能时,调用Kudo端点同步触发器时得到404。
我尝试了很多对apiVersions和其他设置的修改,但是没有运气。
将该功能部署到Win32 App Service计划没有问题,但是我使用的NPM软件包sharp
没有针对该特定运行时的二进制文件。
编辑:我专注于Executing mv scale/scale-function.json scale/function.json
,并查看了Kudo App Service DebugConsole中的/home/site/wwwroot
,该文件显示mv
尚未执行。
不幸的是,mv
执行的输出未记录在日志中。
我手动执行它,因此./scale/function.json
在那。但是手动执行synctriggers
之后又返回了404。
我在下面发布了我使用的日志和模板。 感谢您的浏览!
Template
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"functionAppName": {
"type": "string",
"metadata": {
"description": "The name of the function app that you wishWEBSITE_CONTENTSHARE to create."
}
},
"storageAccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_ZRS",
"Premium_LRS"
],
"metadata": {
"description": "Storage Account type"
}
},
"sku": {
"type": "string",
"defaultValue": "PremiumV2"
},
"skucode": {
"type": "string",
"defaultValue": "P1v2"
}
},
"variables": {
"functionAppName": "[parameters('functionAppName')]",
"hostingPlanName": "[parameters('functionAppName')]",
"insightsName": "[concat(parameters('functionAppName'), '-insights')]",
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'azfunctions')]",
"storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
},
"resources": [
{
"apiVersion": "2015-05-01",
"name": "[variables('insightsName')]",
"type": "microsoft.insights/components",
"location": "[resourceGroup().location]",
"properties": {
"ApplicationId": "[variables('insightsName')]",
"Request_Source": "IbizaWebAppExtensionCreate"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "2015-06-15",
"location": "[resourceGroup().location]",
"properties": {
"accountType": "[parameters('storageAccountType')]"
}
},
{
"apiVersion": "2015-06-01",
"name": "[variables('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
"kind": "linux",
"tags": {},
"properties": {
"name": "[variables('hostingPlanName')]",
"workerSize": "3",
"workerSizeId": "3",
"numberOfWorkers": "1",
"reserved": true,
"hostingEnvironment": "",
"sku": {
"Tier": "[parameters('sku')]",
"Name": "[parameters('skuCode')]"
}
}
},
{
"name": "[variables('functionAppName')]",
"type": "Microsoft.Web/sites",
"apiVersion": "2016-03-01",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
],
"properties": {
"clientAffinityEnabled": false,
"name": "[variables('functionAppName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"siteConfig": {
"appSettings": [
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "node"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(variables('insightsName')).InstrumentationKey]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "10.14.1"
}
],
"alwaysOn": true,
"linuxFxVersion": "DOCKER|mcr.microsoft.com/azure-functions/node:2.0-node8-appservice"
}
}
}
]
}
Kudo logs
<step title="Incoming Request" date="2019-08-25T06:52:43.371" instance="c438f1" url="/api/command" method="POST" type="request" pid="72,1,15" Connection="close" Content-Type="application/json" Accept="application/json" Authorization="Bea..." Host="image-scaler-function.scm.azurewebsites.net" Content-Length="84" X-Client-IP="92.117.54.172" X-Client-Port="53578" X-WAWS-Unencoded-URL="/api/command" CLIENT-IP="92.117.54.172:53578" X-ARR-LOG-ID="eaa86347-7487-459c-9303-77fde7194ae0" X-SITE-DEPLOYMENT-ID="image-scaler-function" WAS-DEFAULT-HOSTNAME="image-scaler-function.scm.azurewebsites.net" X-Forwarded-Proto="https" X-AppService-Proto="https" >
<step title="Cleanup Xml Logs" date="2019-08-25T06:52:43.382" /><!-- duration: 19ms -->
<step title="Executing mv scale/scale-function.json scale/function.json" date="2019-08-25T06:52:43.465" CWD="site\wwwroot" >
<step title="Error occurred" date="2019-08-25T06:52:43.548" type="error" text="Invalid argument" stackTrace=" at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Kudu.Core.Commands.CommandExecutor.ExecuteCommandAsync(String command, String relativeWorkingDirectory) in /tmp/KuduLite/Kudu.Core/Commands/CommandExecutor.cs:line 139
at Kudu.Core.Commands.CommandExecutor.ExecuteCommand(String command, String workingDirectory) in /tmp/KuduLite/Kudu.Core/Commands/CommandExecutor.cs:line 67
at Kudu.Services.Commands.CommandController.ExecuteCommand(JObject input) in /tmp/KuduLite/Kudu.Services/Commands/CommandController.cs:line 43" /><!-- duration: 13ms -->
</step><!-- duration: 115ms -->
<step title="Outgoing response" date="2019-08-25T06:52:43.637" type="response" statusCode="200" statusText="OK" /><!-- duration: 13ms -->
</step><!-- duration: 292ms -->
<step title="Incoming Request" date="2019-08-25T06:52:45.974" instance="c438f1" url="/api/functions/synctriggers?api-version=2015-08-01" method="POST" type="request" pid="72,1,19" Connection="close" Content-Type="application/json" Accept="application/json, */*" Accept-Encoding="gzip, deflate" Accept-Language="en-US" Host="image-scaler-function.scm.azurewebsites.net" Referer="https://management.azure.com/subscriptions/fc561345-39cc-409f-9520-bfbf97093a78/resourceGroups/image-scaler-function-rg/providers/Microsoft.Web/sites/image-scaler-function/functions/synctriggers?api-version=2015-08-01" Content-Length="2" X-Client-IP="70.37.57.58" X-Client-Port="6208" x-ms-version="20140301" x-ms-client-request-id="b055675e-9ac1-4e5d-ab65-8296c5cb244c" x-ms-arm-request-tracking-id="bc74275c-8d2c-4d9c-98c3-bdda716062b8" x-ms-correlation-request-id="bc74275c-8d2c-4d9c-98c3-bdda716062b8" x-ms-routing-request-id="FRANCESOUTH:20190825T065244Z:bc74275c-8d2c-4d9c-98c3-bdda716062b8" x-ms-client-location="francesouth" x-ms-home-tenant-id="c9d5f7f8-284b-4cbb-9b7f-fdc3dd75620c" x-ms-client-ip-address="92.117.54.172" x-ms-arm-service-request-id="3026b0eb-0e64-4551-afef-eb6d802570f2" x-ms-client-audience="https://management.core.windows.net/" x-ms-client-scope="" x-ms-client-acr="" x-ms-client-app-id="fe0d0e9d-066e-4b8d-9a32-11fac994905c" x-ms-client-app-id-acr="1" x-ms-client-tenant-id="c9d5f7f8-284b-4cbb-9b7f-fdc3dd75620c" x-ms-client-issuer="https://sts.windows.net/c9d5f7f8-284b-4cbb-9b7f-fdc3dd75620c/" x-ms-client-object-id="0a74235d-6f3c-49fb-836b-e92fdd18c3dd" x-ms-client-puid="" x-ms-client-alt-sec-id="" x-ms-client-principal-id="" x-ms-client-authorization-source="RoleBased" x-ms-client-identity-provider="https://sts.windows.net/c9d5f7f8-284b-4cbb-9b7f-fdc3dd75620c/" x-ms-client-principal-group-membership-source="None" x-ms-client-family-name-encoded="" x-ms-client-given-name-encoded="" x-ms-activity-vector="IN.0D" x-ms-via-extensions-route="true" x-ms-geo-location="West Europe" x-ms-request-id="babd5d51-b14b-4556-8394-b5acf5b1cb49" X-WAWS-Unencoded-URL="/api/functions/synctriggers?api-version=2015-08-01" CLIENT-IP="70.37.57.58:6208" X-ARR-LOG-ID="babd5d51-b14b-4556-8394-b5acf5b1cb49" X-SITE-DEPLOYMENT-ID="image-scaler-function" WAS-DEFAULT-HOSTNAME="image-scaler-function.scm.azurewebsites.net" X-Forwarded-Proto="https" X-AppService-Proto="https" >
<step title="Outgoing response" date="2019-08-25T06:52:45.983" type="response" statusCode="404" statusText="NotFound" /><!-- duration: 13ms -->
</step><!-- duration: 46ms -->