ERROR: The specifed resource name contains invalid characters. ErrorCode: InvalidResourceName
Asked Answered
A

5

17

ERROR: The specifed resource name contains invalid characters. ErrorCode: InvalidResourceName

2019-10-31T10:28:17.4678189Z <?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidResourceName</Code><Message>The specifed resource name contains invalid characters.

2019-10-31T10:28:17.4678695Z RequestId:

2019-10-31T10:28:17.4679207Z Time:2019-10-31T10:28:17.4598301Z</Message></Error>

I am trying to deploy my static website to blob storage in azure with azure DevOps, but I am getting this error. In my pipeline, I am using grunt build to build, and archive it to zip, then publishing to the azure pipeline, then in the release, I am extracting files, and trying to upload these files with azure CLI task.

I am using following command az storage blob upload-batch --account-name something --account-key something --destination ‘$web’ --source ./

My Container name is $web

Azeotrope answered 31/10, 2019 at 12:0 Comment(4)
provide more informartion and describe your errorCapillarity
probably your blob\container name contain capital letters or dashes or something similar, you are only allowed to use [a-z0-9] in your storage\container\blob namesRussel
I have enabled static web site in an azure storage account, afterward, $web container automatically created in containers. I am only providing '$web' destination in CLI command, I have checked it, I didn't use _ or capitals charactersAzeotrope
I am getting the same error to read Azure File Storage or File Containers from Logic APP. Please let me know if anyone has a solution to that.Gybe
S
36

Permitted characters are lowercase a-z 0-9 and single, infix, hyphens

[a-z0-9\-]

https://learn.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata

Streetman answered 20/10, 2020 at 23:6 Comment(2)
Worth pointing out explicitly it is lower caseManizales
This was so easy, after 3 hours I can't use underscores in filename.Sheeting
M
14

I solved this problem by removing apostrophes around container name: az storage blob upload-batch --account-name something --account-key something --destination $web --source ./

Mordant answered 3/12, 2019 at 13:22 Comment(1)
Thank you! I had the exact same problem, spent 4 hours on this, would probably spend 4 more if it wasn't for this answer :)Suite
I
3

verify container name or coonection string might contain extra/nonallowed symbols... In my case it was having extra spaces in container name

Inexperienced answered 27/6, 2022 at 9:58 Comment(2)
This solved my issue. I had a "_" instead of "-" in the storage container name! Thank you @madhusudhan-v-indianFussy
Thanks for this, in my case I was trying to PUT a blob in a container referenced in all caps while the container name was all in lowercase.Winnipegosis
D
0

This will probably not solve your problem, but it will solve a related problem for other people:

If the aim is to simply download a file from Azure File Storage using a link, after generating a SAS token, as shown here: Azure File Storage URL in browser showing InvalidHeaderValue

If you remove the slash after the name of the file in the generated link, the file will download!

enter image description here

Dagny answered 7/10, 2021 at 15:14 Comment(0)
B
0

I had the same problem and it was caused by an incorrect container name

Biddick answered 30/6, 2023 at 15:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.