msgraph-sdk-python-core | Microsoft Graph client library for Python | SDK library
kandi X-RAY | msgraph-sdk-python-core Summary
kandi X-RAY | msgraph-sdk-python-core Summary
Microsoft Graph client library for Python
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sends the request
- Calculate delay time based on exp backoff
- Checks if the retry_count is valid
- Calculate delay for retry
- Sample with custom settings
- Adds a middleware to the middleware
- Create a session with default middleware
- Register middleware
- Sends Graph URL header
- Adds the client request id to the request
- Adds the runtime environment header to the request
- Add the Host OS header to the request
- Send a sample
- Make a POST request
- Create a Graph session
- Create a session with custom middleware
- Generate a sample of mail
- Generate a list of users
- Get a sample
- Generates a sample graph client
- Sample graph client with custom retry defaults
- Sample with custom session
msgraph-sdk-python-core Key Features
msgraph-sdk-python-core Examples and Code Snippets
Community Discussions
Trending Discussions on msgraph-sdk-python-core
QUESTION
I'm trying to hit the /me
endpoint in MS Graph API via the msgraph-sdk-python-core library. The request works via the Graph Explorer, but now I'd like to use code. I'm just trying to replicate the exact same request they show in that README.md:
ANSWER
Answered 2021-Dec-21 at 09:36If you have MFA enabled in your Azure AD tenant then you can't use UsernamePasswordCredential
or OnBehalfOfCredential
, you will have to use ClientSecretCredential
for a non interactive method but you can't call /me
endpoint as you will be authenticating with your AzureAD App that you have configured for using to call the Graph API's and also you will need to provide the required permissions in API permissions Blade of your App Registration, the same way you provide in Graph Explorer.
If you don't have MFA enabled , then you can use the two non-interactive methods.
ClientSecretCredential:
I am testing to get the details of all the users , so I have provided Directory.ReadWrite.All
to the above app and used the below code:
QUESTION
I'd like to ask Azure for the details of the currently signed in user programmatically within a Python program. The program might run from the command line or within Azure batch.
Is there way to do the same thing as the azure cli does with az ad signed-in-user show
, but through the Azure SDK for Python?
UPDATE:
Based on Gaurav's help and pointer to the Microsoft Graph Python Client Library, I tried the following:
...ANSWER
Answered 2021-Apr-19 at 05:10Based on the instructions provided here
, you would first need to install the appropriate SDKs (msgraphcore
and azure-identity
).
After that your code would be something like (again taking from the same link)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install msgraph-sdk-python-core
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page