web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Azure BLOB SAS authentication

(2) ShareShare
ReportReport
Posted on by 25
I am using the ABS code units and trying to authenticate using SAS.  However, the "Storage Service Authentication" seems to be trying to convert something to a Base64 hash.... using code unit "Cryptography Management Imp" and this is failing....

My code is :
 
            // SAS permission text
            SigningKey := IntegrationSetup."SAS Key";
            // Signed Services
            SignedServicesList.Add("SAS Service Type"::Blob);
            SignedServicesList.Add("SAS Service Type"::File);
            SignedServicesList.Add("SAS Service Type"::Table);
 
            // Signed Resources
            SignedResourceList.Add("SAS Resource Type"::Container);
            SignedResourceList.Add("SAS Resource Type"::Object);
            SignedResourceList.Add("SAS Resource Type"::Service);
            // Signed Permission
            SignedPermissionList.add("SAS Permission"::Read);
            SignedPermissionList.add("SAS Permission"::Add);
            SignedPermissionList.add("SAS Permission"::Write);
            SignedPermissionList.add("SAS Permission"::Create);
            SignedPermissionList.add("SAS Permission"::Delete);
            SignedPermissionList.add("SAS Permission"::List);
 
            SignedExpiry := CreateDateTime(Today, 235959T);
            Authorization := StorageServiceAuthorization.CreateAccountSAS(SigningKey,
            SignedVersion::"2022-11-02",
            SignedServicesList,
            SignedResourceList,
            SignedPermissionList,
            SignedExpiry);
 
            ContainerClient.Initialize(IntegrationSetup."Storage Account", Authorization);
            response := ContainerClient.ListContainers(containers);

At the point it gets to response := Container Client.ListContainers.... it then fails with the input is not a valid Base-64 string......

Any thoughts much appreciated.
I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,814 Super User 2025 Season 2 on at
  • Verified answer
    Second76Si Profile Picture
    25 on at
    Thanks @Khushbu Rajvi. for getting back to me.

    Must have been having a senior moment - I was trying to use a SAS key that had already been created and so I didn't need all of the above code....

    I just needed:
     
    Authorization := StorageServiceAuthorization.UseReadySAS(SigningKey);
     
    Just in case anyone else comes across this post.
  • Suggested answer
    YUN ZHU Profile Picture
    95,748 Super User 2025 Season 2 on at
    Hi, Bert provided a great example previously, which hopefully will give you some hints as well.
     
    Thanks
    ZHU
  • Gerardo Rentería García Profile Picture
    25,373 Most Valuable Professional on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans