[Solved] Appsettings settings for Media Blob Storage
c
V13.5.2 Trying to convert a site to use Azure Blob Storage with details given by the client's IT team, so having to trust them. Could someone let me know if I've put the right bits in the right holes please, or correct me if I (or their team) have got it wrong. They sent (anonymised of course ;)):- Blob Storage Name: umbracocmsabcd SAS Token: https://umbracocmsabcd.blob.core.windows.net/media?si=coname access&spr=https&sv=2022-11-02&sr=c&sig=abcdefghijklmnopqrstuvwxyz123456789123651236547891 Container Name: media In AppSettings I've done this:-
Copy code
"Storage": {
      "AzureBlob": {
        "Media": {
          "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=umbracocmsabcd;AccountKey=abcdefghijklmnopqrstuvwxyz123456789123651236547891;EndpointSuffix=core.windows.net",
          "ContainerName": "media"
        }
      }
    }
With the two nuget packages installed and registered in program.cs as instructed in the V13 docs I get the following error when running the site (which crashes):-
Copy code
System.FormatException: No valid combination of account information found.
   at Azure.Storage.StorageConnectionString.<>c.<Parse>b__67_0(String err)System.FormatException: No valid combination of account information found.
Thanks.
k
The Shared Access Signature token is something else than the account key required in the connection string. They need to send you the connection string you get from the Azure Portal UI. On the Azure resource in the Azure Portal, go to Access keys > key1/key2 > Connection string > Show > Copy. The connection string will have this format:
"ConnectionString": "DefaultEndpointsProtocol=https;AccountName=AcmeLTD;AccountKey=HereComesSomeNiceBase64==;EndpointSuffix=core.windows.net"
c
Thanks very much for that. I'll get back to them 🙂
k
The SAS token is used to get an URL to a blob/container with a signed token added in the query string which gives read/write access, e.g., https://container/media.item?sas=asdfg where
asdfg
is verified by Azure to contain a valid signature and the access rights specified in the token are then applied. So the entire SAS URL is very secret (just like the connection string). (
asdfg
in reality is a base64 jwt(?) with scopes etc.)
90 Views