Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Windows Azure 2/8 - Recursos básicos do Windows Azure

825 views

Published on

  • Link para todos os PPTs do treinamento de Windows Azure:
    http://www.slideshare.net/vitorc/00-treinamento-de-windows-azure
    http://www.slideshare.net/vitorc/01-viso-geral-do-windows-azure
    http://www.slideshare.net/vitorc/02-recursos-bsicos-do-windows-azure
    http://www.slideshare.net/vitorc/03-migrando-uma-aplicao-aspnet-para-windows-azure
    http://www.slideshare.net/vitorc/04-ativando-sua-conta-no-windows-azure
    http://www.slideshare.net/vitorc/windows-azure-58-recursos-adicionais-do-windows-azure
    http://www.slideshare.net/vitorc/06-hands-on-labs
    http://www.slideshare.net/vitorc/windows-azure-78-benefcios-da-parceria-microsoft
    http://www.slideshare.net/vitorc/windows-azure-88-como-continuar-aprendendo
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Windows Azure 2/8 - Recursos básicos do Windows Azure

  1. 1. http://vic.msvitorcia@microsoft.com
  2. 2. var stringDeConexao ="Server=tcp:u06ud2z4qy.database.windows.net;Database=meubancodedados; UserID=vitor@u06ud2z4qy;Password=Pa$$w0rd;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;";using (var conexao = new SqlConnection(stringDeConexao)){ conexao.Open(); using (var comando = conexao.CreateCommand()) { comando.CommandText = "select count(*) from TabelaX"; var resultado = comando.ExecuteScalar(); }}
  3. 3. http://<conta>.blob.core.windows.net/<container>/<nomeDoBlob> Pages/ Conta Container Blob Blocks img01.jpg imagens Block/Page img02.jpg conta Block/Page videos vid1.avi
  4. 4. var stringDeConexao ="DefaultEndpointsProtocol=https;AccountName=techedvc;AccountKey=iqFj1tz09TWhIqfBls++q/cSUNTsklL0Yehxx525LQQb8Cy4IvvIpdsfg+/DMcm+3NHOkA1hS0InGy2A7iug==";var nomeDoContainer = "Arquivos";var nomeDoArquivo = "Pasta1/Pasta2/MeuArquivo.txt";var contaDeStorage = CloudStorageAccount.Parse(stringDeConexao);var clienteDoBlob = contaDeStorage.CreateCloudBlobClient();var container = new CloudBlobContainer(nomeDoContainer.ToLower(),clienteDoBlob);container.CreateIfNotExist();var blobTexto = container.GetBlobReference(nomeDoArquivo.ToLower());blobTexto.UploadText("Conteudo do arquivo");
  5. 5. Memória Rede Disco
  6. 6. <dataCacheClients> <dataCacheClient name="default" maxConnectionsToServer="1"> <hosts> <host name="techedvc.cache.windows.net" cachePort="22233" /> </hosts> <securityProperties mode="Message"> <messageSecurityauthorizationInfo="YWNzOmh0dHBzOi8vdGVjaGVkdmMtY2FjaGUuYWNjZXNzY29udHJvbC53aW5kb3dzLm5ldC9XUkFQdjAuOS8mb3duZXImbWc1ZDUrV1dUSEV1aGlOaUhHQ1VmTHU5a2pqMmxEbC9GMXNlT1lXMVpSND0maHRcDovL3RlY2hlZHZjLmNhY2hlLndpbmRvd3MubmV0"> </messageSecurity> </securityProperties> </dataCacheClient></dataCacheClients>
  7. 7. <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="Contoso"useBlobMode="false"/> </providers> </sessionState> </system.web></configuration>
  8. 8. var cacheFactory = new DataCacheFactory();var meuCache = cacheFactory.GetDefaultCache();var chave = "DataAtual";var objetoCacheado = meuCache.Get(chave);if (objetoCacheado != null){ var valor = (DateTime)objetoCacheado;}else{ var valor = DateTime.Now.Date; meuCache.Put(chave, valor, TimeSpan.FromSeconds(15));}

×