SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Работа с
Windows Azure Drive




                                25/07/2012

                            Ревенков Павел
     EPAM Cloud Computing Competence Center

                  pavlo_revenkov@epam.com
Data Management Services
• SQL Azure – реляционная база данных;

• Tables – не реляционные таблицы;

• Queue - очереди;

• Blob - двоичные данные;

• Drive - подключаемые облачные NTFS-тома (VHD).

                                              2
Пример: CMS-система
Publishers                                                    Author




        Instance 1   Instance 2           Instance 3   Instance 4




                                  Mount

        30 minutes


      Snapshot                Repository


                                                                       3
Windows Azure Drive
   Azure
Subscription


   Storage Account
       (100 ТВ)
                     Container
                                 Block Blob (200 GB)
   Storage Account
       (100 ТВ)      Container
                                  Page Blob (1 ТВ)
   Storage Account   Container

                      …
       (100 ТВ)                  Azure Drive (1 ТВ)

   Storage Account
       (100 ТВ)
                                       …
   Storage Account
       (100 ТВ)                                        4
Загрузка данных в Blob Storage
var storageAccount = CloudStorageAccount.Parse(
    ConfigurationManager
        .ConnectionStrings[ConnectionStringSetting]
        .ConnectionString);

var blobClient = storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference(containerName);
var pageBlob = container.GetPageBlobReference(blobName);
using (var fileStream = new FileStream(filePath, FileMode.Open)) {
    pageBlob.Create(fileStream.Length);

    var buffer = new byte[partSize];
    while (offset < fileStream.Length) {
        var bytesRead = fileStream.Read(buffer, 0, partSize);

         pageBlob.WritePages(new MemoryStream(buffer, 0, bytesRead), offset);

         offset += bytesRead;
    }
}
                                                                            5
1. public static void UploadVHDFile(string filePath, string containerName, string blobName)
2. {
3.       const int partSize = 1024 * 1024;
4.
5.       var storageAccount = CloudStorageAccount.Parse(
6.           ConfigurationManager.ConnectionStrings[ConnectionStringSetting].ConnectionString);
7.
8.       var blobClient = storageAccount.CreateCloudBlobClient();
9.       var container = blobClient.GetContainerReference(containerName);
10.          container.CreateIfNotExist();
11.
12.      var pageBlob = container.GetPageBlobReference(blobName);
13.          pageBlob.DeleteIfExists();
14.          pageBlob.Properties.ContentType = "binary/octet-stream";
15.
16.      using (var fileStream = new FileStream(filePath, FileMode.Open))
17.      {
18.          int offset = 0;
19.
20.          pageBlob.Create(fileStream.Length);
21.
22.          var buffer = new byte[partSize];
23.          while (offset < fileStream.Length)
24.          {
25.               var bytesRead = fileStream.Read(buffer, 0, partSize);
26.
27.               pageBlob.WritePages(new MemoryStream(buffer, 0, bytesRead), offset);
28.
29.               offset += bytesRead;
30.
31.               Console.Write('.');
32.          }
33.      }
34. }
                                                                                                  6
Режимы работы Azure Drive
             CloudDrive
                                                Snapshot
                client




                       URL
                                Exception
                  Mount                          Mount

                  Да

Author       Lease режим                    Snapshot режим   Publisher




                                                    чтение
              чтение

                       запись




                                Windows Azure
                                    Drive
                                                                         7
Работа с Windows Azure Drive
var account = CloudStorageAccount.Parse(
    RoleEnvironment.GetConfigurationSettingValue("ConnectionString"));

var drive = account.CreateCloudDrive("drives/vhd");

try
{
      drive.Mount(0, DriveMountOptions.None);
      ...
}
catch (CloudDriveException e)
{
    drive = account.CreateCloudDrive(drive.Snapshot().AbsoluteUri);
    drive.Mount(0, DriveMountOptions.None);
}
finally
{
    drive.Unmount();
}


                                                                         8
1. public ActionResult Index()
2. {
3.       var account = CloudStorageAccount.Parse(
4.           RoleEnvironment.GetConfigurationSettingValue("ConnectionString"));
5.
6.       var drive = account.CreateCloudDrive("drives/vhd");
7.       var letter = string.Empty;
8.
9.       FileInfo[] files;
10.      try
11.      {
12.          letter = drive.Mount(0, DriveMountOptions.None);
13.      }
14.      catch (CloudDriveException e)
15.      {
16.          drive = account.CreateCloudDrive(drive.Snapshot().AbsoluteUri);
17.          letter = drive.Mount(0, DriveMountOptions.None);
18.      }
19.      finally
20.      {
21.          files = new DirectoryInfo(drive.LocalPath).GetFiles();
22.          drive.Unmount();
23.      }
24.      ViewBag.Message = String.Format("Azure Drive mounted on: {0}", letter);
25.
26.      return View(files);
27. }

                                                                                   9
Questions?




             10
Ссылки и материалы

Differences Between the Storage Emulator and
Windows Azure Storage Services:
     http://msdn.microsoft.com/en-us/gg433135



Windows Azure Drive whitepaper:
     http://go.microsoft.com/?linkid=9710117




                                                11

Weitere ähnliche Inhalte

Was ist angesagt?

Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual MachinesNeil Mackenzie
 
Windows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksWindows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksKristof Rennen
 
Keynote - Silicon Valley Cloud Computing User Group Meet - April 2011 - Srira...
Keynote - Silicon Valley Cloud Computing User Group Meet - April 2011 - Srira...Keynote - Silicon Valley Cloud Computing User Group Meet - April 2011 - Srira...
Keynote - Silicon Valley Cloud Computing User Group Meet - April 2011 - Srira...Sriram Krishnan
 
A complete guide to azure storage
A complete guide to azure storageA complete guide to azure storage
A complete guide to azure storageHimanshu Sahu
 
Mongo db world 2014 nyc mongodb on azure - tips tricks and examples
Mongo db world 2014 nyc   mongodb on azure - tips tricks and examplesMongo db world 2014 nyc   mongodb on azure - tips tricks and examples
Mongo db world 2014 nyc mongodb on azure - tips tricks and examplesBrian Benz
 
Azure Virtual Machines Deployment Scenarios
Azure Virtual Machines Deployment ScenariosAzure Virtual Machines Deployment Scenarios
Azure Virtual Machines Deployment ScenariosBrian Benz
 
Microsoft Azure, door Rob Brommer op de 4DotNet Developers Day
Microsoft Azure, door Rob Brommer op de 4DotNet Developers DayMicrosoft Azure, door Rob Brommer op de 4DotNet Developers Day
Microsoft Azure, door Rob Brommer op de 4DotNet Developers DayHanneke Dotnet
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesGuillermo Caicedo
 
Windows Azure platform
Windows Azure platformWindows Azure platform
Windows Azure platformGetDev.NET
 
MongoDB WiredTiger Internals
MongoDB WiredTiger InternalsMongoDB WiredTiger Internals
MongoDB WiredTiger InternalsNorberto Leite
 
13 deploying cloud applications
13   deploying cloud applications13   deploying cloud applications
13 deploying cloud applicationsdarwinodb
 
Tech Ed North America 2014 - Java on Azure
Tech Ed North America 2014 - Java on AzureTech Ed North America 2014 - Java on Azure
Tech Ed North America 2014 - Java on AzureBrian Benz
 

Was ist angesagt? (20)

Windows Azure Drive
Windows Azure DriveWindows Azure Drive
Windows Azure Drive
 
Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual Machines
 
caching2012.pdf
caching2012.pdfcaching2012.pdf
caching2012.pdf
 
Windows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual NetworksWindows Azure Virtual Machines And Virtual Networks
Windows Azure Virtual Machines And Virtual Networks
 
Windows Azure Storage – Architecture View
Windows Azure Storage – Architecture ViewWindows Azure Storage – Architecture View
Windows Azure Storage – Architecture View
 
SQL Azure
SQL AzureSQL Azure
SQL Azure
 
Azure storage
Azure storageAzure storage
Azure storage
 
Keynote - Silicon Valley Cloud Computing User Group Meet - April 2011 - Srira...
Keynote - Silicon Valley Cloud Computing User Group Meet - April 2011 - Srira...Keynote - Silicon Valley Cloud Computing User Group Meet - April 2011 - Srira...
Keynote - Silicon Valley Cloud Computing User Group Meet - April 2011 - Srira...
 
A complete guide to azure storage
A complete guide to azure storageA complete guide to azure storage
A complete guide to azure storage
 
Mongo db world 2014 nyc mongodb on azure - tips tricks and examples
Mongo db world 2014 nyc   mongodb on azure - tips tricks and examplesMongo db world 2014 nyc   mongodb on azure - tips tricks and examples
Mongo db world 2014 nyc mongodb on azure - tips tricks and examples
 
Azure IaaS
Azure IaaSAzure IaaS
Azure IaaS
 
Azure storage
Azure storageAzure storage
Azure storage
 
Azure Virtual Machines Deployment Scenarios
Azure Virtual Machines Deployment ScenariosAzure Virtual Machines Deployment Scenarios
Azure Virtual Machines Deployment Scenarios
 
Microsoft Azure, door Rob Brommer op de 4DotNet Developers Day
Microsoft Azure, door Rob Brommer op de 4DotNet Developers DayMicrosoft Azure, door Rob Brommer op de 4DotNet Developers Day
Microsoft Azure, door Rob Brommer op de 4DotNet Developers Day
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud Features
 
Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual Machines
 
Windows Azure platform
Windows Azure platformWindows Azure platform
Windows Azure platform
 
MongoDB WiredTiger Internals
MongoDB WiredTiger InternalsMongoDB WiredTiger Internals
MongoDB WiredTiger Internals
 
13 deploying cloud applications
13   deploying cloud applications13   deploying cloud applications
13 deploying cloud applications
 
Tech Ed North America 2014 - Java on Azure
Tech Ed North America 2014 - Java on AzureTech Ed North America 2014 - Java on Azure
Tech Ed North America 2014 - Java on Azure
 

Ähnlich wie Windows Azure Drive

C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojosdeconf
 
Azure Table Storage: The Good, the Bad, the Ugly (full talk)
Azure Table Storage: The Good, the Bad, the Ugly (full talk)Azure Table Storage: The Good, the Bad, the Ugly (full talk)
Azure Table Storage: The Good, the Bad, the Ugly (full talk)Sirar Salih
 
Java and windows azure cloud service
Java and windows azure cloud serviceJava and windows azure cloud service
Java and windows azure cloud serviceJeffray Huang
 
Windows azure camp - Kolkata
Windows azure camp - KolkataWindows azure camp - Kolkata
Windows azure camp - KolkataAbhijit Jana
 
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azureEscalabilidad horizontal y arquitecturas elásticas en Microsoft azure
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azureEnrique Catala Bañuls
 
Azure Storage Account ve Microsoft Azure Data Lake Storage.pptx
Azure Storage Account ve Microsoft Azure Data Lake Storage.pptxAzure Storage Account ve Microsoft Azure Data Lake Storage.pptx
Azure Storage Account ve Microsoft Azure Data Lake Storage.pptxMustafa Özdemir
 
TechEd 2012 - Сценарии хранения и обработки данных в windows azure
TechEd 2012 - Сценарии хранения и обработки данных в windows azureTechEd 2012 - Сценарии хранения и обработки данных в windows azure
TechEd 2012 - Сценарии хранения и обработки данных в windows azureДенис Резник
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)Michael Collier
 
Windows azure camp
Windows azure campWindows azure camp
Windows azure campAbhishek Sur
 
AWS CSA Associate 06-07
AWS CSA Associate 06-07AWS CSA Associate 06-07
AWS CSA Associate 06-07Heitor Vital
 
NoSQL on microsoft azure april 2014
NoSQL on microsoft azure   april 2014NoSQL on microsoft azure   april 2014
NoSQL on microsoft azure april 2014Brian Benz
 
Gaming across multiple devices
Gaming across multiple devicesGaming across multiple devices
Gaming across multiple devicesPatric Boscolo
 
SCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AISCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AIHiroshi Tanaka
 
MongoDB and Windows Azure
MongoDB and Windows AzureMongoDB and Windows Azure
MongoDB and Windows AzureDoug Mahugh
 
Azure Cloud Dev Camp - App Platform
Azure Cloud Dev Camp - App PlatformAzure Cloud Dev Camp - App Platform
Azure Cloud Dev Camp - App Platformgiventocode
 
MongoDB and Windows Azure
MongoDB and Windows AzureMongoDB and Windows Azure
MongoDB and Windows AzureMongoDB
 
Windows 8 and the Cloud
Windows 8 and the CloudWindows 8 and the Cloud
Windows 8 and the CloudDavid Pallmann
 
Monitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar SeriesMonitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar SeriesAmazon Web Services
 
London .NET Developers Azure Websites
London .NET Developers Azure WebsitesLondon .NET Developers Azure Websites
London .NET Developers Azure WebsitesTom Walker
 

Ähnlich wie Windows Azure Drive (20)

C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojo
 
Azure Table Storage: The Good, the Bad, the Ugly (full talk)
Azure Table Storage: The Good, the Bad, the Ugly (full talk)Azure Table Storage: The Good, the Bad, the Ugly (full talk)
Azure Table Storage: The Good, the Bad, the Ugly (full talk)
 
Windows Azure Storage
Windows Azure StorageWindows Azure Storage
Windows Azure Storage
 
Java and windows azure cloud service
Java and windows azure cloud serviceJava and windows azure cloud service
Java and windows azure cloud service
 
Windows azure camp - Kolkata
Windows azure camp - KolkataWindows azure camp - Kolkata
Windows azure camp - Kolkata
 
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azureEscalabilidad horizontal y arquitecturas elásticas en Microsoft azure
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure
 
Azure Storage Account ve Microsoft Azure Data Lake Storage.pptx
Azure Storage Account ve Microsoft Azure Data Lake Storage.pptxAzure Storage Account ve Microsoft Azure Data Lake Storage.pptx
Azure Storage Account ve Microsoft Azure Data Lake Storage.pptx
 
TechEd 2012 - Сценарии хранения и обработки данных в windows azure
TechEd 2012 - Сценарии хранения и обработки данных в windows azureTechEd 2012 - Сценарии хранения и обработки данных в windows azure
TechEd 2012 - Сценарии хранения и обработки данных в windows azure
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)
 
Windows azure camp
Windows azure campWindows azure camp
Windows azure camp
 
AWS CSA Associate 06-07
AWS CSA Associate 06-07AWS CSA Associate 06-07
AWS CSA Associate 06-07
 
NoSQL on microsoft azure april 2014
NoSQL on microsoft azure   april 2014NoSQL on microsoft azure   april 2014
NoSQL on microsoft azure april 2014
 
Gaming across multiple devices
Gaming across multiple devicesGaming across multiple devices
Gaming across multiple devices
 
SCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AISCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AI
 
MongoDB and Windows Azure
MongoDB and Windows AzureMongoDB and Windows Azure
MongoDB and Windows Azure
 
Azure Cloud Dev Camp - App Platform
Azure Cloud Dev Camp - App PlatformAzure Cloud Dev Camp - App Platform
Azure Cloud Dev Camp - App Platform
 
MongoDB and Windows Azure
MongoDB and Windows AzureMongoDB and Windows Azure
MongoDB and Windows Azure
 
Windows 8 and the Cloud
Windows 8 and the CloudWindows 8 and the Cloud
Windows 8 and the Cloud
 
Monitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar SeriesMonitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar Series
 
London .NET Developers Azure Websites
London .NET Developers Azure WebsitesLondon .NET Developers Azure Websites
London .NET Developers Azure Websites
 

Mehr von Pavel Revenkov

Windows Azure PowerShell CmdLets
Windows Azure PowerShell CmdLetsWindows Azure PowerShell CmdLets
Windows Azure PowerShell CmdLetsPavel Revenkov
 
Windows Azure Active Directory
Windows Azure Active DirectoryWindows Azure Active Directory
Windows Azure Active DirectoryPavel Revenkov
 
Windows Azure Versioning Strategies
Windows Azure Versioning StrategiesWindows Azure Versioning Strategies
Windows Azure Versioning StrategiesPavel Revenkov
 
Windows Azure Zero Downtime Upgrade
Windows Azure Zero Downtime UpgradeWindows Azure Zero Downtime Upgrade
Windows Azure Zero Downtime UpgradePavel Revenkov
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service BusPavel Revenkov
 
Windows Azure PowerShell Cmdlets
Windows Azure PowerShell CmdletsWindows Azure PowerShell Cmdlets
Windows Azure PowerShell CmdletsPavel Revenkov
 
Starting with windows azure
Starting with windows azureStarting with windows azure
Starting with windows azurePavel Revenkov
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service BusPavel Revenkov
 
Windows Azure Storage services
Windows Azure Storage servicesWindows Azure Storage services
Windows Azure Storage servicesPavel Revenkov
 

Mehr von Pavel Revenkov (11)

Windows Azure PowerShell CmdLets
Windows Azure PowerShell CmdLetsWindows Azure PowerShell CmdLets
Windows Azure PowerShell CmdLets
 
Windows Azure Active Directory
Windows Azure Active DirectoryWindows Azure Active Directory
Windows Azure Active Directory
 
Windows Azure Versioning Strategies
Windows Azure Versioning StrategiesWindows Azure Versioning Strategies
Windows Azure Versioning Strategies
 
Windows Azure Zero Downtime Upgrade
Windows Azure Zero Downtime UpgradeWindows Azure Zero Downtime Upgrade
Windows Azure Zero Downtime Upgrade
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service Bus
 
Windows azure start
Windows azure startWindows azure start
Windows azure start
 
SQL Azure Federations
SQL Azure FederationsSQL Azure Federations
SQL Azure Federations
 
Windows Azure PowerShell Cmdlets
Windows Azure PowerShell CmdletsWindows Azure PowerShell Cmdlets
Windows Azure PowerShell Cmdlets
 
Starting with windows azure
Starting with windows azureStarting with windows azure
Starting with windows azure
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service Bus
 
Windows Azure Storage services
Windows Azure Storage servicesWindows Azure Storage services
Windows Azure Storage services
 

Kürzlich hochgeladen

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Windows Azure Drive

  • 1. Работа с Windows Azure Drive 25/07/2012 Ревенков Павел EPAM Cloud Computing Competence Center pavlo_revenkov@epam.com
  • 2. Data Management Services • SQL Azure – реляционная база данных; • Tables – не реляционные таблицы; • Queue - очереди; • Blob - двоичные данные; • Drive - подключаемые облачные NTFS-тома (VHD). 2
  • 3. Пример: CMS-система Publishers Author Instance 1 Instance 2 Instance 3 Instance 4 Mount 30 minutes Snapshot Repository 3
  • 4. Windows Azure Drive Azure Subscription Storage Account (100 ТВ) Container Block Blob (200 GB) Storage Account (100 ТВ) Container Page Blob (1 ТВ) Storage Account Container … (100 ТВ) Azure Drive (1 ТВ) Storage Account (100 ТВ) … Storage Account (100 ТВ) 4
  • 5. Загрузка данных в Blob Storage var storageAccount = CloudStorageAccount.Parse( ConfigurationManager .ConnectionStrings[ConnectionStringSetting] .ConnectionString); var blobClient = storageAccount.CreateCloudBlobClient(); var container = blobClient.GetContainerReference(containerName); var pageBlob = container.GetPageBlobReference(blobName); using (var fileStream = new FileStream(filePath, FileMode.Open)) { pageBlob.Create(fileStream.Length); var buffer = new byte[partSize]; while (offset < fileStream.Length) { var bytesRead = fileStream.Read(buffer, 0, partSize); pageBlob.WritePages(new MemoryStream(buffer, 0, bytesRead), offset); offset += bytesRead; } } 5
  • 6. 1. public static void UploadVHDFile(string filePath, string containerName, string blobName) 2. { 3. const int partSize = 1024 * 1024; 4. 5. var storageAccount = CloudStorageAccount.Parse( 6. ConfigurationManager.ConnectionStrings[ConnectionStringSetting].ConnectionString); 7. 8. var blobClient = storageAccount.CreateCloudBlobClient(); 9. var container = blobClient.GetContainerReference(containerName); 10. container.CreateIfNotExist(); 11. 12. var pageBlob = container.GetPageBlobReference(blobName); 13. pageBlob.DeleteIfExists(); 14. pageBlob.Properties.ContentType = "binary/octet-stream"; 15. 16. using (var fileStream = new FileStream(filePath, FileMode.Open)) 17. { 18. int offset = 0; 19. 20. pageBlob.Create(fileStream.Length); 21. 22. var buffer = new byte[partSize]; 23. while (offset < fileStream.Length) 24. { 25. var bytesRead = fileStream.Read(buffer, 0, partSize); 26. 27. pageBlob.WritePages(new MemoryStream(buffer, 0, bytesRead), offset); 28. 29. offset += bytesRead; 30. 31. Console.Write('.'); 32. } 33. } 34. } 6
  • 7. Режимы работы Azure Drive CloudDrive Snapshot client URL Exception Mount Mount Да Author Lease режим Snapshot режим Publisher чтение чтение запись Windows Azure Drive 7
  • 8. Работа с Windows Azure Drive var account = CloudStorageAccount.Parse( RoleEnvironment.GetConfigurationSettingValue("ConnectionString")); var drive = account.CreateCloudDrive("drives/vhd"); try { drive.Mount(0, DriveMountOptions.None); ... } catch (CloudDriveException e) { drive = account.CreateCloudDrive(drive.Snapshot().AbsoluteUri); drive.Mount(0, DriveMountOptions.None); } finally { drive.Unmount(); } 8
  • 9. 1. public ActionResult Index() 2. { 3. var account = CloudStorageAccount.Parse( 4. RoleEnvironment.GetConfigurationSettingValue("ConnectionString")); 5. 6. var drive = account.CreateCloudDrive("drives/vhd"); 7. var letter = string.Empty; 8. 9. FileInfo[] files; 10. try 11. { 12. letter = drive.Mount(0, DriveMountOptions.None); 13. } 14. catch (CloudDriveException e) 15. { 16. drive = account.CreateCloudDrive(drive.Snapshot().AbsoluteUri); 17. letter = drive.Mount(0, DriveMountOptions.None); 18. } 19. finally 20. { 21. files = new DirectoryInfo(drive.LocalPath).GetFiles(); 22. drive.Unmount(); 23. } 24. ViewBag.Message = String.Format("Azure Drive mounted on: {0}", letter); 25. 26. return View(files); 27. } 9
  • 11. Ссылки и материалы Differences Between the Storage Emulator and Windows Azure Storage Services: http://msdn.microsoft.com/en-us/gg433135 Windows Azure Drive whitepaper: http://go.microsoft.com/?linkid=9710117 11