SlideShare une entreprise Scribd logo
1  sur  33
Advanced Cloud Services
Development (PaaS)
 Vitor Ciaramella                  Azure Summit Brazil 2013
 Technical Evangelist, Microsoft
 http://vic.ms
http://vic.ms
Cloud Services
User environment           Internet environment
                                                                                              CNAME
Users              Apps /                                                    DNS              www.myapp.net
                   Browsers                                                 Server            myapp.cloudapp.net
                                                                                              50.63.202.28
                 www.myapp.com

Dev. environment           Windows Azure environment
                                                                                      Load                endpoints

                                                                                     Balance
Developer
                                                                                        r

                MyAp           Cloud Service myapp
                                                                                                                      MyAp                  MyAp       MyAp
                 p                                                                                                     p
                                                                                                                      .csconfi
                                                                                                                                             p          p
                .csdef                 MyAp     .csde   .csconfi   Production
                                                                   myapp
                                                                                                                         g
                                                                                                                                            .csconfi
                                                                                                                                               g
                                                                                                                                                       .csconfi
                                                                                                                                                          g
                                        p          f       g                                                      Dis                       Dis        Dis
                            Deploy                                                                                 k                         k          k
                .csconfi                                           Staging                                                       MyAp
                                                                   3f2504e0-4f89-11d3-9a0c-0305e82c3301                           p
                   g                                                                                                             .csconfi
                                                                                                                                    g
                                                                                                                                 Dis
                                              Dis                                                                                 k
                              Endpoints        k
                              definitions   VM Image HW Specs
http://vic.ms
Automate
 Cloud              d
 Service            Stateless
 s              =   Virtual
                    Machines
http://vic.ms
Average usage of Cloud Services




New applications   Existing web applications



http://vic.ms
Advanced Scenarios
  Windows Services, Console or GUI applications
   including Tomcat, JBoss, Lucene, Solr, Apache, Hadoop, and etc.



  Specific Windows Server / IIS configuration
   including hosts file, Registry, IIS Media Services, multiple SSL Certificates,
   custom IIS AppPool, and etc.




http://vic.ms
Challenges
  Installation, Setup and Configuration


  Stateful Memory


  Stateful Disk




http://vic.ms
Installation, Setup
and Configuration

http://vic.ms
Install, Setup, Config: possible
solutions
  Use the VM Role
   Create a local VHD with Windows Server
   Install, setup and configure your application and server
   Upload the VHD as a VM Role disk image

  Automate the installation, the setup and configuration
   Create an script/code to automate the installation, the setup and configuration
   Run it with
       Startup Tasks
       Role.OnStart
       Role.Run



http://vic.ms
Automate the installation
  It depends on the installer technology.
  Some applications can be installed simply by copying their files…


  For Windows Installer:
  msiexec.exe /qn /i SQLSysClrTypes.msi /l*v log.txt




http://vic.ms
Automate the setup / configuration
  It depends on the application.
  Some applications can configured simply by overwriting their config files…


  For the Windows Registry:
      regedit MyRegistryEntriesToBeImported.reg



  For IIS:
      %windir%system32inetsrvappcmd set config -section:applicationPools
      -applicationPoolDefaults.processModel.idleTimeout:00:00:00




http://vic.ms
Automate the setup / configuration
 Most Windows Server and IIS configurations can be also changed by using:
 Powershell
     PS IIS:SitesDemoSiteDemoApp> set-webconfiguration
     "/system.webServer/handlers/add[@path='*.aspx']/@path“
     -value "*.mspx“

 .NET Managed APIs:
        using (var serverManager = new ServerManager())
        {
            var bindingInfo = "*:443:ssl2.myapp.com";
            var certStore = (new X509Store(StoreName.My, StoreLocation.LocalMachine)).Name;
            var site = serverManager.Sites["MySite"];
            if (site != null)
            {
                var binding = site.Bindings.Add(bindingInfo, certHash, certStore);
                binding.SetAttributeValue("sslFlags", 1);
                serverManager.CommitChanges();
            }
        }
http://vic.ms
Running the automated script/code
  Startup Tasks
     Simple: Synchronous execution, one-by-one
     Foreground: Asynchronous execution, keeps the role running
     Background: Asynchronous execution, does not keep the role running


   <Startup>
        <Task taskType="simple" commandLine="startupstartup.cmd" executionContext="elevated">
          <Environment>
            <Variable name="azurestoragename" value="mystorage" />
          </Environment>
        </Task>
   </Startup>



http://vic.ms
Running the automated script/code
  Role, RoleEntryPoint
     OnStart: Role stays busy until completion (doesn’t receive requests), up to 15 minutes
     Run: Role recycles when exit this method (so, keep it running). Ready to receive requests.
     OnStop: Before role stops (clean up), up to 30 seconds

  Execution Context:
     <Runtime executionContext="elevated“ />




http://vic.ms
Stateful Memory

http://vic.ms
Stateful Memory: possible solutions
  Rewrite/change your code to not reuse state from subsequent requests


  Rewrite/change your code to save the state in a persistent or semi-persistent
  storage
    Use Blob or Table Storage
    Use SQL Database
    Use Windows Azure Caching (recommended)




http://vic.ms
Stateful Memory with Azure Caching
  Add the references to the Azure Caching assemblies.
  Edit your web.config or app.config file with:
    <dataCacheClients>
     <dataCacheClient name="default" maxConnectionsToServer="1">
        <hosts>
           <host name=“myapp.cache.windows.net" cachePort="22233" />
        </hosts>
        <securityProperties mode="Message">
           <messageSecurity authorizationInfo="YWNzOmh0dHBzOi8vdG…">
           </messageSecurity>
        </securityProperties>
     </dataCacheClient>
  </dataCacheClients>
http://vic.ms
Stateful Memory with Azure Caching
  To automatically save the ASP.NET session on the Azure Caching, edit your
  web.config with:
  <configuration>
    <system.web>
      <sessionState mode="Custom" customProvider="DistributedSessionProvider"
                                  compressionEnabled="false">
        <providers>
          <add name="DistributedSessionProvider"
  type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider,Microsoft
  .Web.DistributedCache" cacheName="default" applicationName=“MyApp" useBlobMode="false"/>
        </providers>
      </sessionState>
    </system.web>
  </configuration>

http://vic.ms
Stateful Memory with Azure Caching
  Access the Azure Caching programmatically, if you need:

  var   cacheFactory = new DataCacheFactory();
  var   myCache = cacheFactory.GetDefaultCache();
  var   key = "DataAtual";
  var   cachedObject = myCache.Get(key);

  if (cachedObject != null)
  {
      var value = (DateTime) cachedObject;
  }
  else
  {
      var value = DateTime.Now.Date;
      myCache.Put(key, value, TimeSpan.FromSeconds(15));
  }


http://vic.ms
Stateful Disk

http://vic.ms
Stateful Disk: possible solutions
  Rewrite/change your code to save the state in a persistent storage
   Use Blob or Table Storage (recommended)
   Use SQL Database
   Use Azure Drive




http://vic.ms
Stateful Disk with Azure Drive
  Create a VHD and store it in the Blob Storage.
  Mount the VHD as local drive in each instance.
  Attention: Only one instance can mount it with Read/Write access.


                MyApp           MyApp               MyApp       MyApp
                .csconfig        .csconfig          .csconfig   .csconfig

                Disk             Disk                   Disk    Disk
                Disk             Disk               Disk        Disk



                            Blob Storage     Disk.vhd
http://vic.ms
Stateful Disk with Azure Drive
  Sample Solr/Lucene scenario

       Cloud Service           Cloud Service         Cloud Service
         Instance                Instance              Instance


         Query                   Query                Query
                Read only          Read only              Read only

                                                                                   VM
         Disk                    Disk                 Disk
                                                                                  Index
                                                                                   Read write


                                                                      R/W Mount
                            Blob Storage       Disk.vhd                           Disk

http://vic.ms
Stateful Disk with Azure Drive
  How to mount a read-only (snapshotted) drive:
    var localResource = RoleEnvironment.GetLocalResource("LocalDriveCache");
    CloudDrive.InitializeCache(localResource.RootPath, localResource.MaximumSizeInMegabytes);
    var storageAccount = CloudStorageAccount.FromConfigurationSetting(“LuceneVHDs");
    var client = storageAccount.CreateCloudBlobClient();
    var container = new CloudBlobContainer("vhds", client);
    var pageBlob = container.GetPageBlobReference(“lucene.vhd");
    var drive = new CloudDrive(pageBlob.Uri, storageAccount.Credentials);
    drive = new CloudDrive(drive.Snapshot(), storageAccount.Credentials);
    var driveLetter = drive.Mount(localResource.MaximumSizeInMegabytes, DriveMountOptions.None);
    //e.g.: driveLetter = “H:”


http://vic.ms
Stateful Disk with Azure Drive
  Delete the snapshot after using it (Role.OnStop)
  Use additional logic to “clean-up” unused/old snapshots.
  How to list snapshots of a blob:
    var pageBlob = container.GetPageBlobReference(“lucene.vhd");
    var snapshots = container.ListBlobs(new BlobRequestOptions()
                    {
                        BlobListingDetails = BlobListingDetails.Snapshots,
                        UseFlatBlobListing = true,
                    }).OfType<CloudPageBlob>().Where((blob) => blob.SnapshotTime.HasValue &&
    blob.Uri.Equals(pageBlob.Uri)).OrderByDescending((blob)=>blob.SnapshotTime).ToList();



http://vic.ms
Automated
Configuration and
Monitoring

http://vic.ms
Automated Configuration
  Role.OnStart
    RoleEnvironment.Changing += RoleEnvironment_Changing;



  Role
    void RoleEnvironment_Changing(object sender, RoleEnvironmentChangingEventArgs e)
    {
           MyApplyChanges(e.Changes);
                e.Cancel = MyCheckIfNeedsToReboot();
    }




http://vic.ms
Automated Monitoring
  Role.OnStart
    RoleEnvironment.StatusCheck += RoleEnvironment_StatusCheck;



  Role
    void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
    {
           var isHealthy = CheckMyHealth();
                if (!isHealthy) e.SetBusy();
    }




http://vic.ms
Other Tips

http://vic.ms
Reduce the size of the Package
  Put static files (images, videos, JavaScript, CSS) in the Blob Storage. Adjust
  the URLs to these resources.


  Put installers and large executables in the Blob Storage. Download these
  files locally using Startup Tasks / Role.OnStart




http://vic.ms
Prefer Async Processing
  Use the Queue Storage or Service Bus (Queues, Topics and Notification
  Hub) to distribute work and scale processing


  Use the .NET framework 4.5 parallel and async features




http://vic.ms
Proactive Caching
  All instances read from the cache
  One instance is responsible to update the cache periodically




http://vic.ms
Distribute Users and Content
  Use CDN to distribute and cache the content (Blobs / Web Roles)
  Use the Traffic Manager to direct users to the closest datacenter




http://vic.ms
Advanced Cloud Services
Development (PaaS)
 Vitor Ciaramella                  Azure Summit Brazil 2013
 Technical Evangelist, Microsoft
 http://vic.ms
http://vic.ms

Contenu connexe

En vedette

Digital transformation - DevOps Day - 02/02/2017
Digital transformation - DevOps Day - 02/02/2017Digital transformation - DevOps Day - 02/02/2017
Digital transformation - DevOps Day - 02/02/2017Clara Feuillet
 
Identity Management for Office 365 and Microsoft Azure
Identity Management for Office 365 and Microsoft AzureIdentity Management for Office 365 and Microsoft Azure
Identity Management for Office 365 and Microsoft AzureSparkhound Inc.
 
Microsoft Azure Platform-as-a-Service (PaaS)
Microsoft Azure Platform-as-a-Service (PaaS)Microsoft Azure Platform-as-a-Service (PaaS)
Microsoft Azure Platform-as-a-Service (PaaS)Chris Dufour
 
PaaS is dead, Long live PaaS - Defrag 2016
PaaS is dead, Long live PaaS - Defrag 2016PaaS is dead, Long live PaaS - Defrag 2016
PaaS is dead, Long live PaaS - Defrag 2016brendandburns
 
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure FunctionsChris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure FunctionsServerlessConf
 
How and why to design your Teams for modern Software Systems - Matthew Skelto...
How and why to design your Teams for modern Software Systems - Matthew Skelto...How and why to design your Teams for modern Software Systems - Matthew Skelto...
How and why to design your Teams for modern Software Systems - Matthew Skelto...Skelton Thatcher Consulting Ltd
 
What's new in SQL Server 2016
What's new in SQL Server 2016What's new in SQL Server 2016
What's new in SQL Server 2016James Serra
 

En vedette (9)

Digital transformation - DevOps Day - 02/02/2017
Digital transformation - DevOps Day - 02/02/2017Digital transformation - DevOps Day - 02/02/2017
Digital transformation - DevOps Day - 02/02/2017
 
Identity Management for Office 365 and Microsoft Azure
Identity Management for Office 365 and Microsoft AzureIdentity Management for Office 365 and Microsoft Azure
Identity Management for Office 365 and Microsoft Azure
 
Azure cloud governance deck
Azure cloud governance deckAzure cloud governance deck
Azure cloud governance deck
 
Microsoft Azure Platform-as-a-Service (PaaS)
Microsoft Azure Platform-as-a-Service (PaaS)Microsoft Azure Platform-as-a-Service (PaaS)
Microsoft Azure Platform-as-a-Service (PaaS)
 
PaaS is dead, Long live PaaS - Defrag 2016
PaaS is dead, Long live PaaS - Defrag 2016PaaS is dead, Long live PaaS - Defrag 2016
PaaS is dead, Long live PaaS - Defrag 2016
 
Azure Websites
Azure WebsitesAzure Websites
Azure Websites
 
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure FunctionsChris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
 
How and why to design your Teams for modern Software Systems - Matthew Skelto...
How and why to design your Teams for modern Software Systems - Matthew Skelto...How and why to design your Teams for modern Software Systems - Matthew Skelto...
How and why to design your Teams for modern Software Systems - Matthew Skelto...
 
What's new in SQL Server 2016
What's new in SQL Server 2016What's new in SQL Server 2016
What's new in SQL Server 2016
 

Similaire à Advanced cloud services development (PaaS)

PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundrymartinlippert
 
Cloud Scaling with Memcached
Cloud Scaling with MemcachedCloud Scaling with Memcached
Cloud Scaling with MemcachedGear6
 
Portrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPortrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPatrick Chanezon
 
HC - The Mobile Adventure with Phonegap
HC - The Mobile Adventure with PhonegapHC - The Mobile Adventure with Phonegap
HC - The Mobile Adventure with Phonegaphockeycommunity
 
EWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIsEWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIsRob Tweed
 
Portrait of the Developer As "The Artist" - English Version
Portrait of the Developer As "The Artist" - English VersionPortrait of the Developer As "The Artist" - English Version
Portrait of the Developer As "The Artist" - English VersionPatrick Chanezon
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
Rails web api 开发
Rails web api 开发Rails web api 开发
Rails web api 开发shaokun
 
MetaCDN: Enabling High Performance, Low Cost Content Storage and Delivery via...
MetaCDN: Enabling High Performance, Low Cost Content Storage and Delivery via...MetaCDN: Enabling High Performance, Low Cost Content Storage and Delivery via...
MetaCDN: Enabling High Performance, Low Cost Content Storage and Delivery via...James Broberg
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAmazon Web Services
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAmazon Web Services
 
CommunityOneEast 09 - Dynamic Languages: the next big thing for the JVM or an...
CommunityOneEast 09 - Dynamic Languages: the next big thing for the JVM or an...CommunityOneEast 09 - Dynamic Languages: the next big thing for the JVM or an...
CommunityOneEast 09 - Dynamic Languages: the next big thing for the JVM or an...Chris Richardson
 
Plutext Alfresco Tech Talk
Plutext Alfresco Tech TalkPlutext Alfresco Tech Talk
Plutext Alfresco Tech Talkquyong2000
 
Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Patrick Chanezon
 
Cloud Foundry Meetup Stuttgart 2017 - Spring Cloud Development
Cloud Foundry Meetup Stuttgart 2017 - Spring Cloud DevelopmentCloud Foundry Meetup Stuttgart 2017 - Spring Cloud Development
Cloud Foundry Meetup Stuttgart 2017 - Spring Cloud DevelopmentAndreas Falk
 
Deploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoDeploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoNyros Technologies
 

Similaire à Advanced cloud services development (PaaS) (20)

PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundry
 
Vaadin += GWT
Vaadin += GWTVaadin += GWT
Vaadin += GWT
 
Cloud Scaling with Memcached
Cloud Scaling with MemcachedCloud Scaling with Memcached
Cloud Scaling with Memcached
 
Portrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPortrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour Sofia
 
RubyConf Brazil 2011
RubyConf Brazil 2011RubyConf Brazil 2011
RubyConf Brazil 2011
 
HC - The Mobile Adventure with Phonegap
HC - The Mobile Adventure with PhonegapHC - The Mobile Adventure with Phonegap
HC - The Mobile Adventure with Phonegap
 
EWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIsEWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIs
 
Portrait of the Developer As "The Artist" - English Version
Portrait of the Developer As "The Artist" - English VersionPortrait of the Developer As "The Artist" - English Version
Portrait of the Developer As "The Artist" - English Version
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Rails web api 开发
Rails web api 开发Rails web api 开发
Rails web api 开发
 
GlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium ParisGlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium Paris
 
Deploy like a pro!
Deploy like a pro!Deploy like a pro!
Deploy like a pro!
 
MetaCDN: Enabling High Performance, Low Cost Content Storage and Delivery via...
MetaCDN: Enabling High Performance, Low Cost Content Storage and Delivery via...MetaCDN: Enabling High Performance, Low Cost Content Storage and Delivery via...
MetaCDN: Enabling High Performance, Low Cost Content Storage and Delivery via...
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 
CommunityOneEast 09 - Dynamic Languages: the next big thing for the JVM or an...
CommunityOneEast 09 - Dynamic Languages: the next big thing for the JVM or an...CommunityOneEast 09 - Dynamic Languages: the next big thing for the JVM or an...
CommunityOneEast 09 - Dynamic Languages: the next big thing for the JVM or an...
 
Plutext Alfresco Tech Talk
Plutext Alfresco Tech TalkPlutext Alfresco Tech Talk
Plutext Alfresco Tech Talk
 
Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012
 
Cloud Foundry Meetup Stuttgart 2017 - Spring Cloud Development
Cloud Foundry Meetup Stuttgart 2017 - Spring Cloud DevelopmentCloud Foundry Meetup Stuttgart 2017 - Spring Cloud Development
Cloud Foundry Meetup Stuttgart 2017 - Spring Cloud Development
 
Deploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoDeploying Rails Apps with Capistrano
Deploying Rails Apps with Capistrano
 

Plus de Vitor Ciaramella

Business Process Management (BPM) CBOK - Microsoft - Vitor Ciaramella
Business Process Management (BPM) CBOK - Microsoft - Vitor CiaramellaBusiness Process Management (BPM) CBOK - Microsoft - Vitor Ciaramella
Business Process Management (BPM) CBOK - Microsoft - Vitor CiaramellaVitor Ciaramella
 
Oportunidades de negócio na Plataforma Microsoft
Oportunidades de negócio na Plataforma MicrosoftOportunidades de negócio na Plataforma Microsoft
Oportunidades de negócio na Plataforma MicrosoftVitor Ciaramella
 
Microsoft research e inovação
Microsoft research e inovaçãoMicrosoft research e inovação
Microsoft research e inovaçãoVitor Ciaramella
 
Windows Azure 8/8 - Como continuar aprendendo
Windows Azure 8/8 - Como continuar aprendendoWindows Azure 8/8 - Como continuar aprendendo
Windows Azure 8/8 - Como continuar aprendendoVitor Ciaramella
 
Windows Azure 7/8 - Benefícios da Parceria Microsoft
Windows Azure 7/8 - Benefícios da Parceria MicrosoftWindows Azure 7/8 - Benefícios da Parceria Microsoft
Windows Azure 7/8 - Benefícios da Parceria MicrosoftVitor Ciaramella
 
Windows Azure 5/8 - Recursos adicionais do Windows Azure
Windows Azure 5/8 - Recursos adicionais do Windows AzureWindows Azure 5/8 - Recursos adicionais do Windows Azure
Windows Azure 5/8 - Recursos adicionais do Windows AzureVitor Ciaramella
 
Windows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureWindows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureVitor Ciaramella
 
Windows Azure 1/8 - Visão geral do Windows Azure
Windows Azure 1/8 - Visão geral do Windows AzureWindows Azure 1/8 - Visão geral do Windows Azure
Windows Azure 1/8 - Visão geral do Windows AzureVitor Ciaramella
 
Windows Azure 0/8 - Treinamento de Windows Azure
Windows Azure 0/8 - Treinamento de Windows AzureWindows Azure 0/8 - Treinamento de Windows Azure
Windows Azure 0/8 - Treinamento de Windows AzureVitor Ciaramella
 

Plus de Vitor Ciaramella (9)

Business Process Management (BPM) CBOK - Microsoft - Vitor Ciaramella
Business Process Management (BPM) CBOK - Microsoft - Vitor CiaramellaBusiness Process Management (BPM) CBOK - Microsoft - Vitor Ciaramella
Business Process Management (BPM) CBOK - Microsoft - Vitor Ciaramella
 
Oportunidades de negócio na Plataforma Microsoft
Oportunidades de negócio na Plataforma MicrosoftOportunidades de negócio na Plataforma Microsoft
Oportunidades de negócio na Plataforma Microsoft
 
Microsoft research e inovação
Microsoft research e inovaçãoMicrosoft research e inovação
Microsoft research e inovação
 
Windows Azure 8/8 - Como continuar aprendendo
Windows Azure 8/8 - Como continuar aprendendoWindows Azure 8/8 - Como continuar aprendendo
Windows Azure 8/8 - Como continuar aprendendo
 
Windows Azure 7/8 - Benefícios da Parceria Microsoft
Windows Azure 7/8 - Benefícios da Parceria MicrosoftWindows Azure 7/8 - Benefícios da Parceria Microsoft
Windows Azure 7/8 - Benefícios da Parceria Microsoft
 
Windows Azure 5/8 - Recursos adicionais do Windows Azure
Windows Azure 5/8 - Recursos adicionais do Windows AzureWindows Azure 5/8 - Recursos adicionais do Windows Azure
Windows Azure 5/8 - Recursos adicionais do Windows Azure
 
Windows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureWindows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows Azure
 
Windows Azure 1/8 - Visão geral do Windows Azure
Windows Azure 1/8 - Visão geral do Windows AzureWindows Azure 1/8 - Visão geral do Windows Azure
Windows Azure 1/8 - Visão geral do Windows Azure
 
Windows Azure 0/8 - Treinamento de Windows Azure
Windows Azure 0/8 - Treinamento de Windows AzureWindows Azure 0/8 - Treinamento de Windows Azure
Windows Azure 0/8 - Treinamento de Windows Azure
 

Dernier

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Dernier (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Advanced cloud services development (PaaS)

  • 1. Advanced Cloud Services Development (PaaS) Vitor Ciaramella Azure Summit Brazil 2013 Technical Evangelist, Microsoft http://vic.ms http://vic.ms
  • 2. Cloud Services User environment Internet environment CNAME Users Apps / DNS www.myapp.net Browsers Server myapp.cloudapp.net 50.63.202.28 www.myapp.com Dev. environment Windows Azure environment Load endpoints Balance Developer r MyAp Cloud Service myapp MyAp MyAp MyAp p p .csconfi p p .csdef MyAp .csde .csconfi Production myapp g .csconfi g .csconfi g p f g Dis Dis Dis Deploy k k k .csconfi Staging MyAp 3f2504e0-4f89-11d3-9a0c-0305e82c3301 p g .csconfi g Dis Dis k Endpoints k definitions VM Image HW Specs http://vic.ms
  • 3. Automate Cloud d Service Stateless s = Virtual Machines http://vic.ms
  • 4. Average usage of Cloud Services New applications Existing web applications http://vic.ms
  • 5. Advanced Scenarios Windows Services, Console or GUI applications including Tomcat, JBoss, Lucene, Solr, Apache, Hadoop, and etc. Specific Windows Server / IIS configuration including hosts file, Registry, IIS Media Services, multiple SSL Certificates, custom IIS AppPool, and etc. http://vic.ms
  • 6. Challenges Installation, Setup and Configuration Stateful Memory Stateful Disk http://vic.ms
  • 8. Install, Setup, Config: possible solutions Use the VM Role Create a local VHD with Windows Server Install, setup and configure your application and server Upload the VHD as a VM Role disk image Automate the installation, the setup and configuration Create an script/code to automate the installation, the setup and configuration Run it with Startup Tasks Role.OnStart Role.Run http://vic.ms
  • 9. Automate the installation It depends on the installer technology. Some applications can be installed simply by copying their files… For Windows Installer: msiexec.exe /qn /i SQLSysClrTypes.msi /l*v log.txt http://vic.ms
  • 10. Automate the setup / configuration It depends on the application. Some applications can configured simply by overwriting their config files… For the Windows Registry: regedit MyRegistryEntriesToBeImported.reg For IIS: %windir%system32inetsrvappcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00 http://vic.ms
  • 11. Automate the setup / configuration Most Windows Server and IIS configurations can be also changed by using: Powershell PS IIS:SitesDemoSiteDemoApp> set-webconfiguration "/system.webServer/handlers/add[@path='*.aspx']/@path“ -value "*.mspx“ .NET Managed APIs: using (var serverManager = new ServerManager()) { var bindingInfo = "*:443:ssl2.myapp.com"; var certStore = (new X509Store(StoreName.My, StoreLocation.LocalMachine)).Name; var site = serverManager.Sites["MySite"]; if (site != null) { var binding = site.Bindings.Add(bindingInfo, certHash, certStore); binding.SetAttributeValue("sslFlags", 1); serverManager.CommitChanges(); } } http://vic.ms
  • 12. Running the automated script/code Startup Tasks Simple: Synchronous execution, one-by-one Foreground: Asynchronous execution, keeps the role running Background: Asynchronous execution, does not keep the role running <Startup> <Task taskType="simple" commandLine="startupstartup.cmd" executionContext="elevated"> <Environment> <Variable name="azurestoragename" value="mystorage" /> </Environment> </Task> </Startup> http://vic.ms
  • 13. Running the automated script/code Role, RoleEntryPoint OnStart: Role stays busy until completion (doesn’t receive requests), up to 15 minutes Run: Role recycles when exit this method (so, keep it running). Ready to receive requests. OnStop: Before role stops (clean up), up to 30 seconds Execution Context: <Runtime executionContext="elevated“ /> http://vic.ms
  • 15. Stateful Memory: possible solutions Rewrite/change your code to not reuse state from subsequent requests Rewrite/change your code to save the state in a persistent or semi-persistent storage Use Blob or Table Storage Use SQL Database Use Windows Azure Caching (recommended) http://vic.ms
  • 16. Stateful Memory with Azure Caching Add the references to the Azure Caching assemblies. Edit your web.config or app.config file with: <dataCacheClients> <dataCacheClient name="default" maxConnectionsToServer="1"> <hosts> <host name=“myapp.cache.windows.net" cachePort="22233" /> </hosts> <securityProperties mode="Message"> <messageSecurity authorizationInfo="YWNzOmh0dHBzOi8vdG…"> </messageSecurity> </securityProperties> </dataCacheClient> </dataCacheClients> http://vic.ms
  • 17. Stateful Memory with Azure Caching To automatically save the ASP.NET session on the Azure Caching, edit your web.config with: <configuration> <system.web> <sessionState mode="Custom" customProvider="DistributedSessionProvider" compressionEnabled="false"> <providers> <add name="DistributedSessionProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider,Microsoft .Web.DistributedCache" cacheName="default" applicationName=“MyApp" useBlobMode="false"/> </providers> </sessionState> </system.web> </configuration> http://vic.ms
  • 18. Stateful Memory with Azure Caching Access the Azure Caching programmatically, if you need: var cacheFactory = new DataCacheFactory(); var myCache = cacheFactory.GetDefaultCache(); var key = "DataAtual"; var cachedObject = myCache.Get(key); if (cachedObject != null) { var value = (DateTime) cachedObject; } else { var value = DateTime.Now.Date; myCache.Put(key, value, TimeSpan.FromSeconds(15)); } http://vic.ms
  • 20. Stateful Disk: possible solutions Rewrite/change your code to save the state in a persistent storage Use Blob or Table Storage (recommended) Use SQL Database Use Azure Drive http://vic.ms
  • 21. Stateful Disk with Azure Drive Create a VHD and store it in the Blob Storage. Mount the VHD as local drive in each instance. Attention: Only one instance can mount it with Read/Write access. MyApp MyApp MyApp MyApp .csconfig .csconfig .csconfig .csconfig Disk Disk Disk Disk Disk Disk Disk Disk Blob Storage Disk.vhd http://vic.ms
  • 22. Stateful Disk with Azure Drive Sample Solr/Lucene scenario Cloud Service Cloud Service Cloud Service Instance Instance Instance Query Query Query Read only Read only Read only VM Disk Disk Disk Index Read write R/W Mount Blob Storage Disk.vhd Disk http://vic.ms
  • 23. Stateful Disk with Azure Drive How to mount a read-only (snapshotted) drive: var localResource = RoleEnvironment.GetLocalResource("LocalDriveCache"); CloudDrive.InitializeCache(localResource.RootPath, localResource.MaximumSizeInMegabytes); var storageAccount = CloudStorageAccount.FromConfigurationSetting(“LuceneVHDs"); var client = storageAccount.CreateCloudBlobClient(); var container = new CloudBlobContainer("vhds", client); var pageBlob = container.GetPageBlobReference(“lucene.vhd"); var drive = new CloudDrive(pageBlob.Uri, storageAccount.Credentials); drive = new CloudDrive(drive.Snapshot(), storageAccount.Credentials); var driveLetter = drive.Mount(localResource.MaximumSizeInMegabytes, DriveMountOptions.None); //e.g.: driveLetter = “H:” http://vic.ms
  • 24. Stateful Disk with Azure Drive Delete the snapshot after using it (Role.OnStop) Use additional logic to “clean-up” unused/old snapshots. How to list snapshots of a blob: var pageBlob = container.GetPageBlobReference(“lucene.vhd"); var snapshots = container.ListBlobs(new BlobRequestOptions() { BlobListingDetails = BlobListingDetails.Snapshots, UseFlatBlobListing = true, }).OfType<CloudPageBlob>().Where((blob) => blob.SnapshotTime.HasValue && blob.Uri.Equals(pageBlob.Uri)).OrderByDescending((blob)=>blob.SnapshotTime).ToList(); http://vic.ms
  • 26. Automated Configuration Role.OnStart RoleEnvironment.Changing += RoleEnvironment_Changing; Role void RoleEnvironment_Changing(object sender, RoleEnvironmentChangingEventArgs e) { MyApplyChanges(e.Changes); e.Cancel = MyCheckIfNeedsToReboot(); } http://vic.ms
  • 27. Automated Monitoring Role.OnStart RoleEnvironment.StatusCheck += RoleEnvironment_StatusCheck; Role void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e) { var isHealthy = CheckMyHealth(); if (!isHealthy) e.SetBusy(); } http://vic.ms
  • 29. Reduce the size of the Package Put static files (images, videos, JavaScript, CSS) in the Blob Storage. Adjust the URLs to these resources. Put installers and large executables in the Blob Storage. Download these files locally using Startup Tasks / Role.OnStart http://vic.ms
  • 30. Prefer Async Processing Use the Queue Storage or Service Bus (Queues, Topics and Notification Hub) to distribute work and scale processing Use the .NET framework 4.5 parallel and async features http://vic.ms
  • 31. Proactive Caching All instances read from the cache One instance is responsible to update the cache periodically http://vic.ms
  • 32. Distribute Users and Content Use CDN to distribute and cache the content (Blobs / Web Roles) Use the Traffic Manager to direct users to the closest datacenter http://vic.ms
  • 33. Advanced Cloud Services Development (PaaS) Vitor Ciaramella Azure Summit Brazil 2013 Technical Evangelist, Microsoft http://vic.ms http://vic.ms