I'm trying to deploy a simple static website to an storage account with static website enabled on the $web container following this: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website?view=azure-dotnet
But when I execute az storage blob upload-batch -s <SOURCE_PATH> -d \$web --account-name <ACCOUNT_NAME> I get the following:
uploading <SOURCE_PATH>\10.async.js
The requested URI does not represent any resource on the server. ErrorCode: InvalidUri
<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidUri</Code><Message>The requested URI does not represent any resource on the server.
RequestId:f27d5c44-501e-004e-4650-af6386000000
Time:2019-01-18T17:08:39.0417306Z</Message><UriPath>https://xxxxxxxxxx.blob.core.windows.net///10.async.js</UriPath></Error>
Traceback (most recent call last):
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\knack\knack\cli.py", line 206, in invoke
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-core\azure\cli\core\commands\__init__.py", line 328, in execute
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-core\azure\cli\core\commands\__init__.py", line 386, in _run_jobs_serially
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-core\azure\cli\core\commands\__init__.py", line 377, in _run_job
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-storage\azure\cli\command_modules\storage\__init__.py", line 237, in new_handler
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-storage\azure\cli\command_modules\storage\__init__.py", line 180, in handler
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-core\azure\cli\core\commands\__init__.py", line 356, in _run_job
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-core\azure\cli\core\commands\__init__.py", line 171, in __call__
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-core\azure\cli\core\__init__.py", line 441, in default_command_handler
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-storage\azure\cli\command_modules\storage\operations\blob.py", line 238, in storage_blob_upload_batch
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-storage\azure\cli\command_modules\storage\util.py", line 218, in wrapper
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-storage\azure\cli\command_modules\storage\operations\blob.py", line 224, in _upload_blob
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-storage\azure\cli\command_modules\storage\operations\blob.py", line 325, in upload_blob
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-cli-storage\azure\cli\command_modules\storage\operations\blob.py", line 318, in upload_block_blob
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-multiapi-storage\azure\multiapi\storage\v2018_03_28\blob\blockblobservice.py", line 463, in create_blob_from_path
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-multiapi-storage\azure\multiapi\storage\v2018_03_28\blob\blockblobservice.py", line 582, in create_blob_from_stream
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-multiapi-storage\azure\multiapi\storage\v2018_03_28\blob\blockblobservice.py", line 971, in _put_blob
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-multiapi-storage\azure\multiapi\storage\v2018_03_28\common\storageclient.py", line 381, in _perform_request
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-multiapi-storage\azure\multiapi\storage\v2018_03_28\common\storageclient.py", line 306, in _perform_request
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-multiapi-storage\azure\multiapi\storage\v2018_03_28\common\storageclient.py", line 292, in _perform_request
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-bb1gu7gd\azure-multiapi-storage\azure\multiapi\storage\v2018_03_28\common\_error.py", line 115, in _http_error_handler
azure.common.AzureHttpError: The requested URI does not represent any resource on the server. ErrorCode: InvalidUri
<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidUri</Code><Message>The requested URI does not represent any resource on the server.
RequestId:f27d5c44-501e-004e-4650-af6386000000
Time:2019-01-18T17:08:39.0417306Z</Message><UriPath>https://xxxxxxxx.blob.core.windows.net///10.async.js</UriPath></Error>
I've tried using $web, web, /$web, \$web. Nothing works.
I can deploy without problem to another container. The problem is with the $web one.
Environment summary
Windows 10 x64
azure-cli (2.0.55)
acr (2.1.12)
acs (2.3.14)
advisor (2.0.0)
ams (0.3.2)
appservice (0.2.11)
backup (1.2.1)
batch (3.4.1)
batchai (0.4.6)
billing (0.2.0)
botservice (0.1.4)
cdn (0.2.0)
cloud (2.1.0)
cognitiveservices (0.2.4)
command-modules-nspkg (2.0.2)
configure (2.0.20)
consumption (0.4.2)
container (0.3.11)
core (2.0.55)
cosmosdb (0.2.7)
dla (0.2.3)
dls (0.1.7)
dms (0.1.1)
eventgrid (0.2.0)
eventhubs (0.3.2)
extension (0.2.3)
feedback (2.1.4)
find (0.2.13)
hdinsight (0.2.0)
interactive (0.4.1)
iot (0.3.4)
iotcentral (0.1.5)
keyvault (2.2.9)
lab (0.1.5)
maps (0.3.3)
monitor (0.2.8)
network (2.3.0)
nspkg (3.0.3)
policyinsights (0.1.0)
profile (2.1.2)
rdbms (0.3.5)
redis (0.3.2)
relay (0.1.2)
reservations (0.4.1)
resource (2.1.8)
role (2.3.0)
search (0.1.1)
security (0.1.0)
servicebus (0.3.2)
servicefabric (0.1.11)
signalr (1.0.0)
sql (2.1.7)
storage (2.3.0)
telemetry (1.0.0)
vm (2.2.12)
Extensions:
storage-preview (0.2.1)
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\emiliano.parizzi\.azure\cliextensions'
Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]
Well, I was running in it Powershell and it wasn't working. Had to use CMD.
The fix in powershell for future users is to escape $web with a ` instead of a \.
Powershell: az storage blob upload-batch -s <SOURCE_PATH> -d `$web --account-name <ACCOUNT_NAME>
Bash: az storage blob upload-batch -s <SOURCE_PATH> -d \$web --account-name <ACCOUNT_NAME>
CMD: az storage blob upload-batch -s <SOURCE_PATH> -d $web --account-name <ACCOUNT_NAME>
Most helpful comment
The fix in powershell for future users is to escape
$webwith a`instead of a\.Powershell:
az storage blob upload-batch -s <SOURCE_PATH> -d `$web --account-name <ACCOUNT_NAME>Bash:
az storage blob upload-batch -s <SOURCE_PATH> -d \$web --account-name <ACCOUNT_NAME>CMD:
az storage blob upload-batch -s <SOURCE_PATH> -d $web --account-name <ACCOUNT_NAME>