microsoftgraph / aspnet-snippets-sample

A repository of code snippets that use Microsoft Graph to perform common tasks such as sending email, managing groups, and other activities from an ASP.NET Core MVC app. This sample uses the Microsoft Graph .NET Client Library to work with data, and the Microsoft Identity Web Library for authentication on the Microsoft identity platform v2.0 endpoint.
MIT License
189 stars 101 forks source link

Request: Snippet for Group Scheme Extensions or ExtensionsProperties #38

Closed oppknox closed 4 years ago

oppknox commented 6 years ago

Hello

I've found your snippets to be very helpful to move my project along. Right now I'm stuck on getting extensions attributes on a group. I realize you demonstrate openextensions, but I would prefer in this case to use schemeextensions or extensionproperties. The example below doesn't work when copying and pasting into graph explorer, I also couldn't get this to work via code. Received an access denied in both cases however I do have Directory.AccessAsUser.All.

(MicrosoftGraph-Scheme_Groups - Tried and receive access denied) https://developer.microsoft.com/en-us/graph/docs/concepts/extensibility_schema_groups

Azure Graph, successfully created extensions, but I wasn't able to figure out how to use them with the graphserviceclient. https://msdn.microsoft.com/en-us/library/azure/ad/graph/howto/azure-ad-graph-api-directory-schema-extensions?f=255&MSPPError=-2147217396

Example of an ExtensionProperty `{

"odata.metadata": "https://graph.windows.net/mydomain/$metadata#directoryObjects/Microsoft.DirectoryServices.ExtensionProperty",

"value": [
    {
        "odata.type": "Microsoft.DirectoryServices.ExtensionProperty",
        "objectType": "ExtensionProperty",
        "objectId": "bd4cdaa3-3e9c-41a2-8308-8c10403c3989",
        "deletionTimestamp": null,
        "appDisplayName": "",
        "name": "extension_67183a58655d4977acd8a4815cbff2cd_SecondaryOwners",
        "dataType": "String",
        "isSyncedFromOnPremises": false,
        "targetObjects": [
            "Group"
        ]
    },`
jasonjoh commented 4 years ago

Snippets are now in the reference docs. Creating schema extensions:

https://docs.microsoft.com/graph/api/schemaextension-post-schemaextensions?view=graph-rest-1.0&tabs=csharp