The npm package for @azure/storage-blob doesn't seem to play nice with the Azure Blob storage modules for IoT Edge

Currently, I am developing an edge module using Node.js to interact with Azure Blob storage modules on IoT Edge platform.
To achieve this, I am following the documentation available at https://www.npmjs.com/package/@azure/storage-blob. The npm package utilizes the Service API version 2022-11-02. However, the Azure Storage SDKs used by Blob storage modules on IoT Edge adhere to the Azure Storage API version 2017-04-17 for block blob endpoints. When attempting the listContainers operation as shown below:

    
    const { DefaultAzureCredential } = require("@azure/identity");
    const { BlobServiceClient } = require("@azure/storage-blob");

   const account = "<account>";
   const defaultAzureCredential = new DefaultAzureCredential();

   const blobServiceClient = new BlobServiceClient(
      `https://${account}.blob.core.windows.net`,
      defaultAzureCredential
    );

   async function main() {
      let i = 1;
      let containers = blobServiceClient.listContainers();
      for await (const container of containers) {
        console.log(`Container ${i++}: ${container.name}`);
      }
   }

   main();

The operation results in the following exception:

RestError: The value for one of the HTTP headers is not in the correct format. RequestId:42e1b7bf-1523-49df-9d42-537424d21605 Time:2023-04-15T20:40:34.6596102Z { "name": "RestError", "code": "InvalidHeaderValue", "statusCode": 400, "request": { "streamResponseStatusCodes": {}, "url": "http://127.0.0.1:11002/localstorageaccount/newcontainer1681591234606?restype=REDACTED", "method": "PUT", "headers": { "_headersMap": { "x-ms-version": "REDACTED", "accept": "application/xml", "user-agent": "azsdk-js-storageblob/12.14.0 (NODE-VERSION v16.20.0; Linux 5.15.90.1-microsoft-standard-WSL2)", "x-ms-client-request-id": "9f67e347-9a87-48a5-aab8-49bdab7308b6", "x-ms-date": "REDACTED", "authorization": "REDACTED" } }, "withCredentials": false, "timeout": 0, "keepAlive": true, "decompressResponse": false, "requestId": "9f67e347-9a87-48a5-aab8-49bdab7308b6" }, "details": { "connection": "close", "content-length": "940", "content-type": "application/xml", "date": "Sat, 15 Apr 2023 20:40:34 GMT", "server": "Microsoft-NetCore/2.0", "x-ms-request-id": "42e1b7bf-1523-49df-9d42-537424d21605", "message": "The value for one of the HTTP headers is not in the correct format.\nRequestId:42e1b7bf-1523-49df-9d42-537424d21605\nTime:2023-04-15T20:40:34.6596102Z", "code": "InvalidHeaderValue", "HeaderName": "x-ms-version", "HeaderValue": "2022-11-02", "ExceptionDetails": { "ExceptionMessage": "The value 2022-11-02 provided for request header x-ms-version is invalid.", "StackTrace": "Microsoft.Cis.Services.Nephos.Common.Protocols.Rest.InvalidHeaderProtocolException: The value 2022-11-02 provided for request header x-ms-version is invalid.\n at Microsoft.Cis.Services.Nephos.Common.Protocols.Rest.BasicHttpProcessorWithAuthAndAccountContainer

1.RunVersionCheck()\n   at Microsoft.Cis.Services.Nephos.Common.Protocols.Rest.BasicHttpProcessorWithAuthAndAccountContainer
1.ProcessImpl(AsyncIteratorContext`1 async)+MoveNext()"

The issue is clearly highlighted in the line "The value 2022-11-02 provided for request header x-ms-version is invalid."

I am seeking a solution to explicitly define the API Version that the SDK should utilize, but currently, I am unable to find a method within Node.js for achieving this. It seems that the Python SDK offers this functionality, but I have hit a roadblock while trying to resolve this in Node.js.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

HTML/Javascript/CSS Templates: Keeping Tabs on Progress

I'm looking for templates that use notepad as an editor for html/javascript/css. I want to find a template that displays text or pictures upon clicking, like the example below: https://i.sstatic.net/qsFYs.png Sorry if this is a silly question, it&ap ...

Aggregate the values in each position across various arrays and merge them into distinct arrays

I'm facing an issue that I can't seem to solve on my own. Imagine we have several arrays: [1,2,3] [1,2,3] [11,12,13] How do I go about extracting all the values at each index from these multiple arrays and combining them into separate arrays? T ...

Having trouble with transferring information from JQuery to PHP

Currently, I'm working on transmitting data from jQuery to PHP. Here's an excerpt of what I've done: var jsonArray = JSON.stringify(dataArray); $.ajax({ type: "POST", url: "addcar_details.php", ...

Tips for enhancing the speed of drawing circles in mouse movement using JS and CANVAS

My current script allows me to draw a circle during mousemove, but it's not as fast as I'd like. Before drawing the circle, I gather the color pixel during mousemove in order to draw a circle on the canvas with the picked color. I came across ...

Optimizing image centering in Next JS as screen size expands

I've been struggling to work with NextJS's Image component. My goal is to set up a banner image that only covers a specific amount of space on the screen, regardless of screen size. I have managed to achieve this by using max-height: 30vh and ov ...

Transmit a message from the background.js script to the popup window

Currently, I am looking to integrate FCM (Firebase Cloud Messaging) into my chrome extension. After conducting thorough research, I have discovered that the most efficient way to implement FCM is by utilizing the old API chrome.gcm. So far, this method has ...

Set markers at specific locations like "breadcrumbs" and generate a route using Google Maps API v3.exp

I'm developing a new iOS application for scouting out locations while on the move. I want users to be able to mark each location by simply clicking a button, which will drop a marker based on their current location. The ultimate goal is to connect all ...

Form a collection of visible table rows without hidden columns

My table allows users to filter out specific rows by selecting a checkbox. When a checkbox is checked, certain rows are hidden. I am trying to create an array with all the rows that are not hidden, but I am having trouble accessing the visibility state of ...

What is the best way to handle passing the "img" object to an onload event handler in ReactJS JSX?

I am currently working on an img element that I want to be able to listen for the onLoad event. However, I also need access to the image object itself in order to check properties like width and height. Since these images are generated dynamically, I won&a ...

Sorting method in Ext JS 6.2.0 using mode

Seeking clarification on the sort([field],[direction],[mode]) method in Ext JS 6.2.0. Can someone explain the distinction between append, prepend, replace, and multi as mentioned in the documentation available at this link? I am unable to find a clear expl ...

The Magnificent jQuery Widget Factory's _trigger Instance

When utilizing the _trigger function to initiate events, I often come across a recurring issue that I struggle to fully comprehend. The problem arises when there are multiple instances of my widget on the same page. In such cases, the most recently instan ...

What is causing this code to break when using ajax's `data` parameter?

I'm relatively new to JavaScript, and I've been working on some code that seems to be properly formatted. However, whenever I add the data elements, it breaks the code. I've checked the jQuery documentation and as far as I can tell, I'm ...

Can you please enlighten me on how to obtain the HTML for the selected area of the cursor in Tiptap?

I've successfully created a customized text editing tool using tiptap/react. My question is, how can I retrieve the html or json of a selected area when I highlight text with the cursor? For instance, if I have a custom tag 'say-as' within ...

Querying MongoDB with a JavaScript file for formatting datetime values

I am utilizing mongodb3.0.5 and my database collection appears as follows: { "_id" : "xxxxxxxxxxxxxxx", "SchoolId" : 1, "ActivationTimestamp" : ISODate("2015-09-22T13:01:58.000Z"), "PersonDetails" : [ { "Name" : "John" ...

Inconsistent CSS3 transitions behavior in Firefox 4

I have been playing around with some css3 transitions and created a slider test. It works perfectly in webkit browsers, but I have noticed an issue in Firefox 4. When clicking on the left link for the first time, the slider is supposed to slide to the left ...

The Safari browser is unable to provide the country name in the geolocation response

My geolocation feature for displaying country names is functional in Chrome and Firefox, but not in Safari. How can I troubleshoot this issue? Javascript: $.get("http://freegeoip.net/json/", function (response) { $("#ip").html("IP: " + response.ip); ...

Is there a way to update an angular.js service object without using extend or copy?

I am working with 2 services and need to update a variable in the first service from the second service. Within a controller, I am assigning a scope variable to the getter of the first service. The issue I am facing is that the view connected to the cont ...

The result of Document.getElementById can show as "undefined" despite the presence of the element

Currently, I am tackling a project that involves extracting information from a website. I have opted to use the 'puppeteer' library in Node.Js for this task. However, I am encountering an issue where Document.getElementById is returning "undefine ...

Adjusting the dimensions of a rectangle using jQuery: A step-by-step guide

I am encountering an issue while attempting to adjust the width and height of a rectangle using jQuery. The error message I receive is "Uncaught TypeError: Cannot read property 'scrollWidth' of null" Below you can find the code snippet in questi ...

JavaScript counter to monitor the number of requests made to the Open Weather Map API

Currently, I am utilizing the Open Weather Map's free API which allows me to make 1000 API calls per day through their One Call API. However, there is no built-in feature for tracking these calls in the Open Weather Map platform. To address this issue ...