Hi Daniel Chang,
Welcome to Microsoft Q&A forum,
ErrorCode:InvalidResourceName" is thrown by Azure Blob Storage when the destination container name or blob name includes characters that violate naming rules.
You're targeting the $web container, which is a special container used for static website hosting.
-
$webmust be exactly spelled as$web(case-sensitive). - It must be quoted properly in CLI to avoid shell interpretation issues
Shell Interpretation Issue
If the $web string is not properly quoted, the shell might interpret it as a variable.
Try using below
--destination '\$web'
Check File Names: Ensure that none of the files in your .out directory has invalid characters in its name. Azure Blob Storage has specific rules for naming containers and blobs, including restrictions on special characters.
If the .out folder contains files with invalid blob names (e.g., names with backslashes, colons, or control characters), the upload will fail.
Run a check on the filenames:
ls .out | grep '[^a-zA-Z0-9._-]'
Account and Container Names: Confirm that the account name (compassstgstatic) and destination container name ($web) are correct and properly formatted.
CLI Version: Make sure you're using the latest version of the Azure CLI, as older versions might have bugs or compatibility issues. You can update it with the command:
az upgrade
Try quoting $web properly:
az storage blob upload-batch --destination "$web" --source .out --account-name compassstgstatic --auth-mode key --overwrite
Deployment Token: Check if your team member has the correct permissions and deployment token set for uploading to the Blob. Since another account can deploy successfully with the same script, ensure there's no misconfiguration in roles or permissions.
Hope you find this comment helpful ,if yes, please “up-vote” for the information provided , this can be beneficial to community members.
Kindly let us know if you have any additional questions.
Thanks