The service provider action failed with error code 'InvalidServiceProviderConnection' and error message 'Provide either a connection string or endpoint for your storage account'

{tocify} $title={Table of Contents}


Issue


In a POC for testing the connectivity to Azure services from logic app standard workflow developed locally,  created a  workflow which gets triggered by http request, does the transformation to json format and uploads the transformed content in a container as blob.

Logic app standard workflow - creating blob in container



Tested it locally and it did work absolutely fine.

Next, deployed the project to Azure Logic app and sent a http request via postman to test it.

However, the execution failed.

Provide either a connection string or endpoint for your storage account


Bad Request with following Error :

{"statusCode":"BadRequest","body":{"code":"ServiceProviderActionFailed","message":"The service provider action failed with error code 'InvalidServiceProviderConnection' and error message 'Provide either a connection string or endpoint for your storage account.'."}}




Why it happened

Something went missing  after the deployment and as the error points  Provide either a connection string or endpoint for your storage account.

So missing was connection string to storage account which has the container in which blob is to be written.

I cross checked the local.settings.json in Visual studio code with Logic App->Configuration->Application Settings and found following missing in later.

  "AzureBlob_connectionString": "DefaultEndpointsProtocol=https;AccountName=firstdemo4b7531;
AccountKey=gqYNYbqNxmxsqJMerzFvkTLLkmFB0PXpj/FRGOhhzGqpHp+ASthzaqCg==;
EndpointSuffix=core.windows.net"

And this was implicitly included in local.settings.json file, when I created connection to storage account while designing the workflow.

But it was not moved while deployment.


What to do

Whenever we do deployment of Logic app Standard, we should check if all the settings are reflected in Logic App->Configuration->Application Settings.

It is because only default settings are moved, any thing custom is not moved. And needs to be added explicitly after deployment.

So here we need to add storage account connection string in Application settings of Logic App and save it.

Add storage account connection string in Application settings of Logic App

That's all needed, the workflow executed successfully then after.

Note: Application settings are shared by all the workflows in Logic app


Learn More about Logic App

Post a Comment

If you have any suggestions or questions or want to share something then please drop a comment

Previous Post Next Post