我创建了一个预览存储帐户并请求访问 Azure 文件服务共享,它允许您创建一个可以跨实例访问的共享。我找到了存储团队提供的以下博客文章:
我已经成功地在我的网络角色中以编程方式创建了共享,开始使用以下代码:
public static void CreateCloudShare()
{
CloudStorageAccount account = CloudStorageAccount.Parse(System.Configuration.ConfigurationManager.AppSettings["SecondaryStorageConnectionString"].ToString());
CloudFileClient client = account.CreateCloudFileClient();
CloudFileShare share = client.GetShareReference("scorm");
share.CreateIfNotExistsAsync().Wait();
}
如果我登录到服务器,我可以使用 cmd.exe 窗口中的以下代码成功映射驱动器:
D:\>net use z: \\<storage-account>.file.core.windows.net\scorm /u:<storage-account> <storage-password>
我试图在我的 Startup.cmd 中包含以下代码
use z: \\<storage-account>.file.core.windows.net\scorm /u:<storage-account> <storage-password>
如果我登录到新实例,那么我可以看到 az: drive present 但说它与错误断开连接或密码不正确错误