Azure / Azure/azure-rest-api-specs
Failed to create Azure Function while setting WEBSITE_CONTENTAZUREFILECONNECTIONSTRING in AppSettings as KeyVault reference
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
After tested, seems it failed to create Azure Function and threw below error message while setting WEBSITE_CONTENTAZUREFILECONNECTIONSTRING in AppSettings as KeyVault reference. But I can add environment variable "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING" in AppSettings with Key Vault Reference successfully thru Azure Portal.
Http request to create azure function app:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-funcapptest05/providers/Microsoft.Web/sites/acctest-func-test05
{
"identity": {
"type": "SystemAssigned"
},
"kind": "functionapp",
"location": "eastus2",
"properties": {
"enabled": true,
"serverFarmId": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-funcapptest05/providers/Microsoft.Web/serverfarms/acctestASP-test05",
"siteConfig": {
"linuxFxVersion": "",
"appSettings": [
{
"name": "AzureWebJobsStorage",
"value": "@Microsoft.KeyVault(SecretUri=https://xxxxx.vault.azure.net/secrets/secret-funcapptest05/xxxxx)"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~1"
},
{
"name": "AzureWebJobsDashboard",
"value": "@Microsoft.KeyVault(SecretUri=https://xxxxx.vault.azure.net/secrets/secret-funcapptest05/xxxxx)"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "acctest-func-test05-content"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "@Microsoft.KeyVault(SecretUri=https://xxxxx.vault.azure.net/secrets/secret-funcapptest05/xxxxx)"
}
],
"use32BitWorkerProcess": true,
"webSocketsEnabled": false,
"alwaysOn": false,
"cors": {},
"ipSecurityRestrictions": [],
"http20Enabled": false,
"preWarmedInstanceCount": 0
},
"clientAffinityEnabled": false,
"dailyMemoryTimeQuota": 0,
"httpsOnly": false
},
"tags": {}
}
```
Error message:
```
Error: web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="The parameter 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING' has an invalid value. Details: Cannot specify key vault references not referencing User Assigned Identity on Create Site." Details=[{"Message":"The parameter 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING' has an invalid value. Details: Cannot specify key vault references not referencing User Assigned Identity on Create Site."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"01033","Message":"The parameter 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING' has an invalid value. Details: Cannot specify key vault references not referencing User Assigned Identity on Create Site.","MessageTemplate":"The parameter '{0}' has an invalid value. Details: {1}.","Parameters":["WEBSITE_CONTENTAZUREFILECONNECTIONSTRING","Cannot specify key vault references not referencing User Assigned Identity on Create Site"]}}]
```
Contributor guide
Research direction
No repository file, test, or entry point is named. Start by locating the Microsoft.Web site create/update specification and its handling of appSettings, then review the issue discussion for an agreed expected behavior; done should be a confirmed API-spec or service-side resolution for the Key Vault reference error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100