Skip to content
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

Enhancement: extend pa app get to allow retrieving apps by their display name #2174

Closed
waldekmastykarz opened this issue Feb 16, 2021 · 7 comments

Comments

@waldekmastykarz
Copy link
Member

Currently, pa app get allows you to retrieve information of an app by specifying its name which is a GUID. We should also allow specifying the display name which is more user-friendly and something that you could know upfront without having to look it up.

This can be picked up after merging #2172

@Abderahman88
Copy link
Contributor

Volunteer 🤚

@waldekmastykarz
Copy link
Member Author

Sold! All yours @Abderahman88. Appreciate your help 👏

@Abderahman88
Copy link
Contributor

At the moment, I'm getting all apps using https://management.azure.com/providers/Microsoft.PowerApps/apps?api-version=2016-11-01 and filtering out the required name. It works, but is there not an other way?

paGet

I'm trying to use the $filter-parameter in the API call above, but I get following error.

{
    "error": {
        "code": "InvalidAppFilterCombination",
        "message": "The app '$filter' and '$expand' elements only support one query type per request. The supported '$filter' keys for equivalence matches are combinations of 'tagname' and 'tagvalue', or exclusively 'Visibility'. The '$expand' query supports the following format: '$expand=permissions($filter=maxAssignedTo('[objectId]'))'."
    }
}

@waldekmastykarz
Copy link
Member Author

If the API doesn't support it then the approach you have at the moment is good 👍

@appieschot
Copy link
Member

@Abderahman88 I am not 100% sure but think that you can use REST filters on that endpoint (https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/rest-api-walkthrough). So perhaps you can do a filter on the displayName property. I haven't tested that though but that might be an option.

@Abderahman88
Copy link
Contributor

@appieschot I tried a filter but I don't get the error. (see post above)

https://management.azure.com/providers/Microsoft.PowerApps/apps?api-version=2016-11-01&$filter=displayName eq 'TestApp' --> does not work

But for example https://management.azure.com/providers/Microsoft.PowerApps/apps?api-version=2016-11-01&$filter=classification eq 'EditableApps' --> works (+ I don't see the property 'classification' in the response 🤷 . Got this filter example from Microsoft.PowerApps.PowerShell)

@appieschot
Copy link
Member

Sorry! Didn't read properly! Looks like getting them all is the only way. If I ever find some time I will have a look at the powershell option as well. Still need to dive into those to spec some other commands as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants