Skip to content

Attempting to create a AD Applicaiton with owners #227

@derekpurdy

Description

@derekpurdy

Hello, I'm having difficulty in creating a AD Application with Owners assocaited with it. I am getting "msgraph.generated.models.o_data_errors.o_data_error.ODataError"

async def create_ad_application(requested_application_name, owner_list=None, application_id=None):
    try:
        app = Application()
        app._display_name = requested_application_name
        app._owners = owner_list
        app_result = await graph_client.applications.post(body=app)
        return app_result
    except Exception as e:
        print(e)

I tried both setting owner_list as a list of object IDs in python, and also creating a list of ad_objects within python using the following function below.

async def collect_ad_object_info(owner_list):
    post_config = GetByIdsPostRequestBody()
    post_config.ids = owner_list
    post_config.types=["user"]
    user_ad_lookup = await graph_client.directory_objects.get_by_ids.post(body=post_config)
    return user_ad_lookup.value

Any help would be appreciated, also I noticed grabbing an existing Application (using graph_client.applications.get) with owners visible in the Portal, the "owners" field is "None" in the result from the get call.

Thanks

Derek

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions