Hello Team,
Am trying to upload some pdf files from thingworx repository to azure blob storage using REST API,
Could you please share any sample code available for the same?
below is what am trying
var params = {
url: "https://<AccountName>.blob.core.windows.net/<container>/<folder>?<sasToken>",
headers: {
"x-ms-blob-type": "BlockBlob"
},
content: fileContent, // Ensure this is raw file content
contentType: "application/octet-stream",
timeout: 60000 // 60 seconds
};
// Use ThingWorx HTTP POST/PUT
var result = Resources["ContentLoaderFunctions"].PutText(params);
Not getting any result or error, please help
why create a new thread? -> https://community.ptc.com/t5/ThingWorx-Developers/File-upload-to-azure-blob-storage/m-p/1036431/highlight/true#M70648
I would try the request via PostMan tool first, and then try with TWX. Azure also has a sample request where they use AuthorizationHeader (not sure if sasToken works like you have) https://learn.microsoft.com/en-us/rest/api/storageservices/put-blob?tabs=microsoft-entra-id#sample-request
