Azure / Azure/azure-quickstart-templates

Q: Cannot set function key - sample needed

Open
#6,757 4 comments 4 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

[Provision Function App](https://azure.microsoft.com/en-us/resources/templates/101-function-app-create-dedicated/)

### Issue Details
Trying to make use of function keys resource according to this https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2018-02-01/sites/functions/keys and getting error:
`New-AzResourceGroupDeployment : 08:09:00 - Error: Code=InvalidRequestContent; Message=The request content was invalid and could not be deserialized: 'Could not find member 'value' on object of type 'TemplateResource'.`

```
{
"apiVersion": "2015-08-01",
"type": "Microsoft.Web/sites",
"name": "[variables('functions_name')]",
"location": "[variables('location')]",
"tags": {
"ccm": "[variables('ccmvalue')]"
},
"kind": "functionapp",
"identity": {
"type": "SystemAssigned"
},
"dependsOn": [
"[variables('appserviceplan_functions_name')]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appserviceplan_functions_name'))]",
"siteConfig": {
"http20Enabled": true
}
},
"resources": [
{
"type": "config",
"apiVersion": "2018-11-01",
"name": "appsettings",
"dependsOn": [
"nestedTemplate",
"[variables('functions_spomanagement_name')]"
],
"properties": {
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('Microsoft.Insights/components/', variables('appinsights_name')), '2015-05-01').InstrumentationKey]",
"AzureWebJobsStorage": "[concat('@Microsoft.KeyVault(SecretUri=', reference(resourceId(parameters('rg-api-name'), 'Microsoft.KeyVault/vaults/secrets', variables('kv_dss_name'), variables('secrets_storageaccount_connectionstringname')), '2018-02-14').secretUriWithVersion, ')')]",
"FUNCTIONS_EXTENSION_VERSION": "~1",
"FUNCTIONS_WORKER_RUNTIME": "[variables('functions_worker_runtime')]",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('@Microsoft.KeyVault(SecretUri=', reference(resourceId(parameters('rg-api-name'),'Microsoft.KeyVault/vaults/secrets', variables('kv_dss_name'), variables('secrets_storageaccount_connectionstringname')), '2018-02-14').secretUriWithVersion, ')')]",
"WEBSITE_CONTENTSHARE": "[toLower(variables('functions_management_name'))]"
}
}
// THIS IS WHAT CAUSES ERROR
//{
// "name": "variables('keys_managementinvocation')",
// "type": "Microsoft.Web/sites/functions/keys",
// "apiVersion": "2018-02-01",
// "value": "[parameters('managementinvocationkey')]"
//}
]
},
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked Provision Function App template and the Microsoft.Web sites/functions/keys reference, then compare the shown nested resource with the documented resource schema. A useful sample should deploy the function key without the InvalidRequestContent deserialization error and make the required resource shape clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.