I'm working on an ARM template to deploy an azure function. My steps are as follows
1) push arm template to blob storage and get the SAS uri 2) push the azure functions to blob storage and get the SAS uri 3) run powershell command New-AzureRmResourceGroup to create my new resource group 4) run powershell command New-AzureRmResourceGroupDeployment to deploy my application via an ARM template.
In my Arm template I'm using a nested template of MSDeploy to send up my azure function via a zip file.
The first deployment will create all of my resources but it will not deploy my Azure functions.
If I deploy via the same process with the same arm template to my freshly created resources and resource group, my azure functions will be deployed. I'm not sure what is going on with this process as both deployment are consider a success.
Here is my azure functions arm template with MSDeploy
{
"type": "Microsoft.Web/sites",
"apiVersion": "2015-08-01",
"name": "[variables('functionsName')]",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms',variables('hostPlanName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]",
"[resourceId('Microsoft.Insights/components', variables('appInsightsName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostPlanName'))]",
"name": "[variables('functionsName')]"
},
"resources": [
{
"name": "MSDeploy",
"type": "extensions",
"location": "[resourceGroup().location]",
"apiVersion": "2015-08-01",
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('functionsName'))]"
],
"properties": {
"packageUri": "[concat(parameters('_artifactsLocation'), parameters('SampleFunctionAppPackageFolder'), '/', parameters('SampleFunctionAppPackageFileName'), parameters('_artifactsLocationSasToken'))]",
}
},
{
"apiVersion": "2016-03-01",
"name": "appsettings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('functionsName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]",
"[concat('Microsoft.Web/sites/', variables('functionsName'), '/Extensions/MSDeploy')]"
],
"properties": {
**** App settings removed *****
}
}
]
}