azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Mount path for windows - invalid characters?

Open dazinator opened this issue 6 years ago • 16 comments

I am trying to add a path mapping - my container is a windows container not linux. If I run the command I get back "Bad Request". If I add the --debug argument I can see that it doesn't like the --mount-path argument. I have tried various combinations like "C:/webstorage" and "/webstorage" and can't get anything to work. What is the correct syntax for this argument for windows and mounting to the C:/ drive somewhere? > msrest.http_logger : Response content: msrest.http_logger : {"Code":"BadRequest","Message":"The parameter 'AzureStoragePropertyDictionary' has an invalid value. Details: Mount path contains invalid characters. Please review documentation for a list of valid mount path characters..","Target":null,"Details":[{"Message":"The parameter 'AzureStoragePropertyDictionary' has an invalid value. Details: Mount path contains invalid characters. Please review documentation for a list of valid mount path characters.."},{"Code":"BadRequest"},{"ErrorEntity":{"ExtendedCode":"01033","MessageTemplate":"The parameter '{0}' has an invalid value. Details: {1}.","Parameters":["AzureStoragePropertyDictionary","Mount path contains invalid characters. Please review documentation for a list of valid mount path characters."],"Code":"BadRequest","Message":"The parameter 'AzureStoragePropertyDictionary' has an invalid value. Details: Mount path contains invalid characters. Please review documentation for a list of valid mount path characters.."}}],"Innererror":null} msrest.exceptions : Operation returned an invalid status code 'Bad Request' cli.azure.cli.core.util : Operation returned an invalid status code 'Bad Request' Operation returned an invalid status code 'Bad Request' az_command_data_logger : exit code: 1 telemetry.save : Save telemetry record of length 2580 in cache telemetry.check : Negative: The C:\Users\DarrellTunnell.azure\telemetry.txt was modified at 2020-01-23 10:43:00.920906, which in less than 600.000000 s command ran in 6.148 seconds.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

dazinator avatar Jan 23 '20 10:01 dazinator

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI @antcp

ghost avatar Jan 23 '20 13:01 ghost

Same issue here using Az PowerShell module, please advise

MaximeRastello avatar Jan 24 '20 16:01 MaximeRastello

--mount-path "\data" worked for me with Windows Containers in App Service

Rodske avatar Jan 25 '20 11:01 Rodske

--mount-path "\data" worked for me with Windows Containers in App Service

Is "data" a subfolder of D:\home\site ?

MaximeRastello avatar Jan 27 '20 09:01 MaximeRastello

--mount-path "\data" worked for me with Windows Containers in App Service

Assuming that maps to c:/data then that wouldnt work for mapping to other drives on windows such as D:/.

I have an existing app service with c:/webstorage mapped - so this worked at some point previously, I'm concerned to know why it now does not, I.e it seems to be a regression

dazinator avatar Jan 27 '20 12:01 dazinator

@dazinator & @MaximeRastello - Yes it would mount the share into c: as the folder name data. It's not creating a new drive for the mount.

Rodske avatar Feb 09 '20 08:02 Rodske

@vinisoto can you comment on this?

panchagnula avatar May 11 '20 19:05 panchagnula

Thanks for using Windows Containers.

Just tried and --mountpath /webstorage works for me (both in the Portal and CLI). There was a regression a few sprints back but it is working now.

cc @jvano

vinisoto avatar May 11 '20 19:05 vinisoto

@vinisoto as per the original issue, the error I was seeing was when specifying a drive etc --mountpath C:/webstorage. This used to work as a mapping through the UI. Several weeks ago this stopped working in the UI with an odd error where it seemed to add it, but didn't save, and refreshing the page it was gone. It also fails through the CLI. It does work if I don't specify a drive e.g --mountpath /webstorage and that's how I do it today. But that means seems to suggest you can't mount a custom drive, only to subfolders within the default C drive. Is this a new intentional change or has this now been fixed?

dazinator avatar May 11 '20 21:05 dazinator

@dazinator behind the scenes we have only supported mounting in subfolders of C: all along (in fact, I believe that in the past if you specified something different than C: we showed an error message indicating that you had to specify C: as the root of your mount path). Because of that (and also to be consistent with how specify mount paths in Linux containers) we chose to remove the drive letter.

Is there a scenario in which you would need your mount path to be in a custom drive?

vinisoto avatar May 14 '20 05:05 vinisoto

@vinisoto thank you, that finally explains the behaviour I was seeing.

The only scenarios for not wanting to mount under C drive that I can think of are:-

  1. You are not sure whether a subfolder already exists under C for the mount path. I think if you mount into an existing non empty folder on windows it used to cause docker run to error with a not helpful message.

  2. The applications running within the container use other drive paths by convention. For example they might expect E:\Backups. To stick to this convention you want to mount to E:\Backups rather than attempt to reconfigure the application.

dazinator avatar May 14 '20 07:05 dazinator

@vinisoto can we close this issue?

panchagnula avatar Aug 04 '20 06:08 panchagnula

I think we should close it. By design we won't be supporting custom drives for now.

vinisoto avatar Aug 04 '20 14:08 vinisoto

Thank @vinisoto closing the issue.

panchagnula avatar Aug 04 '20 16:08 panchagnula

@dazinator thanks for the feedback about the "E:\Backups" example.

I will add this into our backlog but as @vinisoto mentioned custom drives are not supported at this point.

jvano avatar Aug 04 '20 21:08 jvano

Just to let you all know that we recently made a fix to support custom drives. It will take few months for the change to be released and available worldwide.

jvano avatar Apr 28 '21 04:04 jvano