Hello there,
I've been trying out the newly added Snowflake connector (https://learn.microsoft.com/en-us/connectors/snowflakeip/). After following the readme the connector itself works flawlessly, for a short amount of time. After about 2 hours of use the actions using this connection will response with "Unauthorized" and "code": "390303", "message": "Invalid OAuth access token. ...oRif_YACXg".
To get it working again I need to manually go to the Connections tab and "switch connection" just to sign in again. After that the token is refreshed. This isn't of course very convenient as we are trying to automate things here.
Any ideas?
Update: the solution above works!
I was running into this issue in our environment and came across this article - FAQ: Common Issues When Using the Snowflake Connector on Logic Apps, Power Automate and Power Apps. Specifically, this bit helped:
I am seeing the "Invalid OAuth access token. ...<random string>" error from the Azure side, what should I do?
The most common cause of this error is invalid audience validation. If you have an existing OAuth integration for Power BI SSO with 'https://analysis.windows.net/powerbi/connector/Snowflake', please make sure that you add 'https://analysis.windows.net/powerbi/connector/snowflake' to the audience list:
ALTER SECURITY INTEGRATION SF_CONNECTOR SET EXTERNAL_OAUTH_AUDIENCE_LIST = ('https://analysis.windows.net/powerbi/connector/snowflake', 'https://analysis.windows.net/powerbi/connector/Snowflake');
In my case, we already had an integration set up in Snowflake for PowerBI which used the URL in the audience list where "Snowflake" used a capital S. I had our Snowflake admin alter the audience list to include the URL with the lowercase s and it seems to have resolved the issue.
Facing the same issue...
Unfortunately no, I came to the conclusion that the connector is unusable as of now and decided to build a function app for the Snowflake connection which is then used from the Flow.
i guess if the user account you are using in the snowflake connector have the same email address as the Azure account you are using to login, then when Azure session expired, your snowflake connection will be disconnected too.
you probably want to use API access key and secrets to create a permanent connection to the snowflake api.
that's my guess