我们有一个应用程序,可以通过 Azure 文件列出文件夹中的文件。当我们使用C#方法时:
Directory.GetFiles(@"\\account.file.core.windows.net\xyz")
Run Code Online (Sandbox Code Playgroud)
当有 2000 个文件时,大约需要一分钟。
如果我们使用 CloudStorageAccount 执行相同操作:
CloudFileClient fileClient = storageAccount.CreateCloudFileClient();
CloudFileDirectory directory = fileClient.GetShareReference("account").GetRootDirectoryReference().GetDirectoryReference("abc");
Int64 totalLength = 0;
foreach (IListFileItem fileAndDirectory in directory.ListFilesAndDirectories())
{
CloudFile file = (CloudFile)fileAndDirectory;
if (file == null) //must be directory if null
continue;
totalLength += file.Properties.Length;
}
Run Code Online (Sandbox Code Playgroud)
它会返回所有文件,但大约需要 10 秒。为什么性能会有如此大的差异?
我正在尝试使用azureFile创建持久卷但是我不断收到以下错误.
MountVolume.SetUp failed for volume "kubernetes.io/azure-file/2882f900-d7de-11e6-affc-000d3a26076e-pv0001" (spec.Name: "pv0001") pod "2882f900-d7de-11e6-affc-000d3a26076e" (UID: "2882f900-d7de-11e6-affc-000d3a26076e") with: mount failed: exit status 32 Mounting arguments: //xxx.file.core.windows.net/test /var/lib/kubelet/pods/2882f900-d7de-11e6-affc-000d3a26076e/volumes/kubernetes.io~azure-file/pv0001 cifs [vers=3.0,username=xxx,password=xxx ,dir_mode=0777,file_mode=0777] Output: mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Run Code Online (Sandbox Code Playgroud)
我还尝试在其中一个正在运行kubernetes的VM上安装共享,这样做有效.
我使用以下配置来创建pv/pvc/pod.
apiVersion: v1
kind: Secret
metadata:
name: azure-secret
type: Opaque
data:
azurestorageaccountkey: [base64 key]
azurestorageaccountname: [base64 accountname]
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
azureFile:
secretName: azure-secret
shareName: test
readOnly: false
kind: Pod …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用以下命令从运行High Sierra 10.13.6的Mac连接到Azure文件共享:
mount_smbfs -d 0777 -f 0777 //dolphins:PASSWORDHERE@dolphins.file.core.windows.net/models /Users/b3020111/Azure
Run Code Online (Sandbox Code Playgroud)
但是我不断收到错误:
mount_smbfs: server connection failed: No route to host
Run Code Online (Sandbox Code Playgroud)
我已经关闭了/etc/nsmb.conf中的数据包签名:
[default]
signing_required=no
在网上浏览后,我似乎无所适从,不胜感激。
我目前已经创建了一个 Azure 存储帐户。在这个存储中,我创建了两个文件共享。我已将文件上传到每个文件共享中,并希望从 Azure DevOps 管道中访问这些文件。
我在网上研究过如何做到这一点,但没有找到详细说明如何做到这一点的资源。以前有人这样做过吗?如果是,从 azure devOps 管道读取文件共享文件的步骤是什么?
谢谢。
人们问
azure azure-storage azure-files azure-devops azure-pipelines
正如标题所说,我正在寻找一种直接从azure网站访问azure文件共享(预览版)的方法.我不能使用任何REST API或类似的东西,我正在寻找直接将SMB共享安装到网站(通过新门户网站或任何其他方式)的可能性.
我找到了以下链接,据我所知,这仍然在审查中(http://feedback.azure.com/forums/169385-web-apps-formerly-websites/suggestions/6084609-allow-map-azure-file -share-microsoft-azure-file-s)还有一个SO问题(可以从Azure网站使用新的Azure文件服务吗?)但是没有回答我的问题.
说实话,为了提供更多细节,我的场景很简单 - 我有一些网站,还有一些虚拟机应该从azure文件服务访问文件.关于VM,这种方法非常简单直接,但对于WebSites,我现在还没有找到任何办法.
另一方面,无论上述问题的答案如何,(或者我是否有可能)通过Azure文件共享启用CDN是否有意义?
非常感谢你.
我想在将文件添加到 Azure 文件共享时触发 Azure 函数。我没有看到任何关于此的文档。是否支持?我将如何完成它?
我正在使用 MySQL Docker 容器,我想在其中使用 Azure 文件共享。为了创建 MySQL Docker 容器,我使用以下构建脚本。
FROM mysql:5.7
RUN apt-get update && apt-get upgrade && apt-get install sudo
RUN sudo apt install cifs-utils -y
RUN sudo apt-get install curl -y
RUN cd home
RUN mkdir install
RUN cd install
RUN curl curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
Run Code Online (Sandbox Code Playgroud)
当我进入此容器时,我使用从 Azure 门户中选择的以下命令并创建一个 bash 脚本。
当我执行脚本时,我收到此错误:
无法应用新的功能集。
您能帮我将 Azure 文件共享安装到 Linux 吗?
非常感谢,
埃里克
我想通过Powershell从Azure文件存储中下载一个大文件,
我发现所有解决方案都使用Azure Blob,它无法使用Azure文件,
有什么方法可以从Azure文件下载文件?
[注意:因为文件很大(127GB),下载时间会很长(可能需要3到4天),所以当我使用浏览器下载文件时,它总是会损坏]
以下是正式文档:https : //docs.microsoft.com/zh-cn/azure/storage/storage-powershell-guide-full
我正在尝试创建一个天蓝色函数来清除超过一定年龄的文件,但是当我访问文件的属性时它们都是空的,我做错了什么?!
using System;
using System.Collections.Generic;
using Azure.Storage.Files.Shares;
using Azure.Storage.Files.Shares.Models;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
namespace somewhere
{
public static class FileShareCleaner
{
[FunctionName("FileShareCleaner")]
public static void Run([TimerTrigger("*/10 */1 * * * *")]TimerInfo myTimer, ILogger log)
{
string connectionString = Environment.GetEnvironmentVariable("FileShareConnectionString");
string shareName = "files";
ShareServiceClient shareserviceclient = new ShareServiceClient(connectionString);
ShareClient shareclient = shareserviceclient.GetShareClient(shareName);
Queue<ShareDirectoryClient> remaining = new Queue<ShareDirectoryClient>();
remaining.Enqueue(shareclient.GetRootDirectoryClient());
while (remaining.Count > 0)
{
ShareDirectoryClient dir = remaining.Dequeue();
foreach (ShareFileItem item in dir.GetFilesAndDirectories())
{
log.LogInformation(item.Name);
if (item.IsDirectory)
{
remaining.Enqueue(dir.GetSubdirectoryClient(item.Name));
}
else …
Run Code Online (Sandbox Code Playgroud) azure-files ×10
azure ×8
c# ×2
.net ×1
azure-devops ×1
docker ×1
kubernetes ×1
powershell ×1
smb ×1
volumes ×1