how can i open the sftp service using Http Trigger with PowerAutomate?

Hamza Sote 20 Reputation points
2024-02-19T09:56:21.4533333+00:00

The access token has been obtained for wrong audience or resource '00000002-0000-0000-c000-000000000000'. It should exactly match with one of the allowed audiences 'https://management.core.windows.net/','https://management.core.windows.net','https://management.azure.com/','https://management.azure.com'.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 47,506 Reputation points Microsoft Employee Moderator
    2024-02-20T09:23:14.4633333+00:00

    @Hamza Sote Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    As I understand you're trying to use an access token obtained for the wrong audience or resource to open the SFTP service using an HTTP trigger in Power Automate. The error message you're seeing indicates that the access token should match one of the allowed audiences, which are:

    To resolve this issue, you can try the following steps:

    1. Make sure that you're obtaining the access token for the correct audience or resource. In this case, you should obtain the access token for the SFTP service that you're trying to access.
    2. If you're using the Azure AD connector in Power Automate to obtain the access token, make sure that you're specifying the correct resource parameter in the Get token action. The resource parameter should be set to the URI of the SFTP service that you're trying to access.

    If you're still having issues, you can try using the HTTP action in Power Automate to make a direct HTTP request to the SFTP service. You can include the access token in the Authorization header of the HTTP request. Here's an example of how to do this:

    HTTP POST https://sftp.example.com/api/files
    

    Replace https://sftp.example.com/api/files with the URI of the SFTP service that you're trying to access, and replace the access token in the Authorization header with the one that you obtained for the correct audience or resource.

    Obtaining an access token for the wrong audience or resource when trying to open the SFTP service using HTTP Trigger with PowerAutomate in Azure, you need to ensure that the Audience property is set correctly. The Audience property should be set to the target resource ID, which is the URI of the resource that you want to access. This ensures that the access tokens used for authentication are valid for the correct resource. You can also specify the root service URL for a specific storage account. For more information about authorizing access with Microsoft Entra ID for Azure Storage, see the following documentation:

    For further troubleshooting, you can refer to the following resources:

    Troubleshoot common issues with triggers - Power Automate

    Please let us know if you have any further queries. I’m happy to assist you further.    

    ---Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

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