azure-tools-for-intellij
azure-tools-for-intellij copied to clipboard
Error Loading Function Apps with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING provided by Key Vault
IntelliJ build version: 2019.2.3 RD-192.7317.11 OS: Mac OS X JDK: JetBrains s.r.o 11.0.4 Plugin version: 3.26.0.565-2019.2 Error message:
com.microsoft.azure.management.appservice.DefaultErrorResponseException: Status code 500, {"Code":"InternalServerError","Message":null,"Target":null,"Details":[{"Message":null},{"Code":"InternalServerError"},{"ErrorEntity":{"Code":"InternalServerError","Message":null}}],"Innererror":null}
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.microsoft.rest.ServiceResponseBuilder.build(ServiceResponseBuilder.java:122)
at com.microsoft.azure.AzureResponseBuilder.build(AzureResponseBuilder.java:56)
at com.microsoft.azure.management.appservice.implementation.WebAppsInner.getDiagnosticLogsConfigurationDelegate(WebAppsInner.java:4743)
at com.microsoft.azure.management.appservice.implementation.WebAppsInner.access$2500(WebAppsInner.java:59)
at com.microsoft.azure.management.apps
I'm not able to see any of the function apps or deploy, this is a blocker for me.
Looks like this issue is caused by a key vault reference in the storage account connection string in the function app. If I remove the key vault reference string then it works. See Key Vault For App Services
@kwasak This is with a setting similar to this, right?
@Microsoft.KeyVault(SecretUri=https://.....vault.azure.net/secrets/Foo/......)
The exception seems like a server-side error in the Azure Management API's, does it still happen right now when listing function apps? (even those with a Key Vault setting?)
Yes @maartenba it’s in the format you described.
It appears to happens when listing function apps in the azure explorer that have a key vault reference for the setting WEBSITE_CONTENTAZUREFILECONNECTIONSTRING
. If I enter the raw string for this setting then I don't get an exception.
When picking a function app to deploy to in the build configuration options, I don’t get an exception, however nothing seems to load. I tried it on Visual Studio for Mac and Windows and they work fine.
Also worth noting, I didn't get an exception after adding a key vault reference for Azure Settings APPINSIGHTS_INSTRUMENTATIONKEY
and AzureWebJobsStorage
.
After investigating, it looks like the Azure Management API is returning a 500 status code on the following request:
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/config/logs?api-version=2018-02-01
The response:
{"Code":"InternalServerError","Message":null,"Target":null,"Details":[{"Message":null},{"Code":"InternalServerError"},{"ErrorEntity":{"Code":"InternalServerError","Message":null}}],"Innererror":null}
This request originates from the FunctionAppsImpl
class in the Azure Management SDK for Java which we use under the hood. The actual call is initiated in WebAppsInner
on or near line 1994.
I have opened an issue with Microsoft at Azure/azure-libraries-for-java#906.
@maartenba Ok good to hear, looking forward to a fix