You have an existing Azure Function App (V4 runtime) that uses a standard connection string for the host storage account configuration (AzureWebJobsStorage). To comply with security policies, you must migrate the Function App to use an identity-based connection instead of connection secrets.
Which sequence of steps should you perform to configure the Function App to use a system-assigned managed identity for its host storage?
- 1Enable a system-assigned managed identity on the Azure Function App.
- 2Assign the Storage Blob Data Owner, Storage Queue Data Contributor, and Storage Table Data Contributor roles to the identity at the scope of the storage account.
- 3Add the AzureWebJobsStorage__accountName application setting to the Function App configuration.
- 4Delete the connection string value named AzureWebJobsStorage from the Function App application settings.
Answer
To configure the Function App to use a system-assigned managed identity for host storage, first enable the system-assigned managed identity on the Function App. Next, assign the Storage Blob Data Owner, Storage Queue Data Contributor, and Storage Table Data Contributor roles to the managed identity. Then, add the AzureWebJobsStorage__accountName application setting to the Function App configuration. Finally, delete the connection string value named AzureWebJobsStorage from the Function App application settings.
The correct sequence begins with enabling the system-assigned managed identity to generate the service principal ID. Once the principal is created, the required Azure RBAC roles must be assigned to grant the identity access to the storage account. The configuration settings must then be updated by adding the AzureWebJobsStorage__accountName setting to specify the target storage account name. Finally, the legacy AzureWebJobsStorage connection string setting must be deleted, as connection string settings take precedence over identity-based configurations.
Step-by-Step Solution
Key Concept
Configuring Azure Functions host storage with identity-based connections using system-assigned managed identity.
Estimated Time:2m 0s