问题
I have the following table names in Azure table storage. Table names are generated automatically in my application and then created using table.CreateIfNotExists(tableName). Some work and some don't. When I dig into the error the extended error information tells me that the resource name contains invalid characters - however I am at a loss to work out what is invalid in the failing names - can anyone spot this?
8836461cc98249bea59dc5f6790d40edstk365developmentusers
– the specified resource name contains invalid characters
8836461cc98249bea59dc5f6790d40edstk365developmenttasks
– the specified resource name contains invalid characters
af0589646af645b98f749d92a5b2ee25stk365developmentusers
– works
回答1:
Table names cannot start with a number. So your first example, starting with 8
, isn't valid.
Table names are also limited to 63 characters. You haven't shown how you're generating names, but that could also be a limitation you're running into.
Full rule details are here.
回答2:
I was also getting this error when I was trying to upload a file to my azure blob storage
.
My issue was that the container name I used was stating with a capital letters (Daily
). Once I changed my parameter schedule
value to start with small letter (daily
), I started to receive the actual error, which is The specified container does not exist.
as I had not created the container in my blob
. After I create the container with the name daily
, everything started working as expected.
回答3:
I also ran into this recently. I was using the Azure CLI with Powershell and found that you cannot use variable names with the command. You also have to use quotes around the container name, and they must be lowercase.
So, for example:
$containerName = "gamers"
az storage container create `
--name $containerName `
--connection-string $connectionString
Does not work but:
az storage container create `
--name 'gamers' `
--connection-string $connectionString
Does work as expected. I tried even setting up the variable to have the quotes but no luck. I hope this helps someone in the future.
来源:https://stackoverflow.com/questions/45305556/azure-table-storage-names-invalid-characters