简体   繁体   中英

Azure file share credentials for Docker

I'm trying to use File Share to mount a volume in a docker container.

I'm trying to get the following variables, as mention in the official documentation:

https://docs.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files

--azure-file-volume-account-name mldatafileshare \\ --azure-file-volume-account-key XXXXXX \\ --azure-file-volume-share-name datamlfileshare \\

I'm the deploying the container with the following CLI code:

/home/luis/bin/az container create \
    --resource-group mlcontainers2 \
    --name automl3 \
    --image mlcontainers2.azurecr.io/samples/modeldiagnostics \
    --registry-login-server mlcontainers2.azurecr.io \
    --registry-password EeFxSRT2ghUNzlD2ny=iuGwVHEqy4aFZ   \
    --registry-username mlcontainers2 \
    --ports 80 5000 5100 \
    --azure-file-volume-account-name mldatafileshare \
    --azure-file-volume-account-key  XXXXXX \
    --azure-file-volume-share-name datamlfileshare \
    --azure-file-volume-mount-path /app/data_automl \
    --memory 3 \
    --ip-address public 

It's created sucessfully, with when I make a call to the API (the container is running a flask app) I get this error:

2019-09-18 19:39:20 wk-caas-42de550704fc4996be1b9660860edcd1-39ad43ac741df9f9f1c698 werkzeug[8] INFO 10.240.255.56 - - [18/Sep/2019 19:39:20] "POST /api/AutoML HTTP/1.1" 404 -

I have tried without mounting the volume and I get the exact same error, hence I think the issue is that the container is not accessing the File Share unit.

I'm taking the values for the unit "--azure-file-volume-account-name, --azure-file-volume-account-key and --azure-file-volume-share-name " from the following places:

azure-file-volume-account-name: mldatafileshare

在此处输入图片说明

azure-file-volume-share-name: XXXX I'm taking that one from the same page:

在此处输入图片说明

And last one, azure-file-volume-share-name: datamlfileshare :

在此处输入图片说明

Is the file I created inside the account, mldatafileshare.

EDIT:

Also, when I try to access the account on the browser I get this error:

在此处输入图片说明

According to the message that you provided, I must explain something to you. First, you cannot access the Azure File Share through the browser just via its URL when the Azure File Share is managed by Azure.

Second, when you use the storage account name and the storage account key to mount the file share to the Azure container instance volume as the persistent storage, you can access the file share with the admin permission.

Here is the example, you can follow the steps in Mount an Azure file share in Azure Container Instances . After the mount is finished, you can see the file share like below:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM