New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New sample script: list sites where the particular app is installed #1634
Comments
Hi @waldekmastykarz |
Initially, the idea was to get the list of all sites in which the particular app is installed, in case the app hasn't been deployed globally to all sites. I don't know off the top of my head if a site collection app catalog would change anything with regards to how an installed app is detected, but it would be good to verify that in both cases apps are being correctly picked up. Would you like to give it a try? 🙂 |
yes sure @waldekmastykarz Sorry but I was not able to find any command which would list installed app in a site collection can you please guide on that |
Yes, it seems that we're missing commands for this script. App instances can be retrieved using CSOM but we don't have it implemented in Office 365 CLI right now. Would you be interested in building this command first? |
@waldekmastykarz I would like to give it a try |
Awesome! Let's start by creating a new issue with the spec (we have an issue template for that). Once we've verified that we're thinking about the same, you can start working on it. Fair enough? 🙂 |
Yes Sure @waldekmastykarz |
@kunj-sangani @waldekmastykarz
If I could call that in the authenticated context of CLI, that would be good enough for me... |
Not at the moment, no, but you can get an access token from the CLI and issue the request using |
Thanks, found it! Token is also good enough 👍 |
May be of some interest, here is a script fragment for Azure DevOps that checks if an app is installed on the target site (assuming "ubuntu-latest" image, o365 CLI installed, and
and the condition to use in some other task that depends on the fact if app is installed or not (quite dirty, it just looks for string matching app name in the stringified JSON returned by CURL, but was good enough for my purposes)
|
Thanks for sharing @nbelyh 👍 |
Since we shipped #2025 we're no longer blocked and could pick this up again. |
Hi @nbelyh and @waldekmastykarz, What do you think about this approach:
This should give you the desired results. I was thinking about a practical example for SharePoint administrators. Imagine you have an app that is installed in the app catalog with a specific version. As an admin I want to be sure that when I am upgrading to the latest version from the app catalog, that all app instances in the tenant are being updated to the latest version. If I am not mistaken, I have to know where these apps are installed to perform the desired upgrade operation. Based on this assumption I was looking what values the m365 spo app instance list retrieves. Cheers |
Hi @plamber! At the time of creating this issue, the "app instance list" command did not exist, in fact it was added as a solution for this issue, if you look at the history of the linked issue above. Its implementation is based on _api/web/AppTiles, like described here, but that API does not seem to provide any version information. To get the app version, that underlying SharePoint API needs to be extended, as far a I understand. |
Hi @nbelyh or @kunj-sangani , We could then see if we should look for another usecase in a separate issue. Cheers |
@plamber from my side it's not needed, the code that would iterate all sites and then calling "app instance list" on each seems to be obvious. I.e. for me this issue was relevant one year ago, when "app instance list" did not exist, but not now. |
@plamber apps are deployed in a site collection app catalog but installed in a web, so if we're to get the list of all sites where the app is installed, we'd need to iterate over all webs and not site collections, right? |
Can I take this? |
You sure can! All yours @SmitaNachan |
SharePoint Framework
Governance
The text was updated successfully, but these errors were encountered: