Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing blob container with "$" (dollar sign) in name (i.e., $web) #223

Closed
joegasper opened this issue May 28, 2018 · 32 comments
Closed
Labels
⚙️ static websites Related to static websites
Milestone

Comments

@joegasper
Copy link

Storage Explorer Version: 1.1.0
Platform: Windows
Architecture: ia32
Build Number: 20180507.1
Commit: bcc8990d
Regression From: N/A

Steps to Reproduce:

  1. Create GPV2 storage account in West Central US.
  2. Enable private preview of Azure Static Websites
  3. Configure Static Website for the storage account - this creates a blob container named "$web"
    (https://myblobstore.blob.core.windows.net/$web/)
    "An Azure Storage container has been created to host your static website.
    $web"
  4. In Azure Storage Explorer, drill into the storage account, Blob Containers.

Expected Experience:

I should see a list of containers.

Actual Experience:

Blob Containers just shows "Loading..."
I'm not able to see the $web container or any other containers.

I tried using Azcopy 7.1.0, also, and it fails with "Invalid location" for the destination.

I can upload a file via the Azure Portal's Storage Explorer.
So, hello world https://ufifstatic01.z4.web.core.windows.net/

Thanks.

@joegasper
Copy link
Author

PS D:> Get-AzureStorageContainer -Context $ctx

Blob End Point: https://ufifstatic01.blob.core.windows.net/

Name    PublicAccess LastModified
----    ------------ ------------
$web    Off          2018-05-28 17:13:57Z
tempweb Off          2018-05-28 21:51:37Z

PS D:> Get-AzureStorageContainer -Context $ctx -Name '$web'
Get-AzureStorageContainer : Container name '$web' is invalid. Valid names start and end with a lower case letter or a number and has in between a lower case letter, number or dash with no consecutive dashes and is 3 through 63 characters long.

@craxal craxal added the ⚙️ static websites Related to static websites label May 29, 2018
@craxal
Copy link
Contributor

craxal commented May 29, 2018

According to the Azure documentation, blob containers can't have a $ character in their name.

However, we're working on adding support for Static Websites. Stay tuned!

@MRayermannMSFT, do you have any details on this?

@MRayermannMSFT
Copy link
Member

MRayermannMSFT commented May 29, 2018

Yes I do! So we're waiting on the NodeJS Client library to ship a version which supports $web containers. If you look at this file in their library, you can see an example of the type of validation they do regarding $ containers. It looks like they've already checked in support and shipped a preview version though, so it hopefully won't be long until they go public, at which point we'll feel comfortable consuming the bits.

In the meantime, if you'd like to do so, you can patch their JS to enable support now! Simply look for that file in the Storage Explorer install directory, and add $web to any of the regex's where $root also appears. Let me know if you need help with that. 😄

@joegasper
Copy link
Author

joegasper commented May 29, 2018

Thanks, I updated this file as suggested and all is working - I can see all containers and can upload to the $web container.

C:\Program Files (x86)\Microsoft Azure Storage Explorer\resources\app\node_modules\azure-storage\lib\common\util\validate.js

Thank you.

@MRayermannMSFT
Copy link
Member

Sweet, glad to know it worked! We'll update/close this issue once we update the library and ship it.

@yoadsn
Copy link

yoadsn commented May 30, 2018

FWIW

206c206
<   if (!nameError || containerName.match(/^(\$root|\$logs)$/)) {
---
>   if (!nameError || containerName.match(/^(\$root|\$logs|\$web)$/)) {

@onpaws
Copy link

onpaws commented Jun 29, 2018

FYI, this issue was created to track AzCopy support for $web

@MRayermannMSFT MRayermannMSFT added this to the 1.3.0 milestone Jun 29, 2018
@MRayermannMSFT
Copy link
Member

Quick update. The NodeJS library has shipped a non-preview version that supports $web. We've integrated it and will be shipping it in our next update. Thank you everyone for your patience!

@onpaws
Copy link

onpaws commented Jun 29, 2018

Thanks for letting us know @MRayermannMSFT, sounds good!

@noelstieglitz
Copy link

noelstieglitz commented Jun 30, 2018

This also occurs for uploading via powershell:

Set-AzureStorageBlobContent -File "D:\_TestImages\Image001.jpg" `
  -Container $containerName `
  -Blob "Image001.jpg" `
  -Context $ctx 

# upload another file
Set-AzureStorageBlobContent -File "D:\_TestImages\Image002.png" `
  -Container $containerName `
  -Blob "Image002.png" `
  -Context $ctx```

Let me know if you'd like me to open a separate issue. 

@onpaws
Copy link

onpaws commented Jul 2, 2018

Can I ask a question here, no disrespect intended but seeing as I'm not the only person to lose time on this...
Why are we validating container names against a hard-coded whitelist in the first place?

It seems like a missed opportunity MS teams across different parts of the org didn't catch this in advance and subsequently multiple customers were negatively impacted.
There's a lesson here involving Conway's law...don't mean to be presumptuous but I'd suggest the MS devs on this thread would be well served by zooming out and looking at how this happened.

Introducing some form of cross org integration testing seems like a good idea here.

No offense intended just one guy's opinion

@jinglouMSFT
Copy link

Thank you for the feedback. We are aware of the timing issue. Definitely will learn from this experiences in the future. The choices for Storage Explorer was to release a GA product (Storage Explorer) with a preview back-end library at the same time the static website services became available or to release a GA product with a GA back-end library few days later for quality purpose. We decided to go with the GA library. We are aiming to release a version of Storage Explorer with the static website support this week. Thanks for being patient with us. If you are blocked with uploading/downloading, please consider using the Storage extension for VS Code (preview) as a workaround. Thanks again for the feedback.

@predssj4
Copy link

predssj4 commented Jul 3, 2018

@jinglouMSFT we are waiting :). Thank you for fix.

Regards.

@MRayermannMSFT
Copy link
Member

Now that 1.3.0 has shipped, I'm going to close this issue.

@praneetloke
Copy link

@noelstieglitz did you open an issue for the Azure RM powershell cmdlet issue by any chance? I am running into that issue now.

@noelstieglitz
Copy link

@praneetloke - no, I did not.

@aavdberg
Copy link

Have the same problem in DevOps pipeline with AzureBlobCopy command.

##[error]Upload to container: '$web' in storage account: 'blob' with blob prefix: '' failed with error: 'Azure Storage container names can only contain lowercase alpha-numeric characters or hyphens

@veereshrev
Copy link

Hi, have any one found the solution to address this in Powershell. I still see the issue when accessing the container $Web.
image

@simonua
Copy link

simonua commented Jan 3, 2019

@veereshrev, this is not a general solution but a specifically-coded work-around for static websites that worked for me was to escape it in the PS script (as part of a custom task). There's context missing here (I can't paste all of the task), but the gist of it is that you do a hard-coded replacement in your destination by escaping it.

#Blob Storage Static Websites uses a $web container but the dollar sign indicates a variable in PowerShell. Just using $web would attempt to evaluate a value, which does not exist.
#There are a number of ways to fix this, but this hack may just be the simplest, albeit the most specific.
$web = "`$web"

@davidobrien1985
Copy link

You can also just put '$web' in single quotes, in which case PowerShell will treat it as a literal string, not a variable.

@interthingy
Copy link

This is still an issue when running scripts in deployment pipelines however when running locally I dont get the error and the scripts work fine.

I'm just running Set-AzureStorageBlobContent in an Azure Powershell container in a deployment pipeline and wacko it complains about the $web.

Does anyone have a fix for this?

@green3g
Copy link

green3g commented Mar 4, 2019

@interthingy No fix so far, I'm also running into this.

@craxal
Copy link
Contributor

craxal commented Mar 7, 2019

Reopening due to user reports. @v-xuanzh, can you folks verify this in your testing?

@craxal craxal reopened this Mar 7, 2019
@craxal craxal modified the milestones: 1.3.0, 1.8.0 Mar 7, 2019
@craxal craxal added this to Committed in Storage Explorer via automation Mar 7, 2019
@craxal craxal moved this from Committed to Investigating in Storage Explorer Mar 7, 2019
@MRayermannMSFT
Copy link
Member

Closing due to the recent comments being about products other than Storage Explorer.

If you're having issues with the Azure CLI you can find their repo here: https://github.com/Azure/azure-cli

Unfortunatley I'm not sure the right place to send y'all for giving feedback on Azure DevOps. ☹️ I'll keep looking around, but if one of y'all ends up finding a good spot, feel free to leave a comment and let the rest of us know!

Storage Explorer automation moved this from Investigating to Done Mar 8, 2019
@johnjbateman
Copy link

I don't think this is solved. I cannot do this:

Get-AzureStorageBlob -Container '$web'

Error is:

2019-08-22T13:43:12.3747323Z Get-AzureStorageBlob : Container name '$web' is invalid. Valid names start and end with a lower case letter or a 
2019-08-22T13:43:12.3748036Z number and has in between a lower case letter, number or dash with no consecutive dashes and is 3 through 63 
2019-08-22T13:43:12.3748387Z characters long.
2019-08-22T13:43:12.3748630Z At D:\a\_temp\980fef1b-4d2d-4bdf-ab32-98a09eb25889.ps1:10 char:10
2019-08-22T13:43:12.3748838Z + $Blobs = Get-AzureStorageBlob -Context $Context -Container $Container ...
2019-08-22T13:43:12.3749155Z +          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-08-22T13:43:12.3749335Z     + CategoryInfo          : InvalidArgument: (:) [Get-AzureStorageBlob], ArgumentException
2019-08-22T13:43:12.3749538Z     + FullyQualifiedErrorId : ArgumentException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlo 
2019-08-22T13:43:12.3749715Z    bCommand

@craxal
Copy link
Contributor

craxal commented Aug 22, 2019

@johnjbateman Looks like you're using Azure PowerShell. This page is for Storage Explorer errors, and we don't use PowerShell in any way.

@dannomayer
Copy link

where should this issue be opened? I am running into the same problem. I am trying to delete the contents of the $web container from DevOps release pipe upon releasing a new version of an application

I don't think this is solved. I cannot do this:

Get-AzureStorageBlob -Container '$web'

Error is:

2019-08-22T13:43:12.3747323Z Get-AzureStorageBlob : Container name '$web' is invalid. Valid names start and end with a lower case letter or a 
2019-08-22T13:43:12.3748036Z number and has in between a lower case letter, number or dash with no consecutive dashes and is 3 through 63 
2019-08-22T13:43:12.3748387Z characters long.
2019-08-22T13:43:12.3748630Z At D:\a\_temp\980fef1b-4d2d-4bdf-ab32-98a09eb25889.ps1:10 char:10
2019-08-22T13:43:12.3748838Z + $Blobs = Get-AzureStorageBlob -Context $Context -Container $Container ...
2019-08-22T13:43:12.3749155Z +          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-08-22T13:43:12.3749335Z     + CategoryInfo          : InvalidArgument: (:) [Get-AzureStorageBlob], ArgumentException
2019-08-22T13:43:12.3749538Z     + FullyQualifiedErrorId : ArgumentException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageBlo 
2019-08-22T13:43:12.3749715Z    bCommand

@johnjbateman
Copy link

I would appreciate the help too. This article had pretty early replies from @joegasper regarding Azure Powershell.

@craxal
Copy link
Contributor

craxal commented Aug 23, 2019

@johnjbateman I think you want https://github.com/Azure/azure-powershell.

@johnjbateman
Copy link

@dannomayer I created issue 9897 on the Azure Powershell GitHub.

@christcottrell
Copy link

typical Microsoft though here.. Oh, this is specifically for storage explorer.. Never mind the transparency. I am seeing the issue trying to load a static web page in ADO tasks.. And this has been around for how long and not corrected? This is ridiculous.. Every day I hate Microsoft more and more with their unreliable garbage.

@jinglouMSFT
Copy link

@christcottrell This repo is for Storage Explorer. The folks on the Azure Powershell or Azure CLI teams don't monitor this repo. If you have issues on those products, I'd recommend you report issues in their repo's to get a quick reply. We've listed the link to the Azure Powershell repo above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ static websites Related to static websites
Projects
Development

No branches or pull requests