Hi I have created azure funnction app with .net core. I created everything through management portal. Its working fine. I am trying to write arm templates for the resource creations. So I exported arm template from portal and through azure devops I am running it to create resources. I have selected increment changes. Below is my sample template.
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[variables('fetchSciHubProductURLName')]",
"location": "[parameters('location')]",
"tags": {
"BU": "[parameters('Division')]",
"Environment": "[parameters('environment')]"
},
"kind": "functionapp,linux",
"properties": {
"serverFarmId": "[parameters('serverfarms_APSERDEVDVLGENSEAWE01_Linux_externalid')]",
"clientAffinityEnabled": false,
"httpsOnly": false,
"siteConfig": {
"reservedInstanceCount": "0",
"appSettings": [
{
"name": "AzureWebJobsStorage",
"value": "secrete"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[parameters('storageAccount01APPINSIGHTS_INSTRUMENTATIONKEY')]"
},
{
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"value": "[parameters('storageAccount01APPLICATIONINSIGHTS_CONNECTION_STRING')]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
},
{
"name": "WEBSITE_ENABLE_SYNC_UPDATE_SITE",
"value": "true"
},
{
"name": "WEBSITE_RUN_FROM_PACKAGE",
"value": "1"
},
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "true"
},
{
"name": "test1",
"value": "true"
}
]
}
}
},
{
"type": "Microsoft.Web/sites/functions",
"apiVersion": "2018-11-01",
"name": "[concat(variables('fetchSciHubProductURLName'), '/getproductsfromcoordinates')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('fetchSciHubProductURLName'))]"
],
"properties": {
"script_root_path_href": "https://testqwe123.azurewebsites.net/admin/vfs/home/site/wwwroot/getproductsfromcoordinates/",
"script_href": "https://testqwe123.azurewebsites.net/admin/vfs/home/site/wwwroot/bin/DemoThirdPartyDataDownload.AzFunction.dll",
"config_href": "https://testqwe123.azurewebsites.net/admin/vfs/home/site/wwwroot/getproductsfromcoordinates/function.json",
"href": "https://testqwe123.azurewebsites.net/admin/functions/getproductsfromcoordinates",
"config": {}
}
},
{
"type": "Microsoft.Web/sites/functions",
"apiVersion": "2018-11-01",
"name": "[concat(variables('fetchSciHubProductURLName'), '/UploadFilesToAzureStorage')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('fetchSciHubProductURLName'))]"
],
"properties": {
"script_root_path_href": "https://testqwe123.azurewebsites.net/admin/vfs/home/site/wwwroot/UploadFilesToAzureStorage/",
"script_href": "https://testqwe123.azurewebsites.net/admin/vfs/home/site/wwwroot/bin/DemoThirdPartyDataDownload.AzFunction.dll",
"config_href": "https://testqwe123.azurewebsites.net/admin/vfs/home/site/wwwroot/UploadFilesToAzureStorage/function.json",
"href": "https://testqwe123.azurewebsites.net/admin/functions/UploadFilesToAzureStorage",
"config": {}
}
}
I have problem with below types, Microsoft.Web/sites/functions When I check in this code, both Microsoft.Web/sites/functions fails. It throws me below error.
{
"Code": "BadRequest",
"Message": "Encountered an error (InternalServerError) from host runtime.",
"Target": null,
"Details": [
{
"Message": "Encountered an error (InternalServerError) from host runtime."
},
{
"Code": "BadRequest"
},
{
"ErrorEntity": {
"Code": "BadRequest",
"Message": "Encountered an error (InternalServerError) from host runtime."
}
}
],
"Innererror": null
}
spent couple of hours to figure it out and still not finding it. Can someone help me what I am doing wrong here? Any help would be really helpful Thanks