I have the same issue here on a v4 isolated function on net70.
Issue surfaces when I place these parameters in local.settings.json:
"AzureWebJobsSecretStorageType": "keyvault",
"AzureWebJobsSecretStorageKeyVaultUri": "https://<keyvault name>.vault.azure.net/",
"AzureWebJobsSecretStorageKeyVaultClientId": "<managed user identity id> or <my personal user account id>"
Without these parameters the function runs fine (because all required parameters are in local.settings.json)
Eventually after a few minutes the services started, but with errors:
[2023-01-08T11:01:55.600Z] - ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint.
[2023-01-08T11:01:55.601Z] - ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint.
[2023-01-08T11:01:55.602Z] ---> System.AggregateException: Multiple exceptions were encountered while attempting to authenticate. (ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint.) (ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint.)
[2023-01-08T11:01:55.603Z] ---> Azure.Identity.CredentialUnavailableException: ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint.
[2023-01-08T11:01:55.604Z] ---> System.AggregateException: Retry failed after 4 tries. Retry settings can be adjusted in ClientOptions.Retry. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (169.254.169.254:80)) (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (169.254.169.254:80)) (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (169.254.169.254:80)) (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (169.254.169.254:80))
based on this section (https://learn.microsoft.com/en-US/azure/azure-functions/functions-app-settings#azurewebjobssecretstoragekeyvaulturi) in the documentation I assigned the Key Vault Secrets Officer role (to both the managed user identity and my personal user a account), but the issue persists