gpt4 book ai didi

azure - 使用 CLI 在 Azure 中上传文件

转载 作者:行者123 更新时间:2023-12-02 19:35:17 25 4
gpt4 key购买 nike

我正在尝试练习以下任务:

  1. 创建存储帐户:az 存储帐户创建 --name heyatafroz25 --resource-group user-fottsascvuzj

  2. 获取存储帐户 key :az 存储帐户 key 列表 -g user-fottsascvuzj -n heyatafroz25

  3. 创建共享帐户:az storage share create --帐户名称 heyatafroz25 --名称 key1az storage share create --帐户名称 heyatafroz25 --名称 key2

  4. 创建存储目录:az 存储目录创建 --帐户名称 heyatafroz25 --名称 heyatdir1 --共享名称 key1az 存储目录 create --account-name heyatafroz25 --name heyatdir2 --share-name key2

  5. 上传文件

我被要求创建一个我使用 touch 命令创建的 index.php 文件。

发布我不确定路径和源需要考虑哪些细节。对于路径,我采用了当前的工作目录

az 存储文件上传 --account-name heyatafroz25 --account-key N+PKe3ihto+G0h9CvVRV/bJ5KeEFF6RFB0aKf2qcfcyJA1uOyCBUO06Tlh9KHUzhA+PyugmDLwlrceXW5V31Xw== --path/home/scrapbook/tutorial/index.php --share-name key1 --来源/home/scrapbook/tutorial/index.php

请对第 5 个命令中的更正提出建议。

提前致谢。

最佳答案

查看 az storage file upload 的文档:

--source:作为文件内容上传的本地文件的路径。

本质上,这是您要上传的本地文件的路径。

--path:文件共享中文件的路径。如果省略文件名,则将使用源文件名。

因此,假设您要上传文件,这将是您希望本地文件保存在存储中的文件名。

为了进一步详细说明,假设您有一个名为“image.png”的本地文件,并且要将其另存为“logo.png”,您将使用以下命令:

az storage file upload --account-name <account-name> --account-key <account-key> --share-name <share-name> --path logo.png --source image.png

关于azure - 使用 CLI 在 Azure 中上传文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61140075/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com