I have an issue with accessing blob storage from an App Service Mobile App (Not MobileService). I previously have had a MobileService running that accessed the Blob Storage in the following way:
// Set the URI for the Blob Storage service.
Uri blobEndpoint = new Uri(string.Format("https://{0}.blob.core.windows.net", storageAccountName));
// Create the BLOB service client.
CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint,
new StorageCredentials(storageAccountName, storageAccountKey));
Updating the code to work on the new service, still did not help. The dataconnection seems correct:
Therefore referring to these links azure configuration | azure connection string | azure get started blob storage.
I have extracted the data connection and have implemented the `MS_AzureStorageAccountConnectionString. I have the following methods to verify the correct access is found:
string tempstorage = "";
try
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("MS_AzureStorageAccountConnectionString"));
tempstorage = storageAccount.BlobEndpoint.ToString() + " " + storageAccount.BlobStorageUri.ToString();
//Uri blobEndpoint = storageAccount.TableStorageUri.GetUri(StorageLocation.Primary);
}
catch
{
}
string cloud = "";
try
{
CloudStorageAccount temp = CloudStorageAccount.DevelopmentStorageAccount;
Uri endPoit = temp.BlobEndpoint;
string uri = temp.BlobStorageUri.ToString();
cloud = uri + " " + endPoit.ToString();
}
catch
{
}
return Ok("coud : " + cloud + " temp storage : " + tempstorage);
return value:
coud : Primary = 'http://127.0.0.1:10000/devstoreaccount1'; Secondary = 'http://127.0.0.1:10000/devstoreaccount1-secondary' http://127.0.0.1:10000/devstoreaccount1 temp storage :
This shows the access is to the Storage emulator
which is not desired.
Question
How to get the Uri
for the Azure online storage
such as to access it from the Azure app service
.
Update based on the comment
I interpreted the request for cloud configuration as the application settings for the App Service
on the azure portal.
<configuration>
<connectionStrings>
<add name="MS_AzureStorageAccountConnectionString" connectionString="DefaultEndpointsProtocol=https;AccountName=Name;AccountKey=key1_from_access_Keys" />
</connectionStrings>
<configuration>