1. Bernie Rivera
  2. PowerServer
  3. Thursday, 26 September 2024 17:30 PM UTC

We need to figure out how to have PowerServer save files to an Azure Storage file.  We currently store the files in the database, but this can cause an Azure Database to grow too much for larger clients.  We had a solution for this for Desktop / Server installations but in Azure we have to create a different solution.  It would be nice if we could create a custom PowerServer API command that could be called within PowerScript, but that doesn't look like an option as far as I could find. 

Any suggestions on how this could be done would be helpful.

Bernie Rivera Accepted Answer Pending Moderation
  1. Friday, 27 September 2024 14:01 PM UTC
  2. PowerServer
  3. # 1

Yes, this is the only real obvious option.  It is the direction we are working on.  But I had hoped it possible to utilize the PowerServer's API access to SQL Server.  SQL server has access to API calls and a even direct access to a storage account, but it seems limited, and I was not able to figure out a way to utilize it.  I think we will just need to utilize an external API.

Comment
  1. Francisco Martinez @Appeon
  2. Friday, 27 September 2024 14:11 PM UTC
I've been playing around with uploading files to Azure from PB and I found that the most reliable way to do this is to use the Put Block (https://learn.microsoft.com/en-us/rest/api/storageservices/put-block?tabs=microsoft-entra-id) and Put Block List (https://learn.microsoft.com/en-us/rest/api/storageservices/put-block-list?tabs=microsoft-entra-id) endpoints. This will work well for large or small files.

Since these methods work with the HTTP PUT method and PB doesn't have a way to perform PUT requests that support large files you can upload them part by part with the Put Block and then consolidate all blocks into a file with Put Block List



Regards - Francisco
  1. Helpful 1
  1. Bernie Rivera
  2. Friday, 27 September 2024 15:50 PM UTC
Thanks for the reply. Do you have any PowerBuilder code examples on using this Put Block List?
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Thursday, 26 September 2024 17:40 PM UTC
  2. PowerServer
  3. # 2

use azure blob services to store files via rest api

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.