You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exception when reading user property of request when authenticated with a service principal. #374
cd terraform
terraform apply --auto-approve
cd ../api
npm install
npm run deploy
cd ../client
npm install
node ./call.js
you'll see that the response has an error property populated with { isAzureFunctionsSystemError: true }
in the console logs of the azure function app you will see.
Error reading user info: AzFuncSystemError: Internal error: Expected value to be neither null nor undefined: user-name
at nonNullValue (/home/site/wwwroot/node_modules/@azure/functions/dist/azure-functions.js:2791:15)
at extractHttpUserFromHeaders (/home/site/wwwroot/node_modules/@azure/functions/dist/azure-functions.js:2078:54)
at get user (/home/site/wwwroot/node_modules/@azure/functions/dist/azure-functions.js:1852:127)
at handler (file:///home/site/wwwroot/src/functions/user.js:31:24)
at InvocationModel.<anonymous> (/home/site/wwwroot/node_modules/@azure/functions/dist/azure-functions.js:215:46)
at Generator.next (<anonymous>)
at /home/site/wwwroot/node_modules/@azure/functions/dist/azure-functions.js:121:71
at new Promise (<anonymous>)
at __webpack_modules__../src/InvocationModel.ts.__awaiter (/home/site/wwwroot/node_modules/@azure/functions/dist/azure-functions.js:117:12)
at InvocationModel.invokeFunction (/home/site/wwwroot/node_modules/@azure/functions/dist/azure-functions.js:213:16) {
isAzureFunctionsSystemError: true
}
I believe this happens because the header x-ms-client-principal-name is not populated by Easy Auth when an API is called using a service principal and the code in extractHttpUserFromHeaders.ts is using the nonNullValue() function to verify the value is not null.
Activity