question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not use Front Door URL for blob storage account in BlobServiceClient for React App

See original GitHub issue
  • Package Name: @azure/storage-blob
  • Package Version: 12.2.0-preview.1
  • Operating system:
  • nodejs
    • version:
  • browser
    • name/version: Google Chrome/Version 84.0.4147.105 (Official Build) (64-bit)
  • typescript
    • version: 3.9.6
  • Is the bug related to documentation in

Describe the bug We have an Azure Blob Storage Account running behind Azure Front Door to provide custom URL & improve traffic performance. The react app ( scaffold from CRA), uses the @azure/storage-blob for upload, download, list & delete operations using SASToken. The App runs fine when running with Blob URL example - https://example.blob.core.windows.net appended with SASToken. However when it is replaced with Front Door custom URL, BlobServiceClient fails with error :

Error: Unable to extract accountName with provided information.
    at getAccountNameFromUrl (utils.common.ts:556)
    at BlobServiceClient.StorageClient (StorageClient.ts:79)
    at new BlobServiceClient (BlobServiceClient.ts:444)
    at BlobStorageService.init (BlobStorageService.ts:35)

To Reproduce Steps to reproduce the behavior:

  1. Create a Front Door entry for Blob Storage Account URL.
  2. Try to create BlobServiceClient as
const customFrontDoorURL = 'https://files.xyz.com';
const blobServiceClient = new BlobServiceClient(`${customFrontDoorURL}/${SASToken}`);

Expected behavior A valid service client is created.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jiacfancommented, Sep 9, 2020

Hi, @pritesha

Custom domain support has been released with @azure/storage-blob 12.2.0, welcome to have a try.

Thanks, Jiachen

1reaction
jeremymengcommented, Aug 11, 2020

My proposal here is to remove the accountName parsing error in both places considering accountName is not essential for all scenarios. and we can leave accountName as empty (or undefined with breaking change to make the variable nullable) if it’s e.g. in custom domain scenario, @jeremymeng @XiaoningLiu what’s your ideas?

Sorry I misread this part and thought about removing accountName. Yes I like this approach: removing validation of accountName and leave it empty in the case where it is not available.

By the time this bug is fixed & released, is there any workaround ?

@pritesha other than patching our code manually I don’t know an easy workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BlockBlobClient class - Microsoft Learn
Creates an instance of BlockBlobClient. This method accepts an encoded URL or non-encoded URL pointing to a block blob. Encoded URL string will...
Read more >
Connecting to Azure blob storage from React using Azure ...
This is essentially telling Azure AD "hey, here's an app, at a specific set of URLs, that needs permissions to do things -...
Read more >
Hosting a React JS single page application on Azure Blob ...
Lets see how we can fix this using Azure CDN and URL rewrite rules engine to find URLs that are not for files,...
Read more >
Upload files from (Fast)API to Azure Blob Storage
When I use the method which the file passed to API is file: bytes= File() , the file type seems able to upload...
Read more >
@azure/storage-blob - npm
Microsoft Azure Storage SDK for JavaScript - Blob. Latest version: 12.12.0, last published: 2 months ago. Start using @azure/storage-blob in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found