问题描述

使用Linux作为服务器运行Web App时,如何将 Storage Account 作为本地共享装载到 App Service for  Linux / Container 中的应用呢?

问题解答

根据官网介绍, App Service For Linux / Container 是可以通过配置完成Mount Azure Storage Account的blob或者是File Share 到Linux环境中的。 它主要的优势有以下四点:

  1. 为App Service 应用配置永久性存储,并单独管理存储。
  2. 使静态内容(如视频和图像)可随时用于App Service 应用。
  3. 将应用程序日志文件写入 Azure 文件共享,或将较旧的应用程序日志存档到 Azure 文件共享。
  4. 跨多个应用或与其他 Azure 服务共享内容。

操作步骤可以详细参考:以本地共享(容器)形式装载 Azure 存储 - Azure App Service | Microsoft Docs

添加 Azure Storage Mount 的内容说明如下:

名称(Name) :装载配置的名称。 不允许空格。
配置选项 (Configuration options): 如果存储帐户未使用服务终结点或专用终结点,则选择“基本”。 否则,选择“高级”。
存储帐户 (Storage accounts):Azure 存储帐户。
存储类型 (Storage type):根据要装载的存储选择类型。 Azure Blob 仅支持只读访问。
存储容器 / 共享名(Storage container / Share name) :要装载的文件共享或 Blob 容器。
访问密钥(仅高级)(Access Key) :存储帐户的访问密钥。
装载路径(Mount path) :要装载到 Azure 存储的 Linux 容器中的目录。 不要使用 / 或 /home。

问题验证

在App Service门户中,进入SSH页面( https://<yourappservicename>.scm.chinacloudsites.cn/webssh/host ),执行 df –h 显示查看File Share是否Mount成功。

在/appcontent目录中新建文件test1.txt,然后在Storage Account中查看文件是否存在

也可以在SSH中通过 tcpping 来查看App Service Storage Account之间的网络连通性

tcpping <Storageaccount>.file.core.chinacloudapi.cn 

附录一:容器app service 如何添加启动参数 --privileged

可以在App Service的Configuration 配置页面中对启动命令一项中根据需求进行设置。如设置 –privileged = true

设置保存后,通过kudu( https://<your app service name>.scm.chinacloudsites.cn/ )站点进入bash页面,查看Logfiles中的日志文件。可以查看到docker run指令中已经包含了 –privileged=ture 参数。

参考文档

将 Azure 存储作为本地共享装载到应用服务中的容器应用https://docs.microsoft.com/zh-cn/azure/app-service/configure-connect-to-azure-storage?tabs=portal&pivots=container-linux#mount-storage-to-linux-container

Linux df command - displays number of free disk blocks and free fileshttps://docs.oracle.com/cd/E23823_01/html/816-5166/df-1m.html#REFMAN1Mdf-1m

-h
Like -k, except that sizes are in a more human readable format. The output consists of one line of information for each specified file system. This information includes the file system name, the total space allocated in the file system, the amount of space allocated to existing files, the total amount of space available for the creation of new files by unprivileged users, and the percentage of normally available space that is currently allocated to all files on the file system. All sizes are scaled to a human readable format, for example, 14K, 234M, 2.7G, or 3.0T. Scaling is done by repetitively dividing by 1024.

This option overrides the -b, -e, -g, -k, -n, -t, and -V options. This option only works on mounted filesystems and can not be used together with -o option.

-k
Prints the allocation in kbytes. The output consists of one line of information for each specified file system. This information includes the file system name, the total space allocated in the file system, the amount of space allocated to existing files, the total amount of space available for the creation of new files by unprivileged users, and the percentage of normally available space that is currently allocated to all files on the file system. This option overrides the -b, -e, -n, and -t options.

-l
Reports on local file systems only. This option is used only for mounted file systems. It can not be used with the -o option.

【应用服务 App Service】App Service For Linux 中如何挂载一个共享文件夹呢? Mount Azure Storage Account File Share的更多相关文章

  1. 在Linux中要修改一个文件夹或文件的权限

    在Linux中要修改一个文件夹或文件的权限我们需要用到linux chmod命令来做,下面我写了几个简单的实例大家可参考一下. 语法如下: chmod [who] [+ | - | =] [mode] ...

  2. 在linux中访问virtualbox的共享文件夹

    1.在客户机里需要安装Virtualbox的增强功能. 2.使用virtualbox的图形界面设置好共享文件夹. 3.假设你设置的共享文件夹的名称是 share,使用如下命令在客户机的linux系统中 ...

  3. VMware中 CentOS7挂载windows共享文件夹

    在编译自己的hadoop时,不想再次在虚拟机中下载jar包,就想到了挂载自己本地的maven仓库,使用本地仓库来进行编译,这里就需要使用VMware的VMware Tools了,直接复制官方文档如下 ...

  4. linux 客户机挂载vitualbox共享文件夹

    1. 安装增强功能包(Guest Additions) 安装好Ubuntu 9.10后,运行Ubuntu并登录.然后在VirtualBox的菜单里选择"设备(Devices)" - ...

  5. linux上挂载windows共享文件夹

    linux上挂载windows共享文件夹 1.共享windows目录 挂载之前得创建一个有password的用户(当前用户也能够),并将你要挂载的目录进行共享,并赋予读写权限 如图. watermar ...

  6. linux中内核的一个不错的参数somaxconn

    导读:在linux中,/proc/sys/net/core/somaxconn这个参数,linux中内核的一个不错的参数somaxconn 看下其解析: 对于一个TCP连接,Server与Client ...

  7. virtualbox中linux系统与windows实现共享文件夹

    最近有一次,需要在linux获取在我windows系统里的安装包,但是呢不论如何也拿不过去. virtualbox虽然提供了双向拖放,但是实在是太不健壮了,感觉基本就没好使过. 于是我想到了用共享文件 ...

  8. 在 Linux 中,最直观、最可见的部分就是 文件系统(file system)

    在 Linux 中,最直观.最可见的部分就是 文件系统(file system).下面我们就来一起探讨一下关于 Linux 中国的文件系统,系统调用以及文件系统实现背后的原理和思想.这些思想中有一些来 ...

  9. VMware中Linux虚拟机与Windows主机共享文件夹

    VMware下Linux虚拟机与Windows主机共享文件夹 1. 安装vm-tool 2. 开启共享文件夹 虚拟机->设置->选项->共享文件夹"右边选择"总是 ...

  10. VMware,win7与linux centos6.4文件互传,linux下挂载windows共享文件夹,vmware tools安装方法

    本方法是以win7,VMware9.0.1 ,centos6.4为基础实验的. 对于linux的初级使用阶段,都会Windows中使用linux虚拟机VMWare或者其它的.在Windows与linu ...

随机推荐

  1. UData查询引擎优化-如何让一条SQL性能提升数倍

    1 UData-解决数据使用的最后一公里 1.1 背景 在大数据的范畴,我们经历了数据产业化的历程,从各个生产系统将数据收集起来,经过实时和离线的数据处理最终汇集在一起,成为我们的主题域数据,下一步挖 ...

  2. 京东小程序CI工具实践

    作者:京东物流 张俊峰 本文从整体介绍了京东小程序CI工具的用途及工作流程,读者可以通过本文了解到一种全新的京东小程序上传方式,同时结合构建脚本和流水线,可大大提高小程序的部署和发布效率. 01 前言 ...

  3. React中Props的详细使用和props的校验

    props中的children属性 组件标签只用有子节点的时候,props就会有该属性; children的属性跟props一样的,值可以是任意值;(文本,React元素,组件,函数) 组件: < ...

  4. Python 潮流周刊#12:Python 中如何调试死锁问题?

    查看全文: https://pythoncat.top/posts/2023-07-22-weekly 文章&教程 1.使用 PyStack 调试 Python 中的崩溃和死锁 (英) 2.介 ...

  5. Golang漏洞管理

    原文在这里 概述 Go帮助开发人员检测.评估和解决可能被攻击者利用的错误或弱点.在幕后,Go团队运行一个管道来整理关于漏洞的报告,这些报告存储在Go漏洞数据库中.各种库和工具可以读取和分析这些报告,以 ...

  6. TienChin 渠道管理-配置字典常量

    在字典管理当中添加渠道状态 channel_status:渠道状态 分别为: 正常,键值为1,回显样式为 success 禁用,键值为0,回显样式为 info !> 有个注意点:Vue3 当中 ...

  7. Linux 多种方式实现文件共享

    文件共享服务在Linux系统上有多种方式,最常用的有Samba,vsftp,iSCSI,NFS这四种方式,如下将分别配置四种不同的文件共享服务. VSFTP 文件传输 FTP是文件传输协议.用于Int ...

  8. 会话跟踪技术之COOKIE

    会话跟踪技术之COOKIE 一.为什么要用会话控制 我们需要我们的站点可以跟踪客户端与服务器之间的交互,保存和记忆每个用户的身份和信息. 几个疑问 我先访问A页面后访问B页面,HTTP无法知道是不是同 ...

  9. 硬件、OS、数据库各种兼容性傻傻分不清?

    服务器硬件型号.OS操作系统版本.Oracle数据库版本.. 各种型号各种版本,排列组合的话也是N多种组合,如何确认这些可以兼容并且得到官方认证呢? 其实很简单,各司其职,各自去确认各自的. 我们知道 ...

  10. Linux用户被锁定后如何解锁

    客户的一台机器,按照提供的常用密码尝试使用oracle用户登陆,超过指定次数账号被锁定,提示如下: Account locked due to 6 failed logins 这需要使用root用户解 ...