API call to retrieve list of Power Apps by environment

Mohamed Bougharriou 0 Reputation points
2023-04-24T15:14:29.5633333+00:00
Hello Microsoft Community,

I am trying to use an API call to retrieve a list of Power Apps by environment, but I am encountering an error. I have used the following API call:

https://management.azure.com/providers/Microsoft.PowerApps/environments/{yourENVIid}/apps?api-version=2016-11-01
However, I am getting the following error:

{
    "error": {
        "code": "DisallowedResourceOperation",
        "message": "The operation 'read' on resource type 'environments/apps' is disallowed."
    }
}
I am wondering if there is another API call that can be used to retrieve a list of Power Apps by environment that is currently working. Any help would be greatly appreciated.

Thank you in advance.
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

2 answers

Sort by: Most helpful
  1. James Hamil 27,211 Reputation points Microsoft Employee Moderator
    2023-04-24T20:35:20.6966667+00:00

    Hi @Mohamed Bougharriou , your error "The operation 'read' on resource type 'environments/apps' is disallowed." means you just need to change the permissions on your resource. To grant the required permissions to your application in Azure Active Directory, follow these steps:

    1. Sign in to the Azure portal.
    2. Navigate to Azure Active Directory.
    3. Select App registrations from the left-hand menu.
    4. Find and select your application from the list.
    5. In the application's overview page, click on API permissions from the left-hand menu.
    6. Click on Add a permission.
    7. In the Request API permissions panel, select the appropriate API (e.g., Power Apps) and the required permissions (e.g., read access to environments/apps).
    8. Click on Add permissions to save your changes. After granting the permissions, you may need to wait for a few minutes for the changes to propagate. Then, try your API call again.

    If you still encounter issues, please let me know, and I'll be happy to help further.

    If this answer helped you please mark it as "Verified" so other users can reference it.

    Thank you,

    James


  2. Sedat SALMAN 14,180 Reputation points MVP
    2023-04-24T20:38:15.8633333+00:00

    The operation 'read' on resource type 'environments/apps' is disallowed. This might be due to an issue with the user's permissions or the API call itself.

    • Make sure the user making the API call has the required permissions to access the resources. The user must have either a Global Admin or an Environment Admin role in the Power Apps environment to perform the 'read' operation.
    • Ensure that you are using a valid access token in the API call. You need to authenticate the API request with Azure Active Directory (Azure AD) by providing an access token in the 'Authorization' header of the request:
    GET https://management.azure.com/providers/Microsoft.PowerApps/environments/{yourENVIid}/apps?api-version=2016-11-01
    Authorization: Bearer <your_access_token>
    
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.