Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Doesn't work with cross-platform Azure CLI #126

Closed
liamdawson opened this issue Dec 13, 2017 · 3 comments
Closed

Doesn't work with cross-platform Azure CLI #126

liamdawson opened this issue Dec 13, 2017 · 3 comments

Comments

@liamdawson
Copy link
Contributor

liamdawson commented Dec 13, 2017

Tried:

az storage container create --name testcontainer --connection-string 'BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;'

Outcome:

az storage container create: error: 'AccountName'

Version: 1.8.0 (Docker)

Azure CLI version:

± az --version
azure-cli (2.0.19)

acr (2.0.13)
acs (2.0.17)
appservice (0.1.18)
backup (1.0.1)
batch (3.1.5)
batchai (0.1.1)
billing (0.1.5)
cdn (0.0.9)
cloud (2.0.8)
cognitiveservices (0.1.8)
command-modules-nspkg (2.0.1)
component (2.0.7)
configure (2.0.11)
consumption (0.1.5)
container (0.1.11)
core (2.0.18)
cosmosdb (0.1.13)
dla (0.0.12)
dls (0.0.15)
eventgrid (0.1.4)
extension (0.0.4)
feedback (2.0.6)
find (0.2.7)
interactive (0.3.10)
iot (0.1.12)
keyvault (2.0.12)
lab (0.0.11)
monitor (0.0.10)
network (2.0.16)
nspkg (3.0.1)
profile (2.0.14)
rdbms (0.0.7)
redis (0.2.9)
resource (2.0.16)
role (2.0.13)
servicefabric (0.0.4)
sql (2.0.13)
storage (2.0.17)
vm (2.0.16)
@liamdawson
Copy link
Contributor Author

liamdawson commented Dec 13, 2017

Now I'm receiving a Cannot read property 'query' of undefined error with a new connection string:

az storage container create --name 'test' --public-access off --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/' --debug

Command fails with "Not Implemented" on 1.6.1, and the Cannot read property 'query' of undefined on all versions after that point. According to the az-cli debug output, the exchange is:

azure.multiapi.storage.v2017_04_17.common.storageclient : Client-Request-ID=2069dede-dfd1-11e7-8069-784f435c27d1 Outgoing request: Method=PUT, Path=/wat, Query={'restype': 'container', 'timeout': None}, Headers={'x-ms-version': '2017-04-17', 'x-ms-client-request-id': '20044a4a-dfd1-11e7-a8b8-784f435c27d1', 'x-ms-blob-public-access': None, 'User-Agent': 'Azure-Storage/0.37.0-0.36.0 (Python CPython 2.7.13; Darwin 17.2.0) AZURECLI/2.0.18', 'Authorization': u'SharedKey devstoreaccount1:y+/Y0Q5Wz5EAvMBHmys9crePse7Ojn10zf+CwWdkH1s=', 'x-ms-date': 'Wed, 13 Dec 2017 06:44:54 GMT'}.
urllib3.connectionpool : Starting new HTTP connection (1): 127.0.0.1
urllib3.connectionpool : http://127.0.0.1:10000 "PUT /wat?restype=container HTTP/1.1" 500 41
azure.multiapi.storage.v2017_04_17.common.storageclient : Client-Request-ID=2069dede-dfd1-11e7-8069-784f435c27d1 Receiving Response: Server-Timestamp=Wed, 13 Dec 2017 06:45:09 GMT, HTTP Status Code=500, Message=Internal Server Error, Headers={'x-ms-version': '2017-04-17', 'x-ms-client-request-id': '20044a4a-dfd1-11e7-a8b8-784f435c27d1', 'x-ms-blob-public-access': None, 'User-Agent': 'Azure-Storage/0.37.0-0.36.0 (Python CPython 2.7.13; Darwin 17.2.0) AZURECLI/2.0.18', 'Authorization': u'SharedKey devstoreaccount1:y+/Y0Q5Wz5EAvMBHmys9crePse7Ojn10zf+CwWdkH1s=', 'x-ms-date': 'Wed, 13 Dec 2017 06:44:54 GMT'}.
azure.multiapi.storage.v2017_04_17.common.storageclient : Client-Request-ID=2069dede-dfd1-11e7-8069-784f435c27d1 Operation failed: checking if the operation should be retried. Current retry count=0, Server-Timestamp=Wed, 13 Dec 2017 06:45:09 GMT, HTTP status code=500, Exception=Internal Server ErrorCannot read property 'query' of undefined.

@liamdawson
Copy link
Contributor Author

After checking the routing, I found that I needed to add devstoreaccount1 back to the blob endpoint. Final, working connection string:

DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;

@arafato
Copy link
Owner

arafato commented Dec 15, 2017

thanks a lot @liamdawson really great work! Just merged your PR. I deleted the tmp folder from the repository since Azurite automatically creates the folder if it does not exist. So there is no need to keep it in the repo IMO. This makes it more convenient to run the clean script (npm run clean) which simply deletes the entire folder (which I renamed to azurite-workspace). This folder is also automatically created if you run Azurite without any location parameter (npm start).

@arafato arafato closed this as completed Dec 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants