Microsoft-graph-docs: Outgoing webhooks create an app with an erroneous distribution method

Created on 27 Feb 2020  Â·  10Comments  Â·  Source: microsoftgraph/microsoft-graph-docs

We use the distribution method attribute to determine if the app is available at the destination tenant. We currently do not want to add permissions on our app for the appcatalogs so we use the distribution method and if it is organization or sideloaded we do not copy it. We assume that the app is there at the destination if the distribution method is "store". This causes a problem since we just discovered Outgoing webhook that creates a "store" app. I believe the distribution method here is wrong and should be changed since there is no difference at all between a real store app and a webhook.

{ "id": "76fef10a-8ed9-40d8-bce7-77dbcd8d97fc", "externalId": null, "displayName": "This is a web hook", "distributionMethod": "store" }


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

MSTeams-Developer-Support teams webhooks product messaging

Most helpful comment

@daspionzor , We can repro this as bug for webhook application, DistributionMethodis always store. we have filed a bug for this, will update you once it is fixed.

All 10 comments

@daspionzor Could you please provide us the request that you are trying to send? I can't see distributionMethod mentioned in the documentation, Are you passing it for your own reference to check the app installation? It would be good if you can provide some more information so we can check it with engineering team

@Trinetra-MSFT Yes of course! I simply create a webhook in one of my team. When you do that it adds it to the appCatalogs for the tenant. So i use

https://graph.microsoft.com/v1.0/appcatalogs/teamsapps to get all teams apps from my tenant

And I get this
{ "id": "65d7bedd-e4b4-4890-99d9-f1bde5591142", "externalId": null, "displayName": "Webhook test", "distributionMethod": "store" }
As you can see, the distributionMethod is store and not webhook. That is misleading since it is not available in the MSTeams apps store, it should be webhook instead.

We also get that information directly on a team using

https://graph.microsoft.com/v1.0/teams/{teamId}/installedApps?$expand=teamsApp

@daspionzor , We can repro this as bug for webhook application, DistributionMethodis always store. we have filed a bug for this, will update you once it is fixed.

I'm not sure this is a bug - the webhook is a specialized version of a Connector, which is technically a store app.

I'm not sure this is a bug - the webhook is a specialized version of a Connector, which is technically a store app.

@clearab I understand that, but it is a Custom webhook which is created only in my tenant, it does not come from the store. The store distribution method for me is that the app is available from the public Teams Apps store in all tenants, which is not the case here.

Edited : It should at least be like custom apps : Organization

@daspionzor , This is by design as of now. custom app distribution method is store

This does not make any sense. Here is a couple exemple of apps from my tenant's app catalog (taken from https://graph.microsoft.com/beta/appcatalogs/teamsapps)

This one was created in the app studio and uploaded in the store for my whole tenant

{
            "id": "ecc9f014-7b35-4627-b032-29d54d537c53",
            "externalId": "c8e9fa73-48c4-4ff7-ac48-6b6c10545f3c",
            "name": "Custom app whole tenant",
            "displayName": "Custom app whole tenant",
            "distributionMethod": "organization"
}

This one was created in the app studio and uploaded using Upload a custom app on a team

{
            "id": "2ffac0c4-1590-4718-b65a-0a14bbe1fada",
            "externalId": "49dd9278-14ce-44f1-85da-38bd8a3e76f7",
            "name": "App created from App Studio",
            "displayName": "App created from App Studio",
            "distributionMethod": "sideloaded"
 }

This is a normal app from the store available to all tenants in the world

{
            "id": "7299542a-1697-4ec1-812b-6b70065c0795",
            "externalId": null,
            "name": "Azure Boards",
            "displayName": "Azure Boards",
            "distributionMethod": "store"
}

Finally this one was created using the Create an outgoing webhook on a team

{
            "id": "e77bb250-6c9d-4170-9b4f-224b0cb635f9",
            "externalId": null,
            "name": "This is a webhook",
            "displayName": "This is a webhook",
            "distributionMethod": "store"
}

Now, what I understand from distributionMethod is the way it is distributed. So for the first one, Organization makes senss since it is distributed only for my tenant. The second one makes sense too since it is sideloaded directly into a team. The third one also makes sense since it is in the store and available to all tenants in the world. Now the last one is not available to all tenants, only in a specific team within my tenant. Putting all these apps side by side you can clearly see that a distributionMethod of type store on a custom webhook that is only available to me makes no sense at all. The actual value should be sideloaded since you can only create a webhook within a specific team. Or at least put Organization, but store makes no sense at all. There is also no way for us to know that "This is a webhook" is a custom app and not a default app from the store.

A custom webhook is a store app - it is a configured O365 Connector. Essentially "Custom Webhook" is the name of the store app, and you configure it to create a unique URL for your particular instance. It is however, still a store app. Another way to think about this is that when you're using custom webhooks you never install your own app package like you would if you were distributing a custom app.

I understand yeah, but let's but this into action. I am moving a team from a tenant to another. I only want to keep out of the box stuff from that source team. To get what apps are installed on that team, I can use the teams/{teamId}/installedApps call. I ignore all the custom stuff (Organization and sideloaded) and add these to the destination team. Now, since custom webhooks are not something I want to move over, the only way to know if it is indeed a custom webhook, is to scan the whole teamsApps catalog at the destination tenant. This is what I do not like. I understand that custom webhooks are like a copy of a store app with a different configuration, but there are still apps that are only present in the catalog of my tenant. And as per the API doc :

image

This is not true here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronrogers picture aaronrogers  Â·  3Comments

joostvdlinden picture joostvdlinden  Â·  4Comments

RobinBreman picture RobinBreman  Â·  4Comments

climam picture climam  Â·  4Comments

findyoucef picture findyoucef  Â·  4Comments