I have a problem whit the azure appsettings encoding.
I have a node.js application deployed into an app service. When calling the environment variables using process.env, the values are comming in wrong encoding. I was expect a "utf8" encoding that supports chars like "ñ", "ó", "í", "á", "é", "ú" but instead of that, I get chars like "¢", "£", " ", etc.
Could you help me?
Thanks!
This same document was uploaded in the past to BLOB storage and imported in the same fashion into Azure Data Warehouse without errors via Polybase. The value that causes the UTF-8 encoding error is a URL mangled among 1 million other records. It looks like there are ASCII characters coming in even though it's a UTF-8 document.
App settings reference for Azure Functions. App settings in a function app contain global configuration options that affect all functions for that function app. When you run locally, these settings are accessed as local environment variables. This article lists the app settings that are available in function apps.
This environment variable is populated automatically by the Azure App Service platform and is used to configure the integrated authentication module. The value of this environment variable corresponds to the V2 (non-classic) authentication configuration for the current app in Azure Resource Manager. It's not intended to be configured explicitly.
Azure Data Lake Analytics does not allow you to ignore the error as it's an encoding issue. I'd be happy invalidating the record all together like you can in Azure Data Warehouse. importazureencodingunicodehadoop
Exactly same thing on my side.
There seems some encoding problem with process.env
as on Kudu(https://<webappname>.scm.azurewebsites.net/Env.cshtml#envVariables
) the app setting could show as expected. Also in a .net app I was able to get the correct string.
Comparing the input with the decoded result we got, I found it may be encoded using CP437 and decoded using another charset like win1252.
So one workaround is to encode the string which have been somehow formatted incorrectly, and decode it again with the charset it's encoded. Install iconv-lite and try following code snippet.
var iconv = require('iconv-lite');
var buf = iconv.encode(process.env.MYTEST, 'win1252');
var result = iconv.decode(buf, 'ibm437');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With