As I have detailed previously:
Power Automate Twitter connector failing
I needed to regenerate the connection to Twitter in my Flows. The following is what worked for me and I hope it can help you as I didn’t find this set out clearly anywhere else. I found that you needed to create all new Twitter connections in your Flows, so remember to record how these are configured before you go and delete anything.
Step 1. Remove any existing Twitter connections in your Data
Navigate to Power Automate and select Data and then Connections from the menu on the left. In the top right of this screen you will find a Search box. Into this search box type:
You should now see a list of all your existing Twitter connections. ALL of these will need to be removed and thus prior, ensure you have recorded what your Twitter actions do in your Flows, because once you delete the connection here you will NOT be able to see what the actions actually did. They will simply show as invalid.
The reason you need to delete ALL the Twitter connections you find is the above error:
Failed to create connection for connection id ‘/providers/MicrosoftPowerApps/apps/shared_twitter/connections/shared-twitter-<guid>’. You have reached the maximum number of connections for the ‘twitter’ API.
I personally found I actually had two connectors. Both years apart, but all must be removed as Twitter now only supports one connection for free.
Step 2. Create Twitter API credentials
Microsoft does provide documentation on this here:
Authentication and Bring your own application
and to start with ensure you are logged into your Twitter account in the browser and navigate to:
Select Developer Portal in the top right as shown above.
Select the option to Sign up for a Free Account towards the bottom of he page.
You’ll then need to write a 250 character or more essay and agree to to all the Terms and Conditions before you Submit.
Now select the COG under the default project name that has been created for you as shown above.
Select the Edit button as shown above.
Select the Delete App button at the bottom of the page. I found that the default app did not have the correct permissions and access so I removed it and created a new one with the right settings.
Make sure copy the name of the app because you’ll need to enter at the next dialog before pressing Delete app.
Back in the projects dashboard select Add an App as shown above.
Give the app a meaningful name select Next at the bottom of the page.
Copy the API Key and API Key Secret for later use. Make sure you DO SAVE both the API Key and API Key Secret as they’ll be needed back in Power Automate.Also, keep both of these secure as they control access to your Twitter account.
Select App settings at the bottom of the page to continue.
Select the Set up button under the User authentication settings towards the bottom of the page as shown above
App permissions = Read and write and Direct message
Type of App = Web App, Automated App or Bot
Call Back URI / Redirect URI = https://global.consent.azure-apim.net/redirect
Website URL = https://global.consent.azure-apim.net/redirect
Select he option to Save at the bottom of the page. Select Yes when the above dialog appears to confirm.
You’ll now see a Client ID and Client Secret as shown above. You won’t need these so simply select Done to continue. You can re-create them if needed later.
Select Yes, I saved it to continue.
Step 3. Reconnect Twitter account in Power Automate
Return to Power Automate, Data, Connectors
Select New connection from the top of the page as shown above.
Search for Twitter using the Search box in the upper right. Then select the Twitter connector to configure it.
Authentication type = Bring your own application
Consumer key = API Key
Consumer secret = API Key Secret
A browser pop up will now appear asking you to authorize access to your Twitter account. You’ll need to login here with your Twitter account details. Enter you login details and select Authorize app.
You should then see a confirmation appear in this dialog and the browser pop up window will now close.
In the list of connections should now appear an entry for Twitter as shown above, and it it should show as Connected.
If you now navigate to where the Twitter action is inside your Flows you should see that the existing one is invalid as shown above.
Select the ellipse in the top right hand corner and from the menu that appears select Delete. I found I had to minimise the Twitter action first to allow it to be deleted.
You can now create a new Twitter action which will use the new connector and API that was created.
With that all done you should now Save your Flow and test it to ensure it is working as expected.
In summary, you’ll firstly need to check the existing configuration for any Twitter actions you have in a Flow and record these. Next, you’ll need to remove any and all existing Twitter connections in Power Automate. Remember, there maybe more than one. Next, you’ll need to go Developer area in Twitter. There you’ll need to delete the default app that is created and create a new one. When you create a new one you’ll receive credentials you’ll need to save and use back in Power Automate. Once created you’ll need to configure it with a few additional settings. With that complete, you’ll return to Power Automate and create a new Twitter data connection with the credentials obtained. Finally, you’ll need to remove the old Twitter actions from your Flows and create new ones.
As I said, this process worked for me and I hope it does for you.