Reputation: 360
I have created blob triggered azure function and while connecting it to azure I am getting error as "No valid combination of account information found". Here is my code sample
CloudStorageAccount StorageConn;
CloudBlobClient BlobClient;
StorageConn = CloudStorageAccount.Parse(Environment.GetEnvironmentVariable("MyConn"));
BlobClient = StorageConn.CreateCloudBlobClient();
BlobServiceClient blobServiceClient = new BlobServiceClient(StorageConn.ToString());//At this line I am getting the error;
and in local.settings.json:
{
"IsEncrypted": false,
"Values": {
"MyConn": "DefaultEndpointsProtocol=https;AccountName=***;AccountKey=***",
}
}
Upvotes: 0
Views: 4297
Reputation: 15561
Your connection string is not complete: it misses the EndPointSuffix
. Although documentation states this is only needed 'for a storage service in regions or instances with different endpoint suffixes', it seems this is necessary for storage accounts in all regions now.
To create a connection string for a storage service in regions or instances with different endpoint suffixes, such as for Azure China 21Vianet or Azure Government, use the following connection string format.
To make sure you have the correct connection string, you can
A complete connection string for the general Azure cloud looks something like this:
DefaultEndpointsProtocol=https;AccountName=***;AccountKey=**;EndpointSuffix=core.windows.net
EDIT:
Please also double check there are no whitespace characters in the connection string. That might break things for you.
Upvotes: 1
Reputation: 301
Can you try with below connection string
{
"MyConn": "DefaultEndpointsProtocol=https;AccountName=***;AccountKey=***;EndpointSuffix=core.windows.net"
}
Upvotes: 0