Changing ownership of files on azure file share mounted on ACI












0















I have a ACI container instance with a mounted file share according to the standard ACI instructions. I must edit the ownership of files mounted in the directory where the file share is mounted. Right now only root owns the files.
Very similar issue to this but i am looking for a workable solution.
https://github.com/Azure/azurefile-dockervolumedriver/issues/65



EDIT: Here are the steps to follow to reproduce



go to shell.azure.com
Instantiate these variables on the command line (bash) shell:



ACI_PERS_RESOURCE_GROUP=cartoetestgroup
ACI_PERS_STORAGE_ACCOUNT_NAME=cartoteststor$RANDOM
ACI_PERS_LOCATION=yourlocation (e.g. eastus)
ACI_PERS_SHARE_NAME=cartomysharename


Now create the storage account if you haven't already



az storage account create 
--resource-group $ACI_PERS_RESOURCE_GROUP
--name $ACI_PERS_STORAGE_ACCOUNT_NAME
--location $ACI_PERS_LOCATION
--sku Standard_LRS


*I can't remember why I used standard LRS.



Export the connection string as an environment variable



export AZURE_STORAGE_CONNECTION_STRING=`az storage account show-connection-    string --resource-group $ACI_PERS_RESOURCE_GROUP --name
$ACI_PERS_STORAGE_ACCOUNT_NAME --output tsv`


Create the file share



az storage share create -n $ACI_PERS_SHARE_NAME



Confirm the name of the storage account



STORAGE_ACCOUNT=$(az storage account list --resource-group
$ACI_PERS_RESOURCE_GROUP --query "[?contains(name,'$ACI_PERS_STORAGE_ACCOUNT_NAME')].[name]" --output tsv)
echo $STORAGE_ACCOUNT


Confirm the storage key



STORAGE_KEY=$(az storage account keys list --resource-group
$ACI_PERS_RESOURCE_GROUP --account-name $STORAGE_ACCOUNT --query "[0].value" --output tsv)
echo $STORAGE_KEY


I recommend you write down the variables values for next time.



If you are using an existing file share, then create and populate the variables:



STORAGE_ACCOUNT=cartoteststor123345 
STORAGE_KEY=yourstoragekey


(e.g. 243phasldjgknw083hroawuiefh09u3urf0when or something like that)



Finally, create the container...



az container create 
--resource-group $ACI_PERS_RESOURCE_GROUP
--name tharbemycartodb
--image sverhoeven/cartodb
--dns-name-label giveme_a_name_cartodemo
--ports 80
--azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME
--azure-file-volume-account-key $STORAGE_KEY
--azure-file-volume-share-name $ACI_PERS_SHARE_NAME
--azure-file-volume-mount-path /var/lib/tmpstor
--cpu 2 --memory 2
--dns-name-label whateverIwantToBeAccessedBy
--ip-address public
--environment-variables CARTO_HOSTNAME=whateverIwantToBeAccessedBy.mylocation


(e.g. eastus).azurecontainer.io



After the whole thing boots and populates (so the site is up and accessible), login to the container from the shell



az container exec --resource-group cartoetestgroup --name tharbemycartodb --exec-command "/bin/bash" 


Once inside the container, copy the contents to the file share



cp -a /var/lib/postgresql/. /var/lib/tmpstor/


(Maybe try to own the folder before populating it??)



Then you can kill the container when the copy is complete.



If you follow the above steps but using your existing credentials



ACI_PERS_RESOURCE_GROUP
ACI_PERS_STORAGE_ACCOUNT_NAME
ACI_PERS_LOCATION
ACI_PERS_SHARE_NAME
STORAGE_ACCOUNT
STORAGE_KEY


then you can essentially duplicate the above except for the mount location. It should work, except it doesn't because user 103 doesn't own the folder containing the database



az container create


--azure-file-volume-mount-path /var/lib/postgresql


You will see error messages when reviewing the log



This is where my question started










share|improve this question





























    0















    I have a ACI container instance with a mounted file share according to the standard ACI instructions. I must edit the ownership of files mounted in the directory where the file share is mounted. Right now only root owns the files.
    Very similar issue to this but i am looking for a workable solution.
    https://github.com/Azure/azurefile-dockervolumedriver/issues/65



    EDIT: Here are the steps to follow to reproduce



    go to shell.azure.com
    Instantiate these variables on the command line (bash) shell:



    ACI_PERS_RESOURCE_GROUP=cartoetestgroup
    ACI_PERS_STORAGE_ACCOUNT_NAME=cartoteststor$RANDOM
    ACI_PERS_LOCATION=yourlocation (e.g. eastus)
    ACI_PERS_SHARE_NAME=cartomysharename


    Now create the storage account if you haven't already



    az storage account create 
    --resource-group $ACI_PERS_RESOURCE_GROUP
    --name $ACI_PERS_STORAGE_ACCOUNT_NAME
    --location $ACI_PERS_LOCATION
    --sku Standard_LRS


    *I can't remember why I used standard LRS.



    Export the connection string as an environment variable



    export AZURE_STORAGE_CONNECTION_STRING=`az storage account show-connection-    string --resource-group $ACI_PERS_RESOURCE_GROUP --name
    $ACI_PERS_STORAGE_ACCOUNT_NAME --output tsv`


    Create the file share



    az storage share create -n $ACI_PERS_SHARE_NAME



    Confirm the name of the storage account



    STORAGE_ACCOUNT=$(az storage account list --resource-group
    $ACI_PERS_RESOURCE_GROUP --query "[?contains(name,'$ACI_PERS_STORAGE_ACCOUNT_NAME')].[name]" --output tsv)
    echo $STORAGE_ACCOUNT


    Confirm the storage key



    STORAGE_KEY=$(az storage account keys list --resource-group
    $ACI_PERS_RESOURCE_GROUP --account-name $STORAGE_ACCOUNT --query "[0].value" --output tsv)
    echo $STORAGE_KEY


    I recommend you write down the variables values for next time.



    If you are using an existing file share, then create and populate the variables:



    STORAGE_ACCOUNT=cartoteststor123345 
    STORAGE_KEY=yourstoragekey


    (e.g. 243phasldjgknw083hroawuiefh09u3urf0when or something like that)



    Finally, create the container...



    az container create 
    --resource-group $ACI_PERS_RESOURCE_GROUP
    --name tharbemycartodb
    --image sverhoeven/cartodb
    --dns-name-label giveme_a_name_cartodemo
    --ports 80
    --azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME
    --azure-file-volume-account-key $STORAGE_KEY
    --azure-file-volume-share-name $ACI_PERS_SHARE_NAME
    --azure-file-volume-mount-path /var/lib/tmpstor
    --cpu 2 --memory 2
    --dns-name-label whateverIwantToBeAccessedBy
    --ip-address public
    --environment-variables CARTO_HOSTNAME=whateverIwantToBeAccessedBy.mylocation


    (e.g. eastus).azurecontainer.io



    After the whole thing boots and populates (so the site is up and accessible), login to the container from the shell



    az container exec --resource-group cartoetestgroup --name tharbemycartodb --exec-command "/bin/bash" 


    Once inside the container, copy the contents to the file share



    cp -a /var/lib/postgresql/. /var/lib/tmpstor/


    (Maybe try to own the folder before populating it??)



    Then you can kill the container when the copy is complete.



    If you follow the above steps but using your existing credentials



    ACI_PERS_RESOURCE_GROUP
    ACI_PERS_STORAGE_ACCOUNT_NAME
    ACI_PERS_LOCATION
    ACI_PERS_SHARE_NAME
    STORAGE_ACCOUNT
    STORAGE_KEY


    then you can essentially duplicate the above except for the mount location. It should work, except it doesn't because user 103 doesn't own the folder containing the database



    az container create


    --azure-file-volume-mount-path /var/lib/postgresql


    You will see error messages when reviewing the log



    This is where my question started










    share|improve this question



























      0












      0








      0








      I have a ACI container instance with a mounted file share according to the standard ACI instructions. I must edit the ownership of files mounted in the directory where the file share is mounted. Right now only root owns the files.
      Very similar issue to this but i am looking for a workable solution.
      https://github.com/Azure/azurefile-dockervolumedriver/issues/65



      EDIT: Here are the steps to follow to reproduce



      go to shell.azure.com
      Instantiate these variables on the command line (bash) shell:



      ACI_PERS_RESOURCE_GROUP=cartoetestgroup
      ACI_PERS_STORAGE_ACCOUNT_NAME=cartoteststor$RANDOM
      ACI_PERS_LOCATION=yourlocation (e.g. eastus)
      ACI_PERS_SHARE_NAME=cartomysharename


      Now create the storage account if you haven't already



      az storage account create 
      --resource-group $ACI_PERS_RESOURCE_GROUP
      --name $ACI_PERS_STORAGE_ACCOUNT_NAME
      --location $ACI_PERS_LOCATION
      --sku Standard_LRS


      *I can't remember why I used standard LRS.



      Export the connection string as an environment variable



      export AZURE_STORAGE_CONNECTION_STRING=`az storage account show-connection-    string --resource-group $ACI_PERS_RESOURCE_GROUP --name
      $ACI_PERS_STORAGE_ACCOUNT_NAME --output tsv`


      Create the file share



      az storage share create -n $ACI_PERS_SHARE_NAME



      Confirm the name of the storage account



      STORAGE_ACCOUNT=$(az storage account list --resource-group
      $ACI_PERS_RESOURCE_GROUP --query "[?contains(name,'$ACI_PERS_STORAGE_ACCOUNT_NAME')].[name]" --output tsv)
      echo $STORAGE_ACCOUNT


      Confirm the storage key



      STORAGE_KEY=$(az storage account keys list --resource-group
      $ACI_PERS_RESOURCE_GROUP --account-name $STORAGE_ACCOUNT --query "[0].value" --output tsv)
      echo $STORAGE_KEY


      I recommend you write down the variables values for next time.



      If you are using an existing file share, then create and populate the variables:



      STORAGE_ACCOUNT=cartoteststor123345 
      STORAGE_KEY=yourstoragekey


      (e.g. 243phasldjgknw083hroawuiefh09u3urf0when or something like that)



      Finally, create the container...



      az container create 
      --resource-group $ACI_PERS_RESOURCE_GROUP
      --name tharbemycartodb
      --image sverhoeven/cartodb
      --dns-name-label giveme_a_name_cartodemo
      --ports 80
      --azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME
      --azure-file-volume-account-key $STORAGE_KEY
      --azure-file-volume-share-name $ACI_PERS_SHARE_NAME
      --azure-file-volume-mount-path /var/lib/tmpstor
      --cpu 2 --memory 2
      --dns-name-label whateverIwantToBeAccessedBy
      --ip-address public
      --environment-variables CARTO_HOSTNAME=whateverIwantToBeAccessedBy.mylocation


      (e.g. eastus).azurecontainer.io



      After the whole thing boots and populates (so the site is up and accessible), login to the container from the shell



      az container exec --resource-group cartoetestgroup --name tharbemycartodb --exec-command "/bin/bash" 


      Once inside the container, copy the contents to the file share



      cp -a /var/lib/postgresql/. /var/lib/tmpstor/


      (Maybe try to own the folder before populating it??)



      Then you can kill the container when the copy is complete.



      If you follow the above steps but using your existing credentials



      ACI_PERS_RESOURCE_GROUP
      ACI_PERS_STORAGE_ACCOUNT_NAME
      ACI_PERS_LOCATION
      ACI_PERS_SHARE_NAME
      STORAGE_ACCOUNT
      STORAGE_KEY


      then you can essentially duplicate the above except for the mount location. It should work, except it doesn't because user 103 doesn't own the folder containing the database



      az container create


      --azure-file-volume-mount-path /var/lib/postgresql


      You will see error messages when reviewing the log



      This is where my question started










      share|improve this question
















      I have a ACI container instance with a mounted file share according to the standard ACI instructions. I must edit the ownership of files mounted in the directory where the file share is mounted. Right now only root owns the files.
      Very similar issue to this but i am looking for a workable solution.
      https://github.com/Azure/azurefile-dockervolumedriver/issues/65



      EDIT: Here are the steps to follow to reproduce



      go to shell.azure.com
      Instantiate these variables on the command line (bash) shell:



      ACI_PERS_RESOURCE_GROUP=cartoetestgroup
      ACI_PERS_STORAGE_ACCOUNT_NAME=cartoteststor$RANDOM
      ACI_PERS_LOCATION=yourlocation (e.g. eastus)
      ACI_PERS_SHARE_NAME=cartomysharename


      Now create the storage account if you haven't already



      az storage account create 
      --resource-group $ACI_PERS_RESOURCE_GROUP
      --name $ACI_PERS_STORAGE_ACCOUNT_NAME
      --location $ACI_PERS_LOCATION
      --sku Standard_LRS


      *I can't remember why I used standard LRS.



      Export the connection string as an environment variable



      export AZURE_STORAGE_CONNECTION_STRING=`az storage account show-connection-    string --resource-group $ACI_PERS_RESOURCE_GROUP --name
      $ACI_PERS_STORAGE_ACCOUNT_NAME --output tsv`


      Create the file share



      az storage share create -n $ACI_PERS_SHARE_NAME



      Confirm the name of the storage account



      STORAGE_ACCOUNT=$(az storage account list --resource-group
      $ACI_PERS_RESOURCE_GROUP --query "[?contains(name,'$ACI_PERS_STORAGE_ACCOUNT_NAME')].[name]" --output tsv)
      echo $STORAGE_ACCOUNT


      Confirm the storage key



      STORAGE_KEY=$(az storage account keys list --resource-group
      $ACI_PERS_RESOURCE_GROUP --account-name $STORAGE_ACCOUNT --query "[0].value" --output tsv)
      echo $STORAGE_KEY


      I recommend you write down the variables values for next time.



      If you are using an existing file share, then create and populate the variables:



      STORAGE_ACCOUNT=cartoteststor123345 
      STORAGE_KEY=yourstoragekey


      (e.g. 243phasldjgknw083hroawuiefh09u3urf0when or something like that)



      Finally, create the container...



      az container create 
      --resource-group $ACI_PERS_RESOURCE_GROUP
      --name tharbemycartodb
      --image sverhoeven/cartodb
      --dns-name-label giveme_a_name_cartodemo
      --ports 80
      --azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME
      --azure-file-volume-account-key $STORAGE_KEY
      --azure-file-volume-share-name $ACI_PERS_SHARE_NAME
      --azure-file-volume-mount-path /var/lib/tmpstor
      --cpu 2 --memory 2
      --dns-name-label whateverIwantToBeAccessedBy
      --ip-address public
      --environment-variables CARTO_HOSTNAME=whateverIwantToBeAccessedBy.mylocation


      (e.g. eastus).azurecontainer.io



      After the whole thing boots and populates (so the site is up and accessible), login to the container from the shell



      az container exec --resource-group cartoetestgroup --name tharbemycartodb --exec-command "/bin/bash" 


      Once inside the container, copy the contents to the file share



      cp -a /var/lib/postgresql/. /var/lib/tmpstor/


      (Maybe try to own the folder before populating it??)



      Then you can kill the container when the copy is complete.



      If you follow the above steps but using your existing credentials



      ACI_PERS_RESOURCE_GROUP
      ACI_PERS_STORAGE_ACCOUNT_NAME
      ACI_PERS_LOCATION
      ACI_PERS_SHARE_NAME
      STORAGE_ACCOUNT
      STORAGE_KEY


      then you can essentially duplicate the above except for the mount location. It should work, except it doesn't because user 103 doesn't own the folder containing the database



      az container create


      --azure-file-volume-mount-path /var/lib/postgresql


      You will see error messages when reviewing the log



      This is where my question started







      azure azure-container-service azure-container-instances






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 3 '18 at 14:04







      rubenk

















      asked Jul 26 '18 at 4:57









      rubenkrubenk

      14




      14
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51531270%2fchanging-ownership-of-files-on-azure-file-share-mounted-on-aci%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51531270%2fchanging-ownership-of-files-on-azure-file-share-mounted-on-aci%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bressuire

          Vorschmack

          Quarantine