Closed mplwork closed 5 years ago
@mplwork, can you try downgrading the microsoft-graph-client npm package to v1.0.0 and try the original simple-graph-client.js code? I've had success only with that version, to date.
@mplwork, can you try downgrading the microsoft-graph-client npm package to v1.0.0 and try the original simple-graph-client.js code? I've had success only with that version, to date.
Thanks a lot. I tried this and can confirm that v1.0.0 sort of works. It fails in getManager but everything else works.
[onTurnError]: {"statusCode":404,"code":"Request_ResourceNotFound","message":"Resource 'manager' does not exist or one of its queried reference-property objects are not present.","requestId":"2cee4a35-5394-4911-91e8-db3a5c6db0dc","date":"2019-06-03T10:52:42.000Z","body":{"code":"Request_ResourceNotFound","message":"Resource 'manager' does not exist or one of its queried reference-property objects are not present.","innerError":{"request-id":"2cee4a35-5394-4911-91e8-db3a5c6db0dc","date":"2019-06-03T10:52:42"}}}
It works if I replace getManager
with this code
async getManager() {
return await fetch(this.graphClient.api('/me/manager')
.version('beta')
.select('displayName').buildFullUrl(), {
headers:{"Authorization": "Bearer " + this._token}})
.then((res) => {
return res;
});
}
Now how de we get this fixed? Is @microsoft/microsoft-graph-client
not usable for production? Should we use something else, roll our own?
I've been in communication with the team that manages the microsoft-graph-client node package and they are aware that there are issues. As an aside, if you try v1.4.0, does that produce any positive results?
I've been in communication with the team that manages the microsoft-graph-client node package and they are aware that there are issues. As an aside, if you try v1.4.0, does that produce any positive results?
Thanks for getting back. Yes, v1.4.0 seems to work as well.
Incidentally, the getManager
function throws an error here probably because our AAD isn't set up properly. Catching the error gives
https://graph.microsoft.com/beta/me/manager?$select=displayName
{ statusCode: 404,
code: 'Request_ResourceNotFound',
message:
'Resource \'manager\' does not exist or one of its queried reference-property objects are not present.',
requestId: '4fdc072a-be28-4b90-ac48-f377e3616950',
date: 2019-06-07T09:35:03.000Z,
body:
{ code: 'Request_ResourceNotFound',
message:
'Resource \'manager\' does not exist or one of its queried reference-property objects are not present.',
innerError:
{ 'request-id': '4fdc072a-be28-4b90-ac48-f377e3616950',
date: '2019-06-07T09:35:03' } } }
The Graph Explorer web site gives the same answer.
Sounds like you are setup. Glad it is working for you. Yes, that error is consistent for no manager existing in AAD.
Closing the issue as resolved. If you have any more problems related to this issue, please feel free to re-open.
Re-opening this for tracking. If the microsoft-graph-client we are using has issues, we need to update the sample to a version where it works (or remove the sample until we have it working version).
Does it work in Emulator? I tested it. It seems not work
can't work either
it shows the same problem, and my npm package is 1.0.0 "dependencies": { "@microsoft/microsoft-graph-client": "^1.0.0",
looks like "@microsoft/microsoft-graph-client" has changed from version 1.4.0 to current version 1.7.0, so SimpleGraphClient must be changed in order to reflect this changes or downgade the version of this librari in order to work with the current version of the example;
try to remove node_nodules/@microsoft, and then modify the dependencies to:
"dependencies": { "@microsoft/microsoft-graph-client": "1.4.0",
then run npm install for the 24.bot-authentication example
and configure all the stuff in portal.azure
after that, update the .env properties and use this properties in the emulator to test
however i couldn't test in Teams because administrative rights.
The problem is different graph client versions are not working as expected. This PR pins a working version, and removes the call to graphClient.getManager (for parity with dotnet): https://github.com/microsoft/BotBuilder-Samples/pull/1675
Sample information
Describe the bug
After having fixed the problems in #1537 the actual api calls to msgraph don't work. In the logs I see
This seems to be a problem with
@microsoft/microsoft-graph-client
but even updating it to 1.7.0 doesn't help.I clumsily rewrote the calls in
simple-graph-client.js
like so:and then the graph calls succeed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Give a clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
[bug]