I am deploying a python azure function onto an ASP with SKU of P1V3
I used to use a connection string of WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and it worked well.
Now, as security concerned, I want to migrate it to managed identity.
The bicep looked like:
resource sampleFunctionApp 'Microsoft.Web/sites@2023-12-01' = {
name: uniqueSampleFunctionName
location: location
kind: 'functionapp,linux'
identity: {
type: 'SystemAssigned, UserAssigned'
userAssignedIdentities: {
'${umi.id}': {}
}
}
properties: {
serverFarmId: hostingPlan.id
siteConfig: {
linuxFxVersion: 'Python|3.9'
appSettings: {
{
name: 'AzureWebJobsStorage__accountName'
value: storage.name
}
{
name: 'WEBSITE_CONTENTSHARE'
value: toLower(uniqueSampleFunctionName)
}
{
name: 'FUNCTIONS_EXTENSION_VERSION'
value: '~4'
}
{
name: 'WEBSITE_NODE_DEFAULT_VERSION'
value: '~14'
}
{
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
value: appi.properties.InstrumentationKey
}
{
name: 'FUNCTIONS_WORKER_RUNTIME'
value: functionWorkerRuntime
}
{
name: 'EventHubConn__fullyQualifiedNamespace'
value: '${eventHubNamespaceName}.servicebus.windows.net'
}
{
name: 'EventHubConn__tenantId'
value: '72f988bf-86f1-41af-91ab-2d7cd011db47'
}
{
name: 'EventHubConn__clientId'
value: umi.properties.clientId
}
{
name: 'CosmosConn__accountEndpoint'
value: 'https://${cosmosdbName}.documents.azure.com:443/'
}
{
name: 'CosmosConn__tenantId'
value: '72f988bf-86f1-41af-91ab-2d7cd011db47'
}
{
name: 'CosmosConn__clientId'
value: umi.properties.clientId
}
]
ftpsState: 'FtpsOnly'
minTlsVersion: '1.2'
}
httpsOnly: true
}
}
However, error raised :
[{"code":"BadRequest","target":"/subscriptions/e2108557-56b7-4d88-88e4-fdc4f0468d32/resourceGroups/wcx-rg-equal-mas-apps-dev/providers/Microsoft.Web/sites/mas-sample-func-lmyvtb5moi22y","message":"{rn "Code": "BadRequest",rn "Message": "Required parameter WEBSITE_CONTENTAZUREFILECONNECTIONSTRING is missing.",rn "Target": null,rn "Details": [rn {rn "Message": "Required parameter WEBSITE_CONTENTAZUREFILECONNECTIONSTRING is missing."rn },rn {rn "Code": "BadRequest"rn },rn {rn "ErrorEntity": {rn "ExtendedCode": "01010",rn "MessageTemplate": "Required parameter {0} is missing.",rn "Parameters": [rn "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"rn ],rn "Code": "BadRequest",rn "Message": "Required parameter WEBSITE_CONTENTAZUREFILECONNECTIONSTRING is missing."rn }rn }rn ],rn "Innererror": nullrn}"}]}}
After checking this document, WEBSITE_CONTENTAZUREFILECONNECTIONSTRING
I found the appsetting of WEBSITE_CONTENTAZUREFILECONNECTIONSTRING can be straightly removed in the deprecated ASP.
As I am using an ASP with SKU P1V3, I believe there is no need to setup the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING.
Did I miss anything important?
Is the appsetting of WEBSITE_CONTENTAZUREFILECONNECTIONSTRING still necessary in my case?