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.

BlobsTranscriptStore blobkey not persisting '/' for virtual directory

See original GitHub issue

Versions

What package version of the SDK are you using. 4.15.0 What nodejs version are you using 14

Describe the bug

Trying to use the blobsTranscriptStore to record transcript. From the code, expecting the blob created for activity in Azure Storage to follow the pattern of container/{channelId]/{conversationId}/{Timestamp.ticks}-{activity.id}.json

https://github.com/microsoft/botbuilder-js/blob/64926f42264863ee5d3519522013e238aa295b3c/libraries/botbuilder-azure-blobs/src/blobsTranscriptStore.ts#L61-L69

But instead the blog key ended up with the ‘/’ also URIencoded so the blob name in Azure blob ended up to be container%2F{channelId}%2F{conversationId}%2F{Timestamp.ticks}-{activid.id}.json. Which makes it not compatible with the virtual directory feature of the Azure Blob with the actual character ‘/’ in the key.

It looks like it is because the way sanitizeBlobKey is implemented, which also sanitized the ‘/’ character.

https://github.com/microsoft/botbuilder-js/blob/a7000885acca69f52a0c7f301a44835f3f8f100e/libraries/botbuilder-azure-blobs/src/sanitizeBlobKey.ts#L4-L18

To Reproduce

Steps to reproduce the behavior in a adaptive dialog bot with bot composer.

  1. Configure ‘appsettings.json’
    1. set ‘runtimeSettings::features::traceTranscript’ to ‘true’
    2. set ‘runtimeSettings::features::blobTranscript’ with ‘connectionString’ and ‘containerName’
  2. Interact with the bot
  3. Check the transcript created in Azure blob container

Expected behavior

The blob created to have a key with actual ‘/’ in the name rather than sanitized with %2F

Screenshots

Blob key with %2F generated. Expect to be real ‘/’ such that it becomes “virtual directory” in storage explorer.

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Sprinklecommented, Apr 14, 2022

@ramfattah yes it does, the escape function seems to do something similar. This blobsStorage is used by the bot state storage.

https://github.com/microsoft/botbuilder-js/blob/98b1499456b28662f9b7d7c37ee6c0841f87fde5/libraries/botbuilder-azure/src/blobStorage.ts#L317

Same issue as the transcripts. When using BlobsStorage for bot state, the blob don’t have / in the key.

image

0reactions
ramfattahcommented, Apr 15, 2022

@Sprinkle,

Sure, that would be great, feel free to mention me in that new issue and I’ll try to assign it to myself and track it.

Thank you so much for your contribution to Bot Framework.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Blobs : StartCopyAsync fails if virtual directory path ...
I am using following code to copy a blob from one Storage Account to another. CloudBlockBlob destBlob = destContainer.GetBlockBlobReference( ...
Read more >
List blobs with .NET - Azure Storage - Microsoft Learn
In a flat listing, blobs are not organized by virtual directory. The following example lists the blobs in the specified container using a ......
Read more >
Error in Azure Web App Virtual Directory: "Could not load file ...
In an Azure Virtual Directory with just index.html and a minimal Web.config throws this error: Could not load file or assembly 'Microsoft.AspNet.
Read more >
Working with Azure Blobs through the .NET SDK
Think of a container as your root virtual directory (C:\MyDirectory) in the cloud. You can create one in only a few lines: using...
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