Azure入門(AzureBlobStarage)

74ff7f7a1a9a39552162f29d6b88de1e?s=47 Yuta Kujirai
January 17, 2019
80

 Azure入門(AzureBlobStarage)

74ff7f7a1a9a39552162f29d6b88de1e?s=128

Yuta Kujirai

January 17, 2019
Tweet

Transcript

  1. Azure blob storageͰ੩తͳWebαΠτΛ࡞੒͢Δ

  2. 1.ര଎Ͱ੩తͳwebαΠτΛ࡞੒ • ετϨʔδΞΧ΢ϯτΛ࡞੒ • ੩తͳwebαΠτ༻ͷίϯςφ($web)ͷ࡞੒ • ίϯςφʹσϑΥϧταΠτ(index.html)ͷσϓϩΠ(ϑΝΠϧͷΞοϓϩʔυ) • webαΠτͷσϓϩΠ֬ೝ 2.BLOB+CDNߏ੒Ͱ੩తͳwebαΠτΛ࡞੒

    • CDN ϓϩϑΝΠϧͷ࡞੒ • CDNΤϯυϙΠϯτͷ࡞੒ • webαΠτͷσϓϩΠ֬ೝ
  3. 3.blob storageΛϑΝΠϧαʔόͱͯ͠࢖͏ • ετϨʔδΞΧ΢ϯτͷ࡞੒ • AzureΞΧ΢ϯτͱͷඥ෇͚Λߦ͏

  4. Azure blob storageͱ͸ Կʁ (※ެࣜΑΓҾ༻) Blob Storage ʹ͍ͭͯ ɾMicrosoft ͷΫϥ΢υετϨʔδ

    ɾHTTP/HTTPS ܦ༝Ͱ Blob Storage ಺ͷΦϒδΣΫτ ʹΞΫηε ɾAzure Storage REST APIɺAzure PowerShellɺAzure CLIɺ·ͨ͸ Azure Storage ΫϥΠΞϯτ ϥΠϒϥϦΛ ࢖༻ͯ͠ɺBlob Storage ಺ͷΦϒδΣΫτʹΞΫηε
  5. 1ͷߏ੒ਤ blob storage/web/index.html Πϯλʔωοτ ίϯςϯπΛฦ͢ ΞΫηε

  6. Ϧιʔεͷ࡞੒Λબ୒

  7. Storage AccountΛબ୒

  8. ϦιʔεάϧʔϓɺετϨʔδΞΧ΢ϯτ໊ɺϨϓϦέʔγϣϯΛೖྗ

  9. ϦιʔεάϧʔϓɺετϨʔδΞΧ΢ϯτ໊ɺϨϓϦέʔγϣϯΛೖྗ

  10. ϦιʔεʹҠಈΛΫϦοΫ

  11. ੩తͳWebαΠτΛΫϦοΫ

  12. ༗ޮΛΫϦοΫ

  13. index.html,error.htmlΛೖྗͯ͠อଘ

  14. $webΛΫϦοΫ

  15. Index.htmlΛ࡞੒ <!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>blob static

    site</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/ dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"> </head> <body> <h2 class="text-center mt-3 mb-5”>BLOBͰ੩తαΠτΛ࡞Ε·ͨ͠ʂ</h2> <div class="container"> <div class="mb-5 text-center"> BLOBͰ੩తαΠτΛ࡞Ε·ͨ͠ʂ<br> BLOBͰ੩తαΠτΛ࡞Ε·ͨ͠ʂ </div> </div> </body> </html>
  16. error.htmlΛ࡞੒ <!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>blob static

    site</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/ dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"> </head> <body> <h2 class="text-center mt-3 mb-5”>error.html͕ΈΕͯ·͢ʂ</h2> <div class="container"> <div class="mb-5 text-center"> errorͰ͢Α<br> errorͰ͢Α </div> </div> </body> </html>
  17. ΞοϓϩʔυΛΫϦοΫ

  18. index.htmlͱerror.htmlΛબ୒ͯ͠Ξοϓϩʔυ͢Δ

  19. ετϨʔδΞΧ΢ϯτ὎੩తͳwebαΠτͷ֓ཁͰϓϥΠϚϦΤϯυϙΠϯτΛίϐʔ

  20. ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτʹΞΫηε

  21. ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτͷҟͳΔϑΝΠϧύεʹΞΫηε

  22. BLOB+CDN ߏ੒ $%/ʹ͍ͭͯ ɾCDN͕͋Δ͜ͱͰɺߴ͍ύϑΥʔϚϯεɻ ɹblob storageଆʹෛՙ͕͔͔Βͳ͍ ɹ὎ΞΫηεٸ૿ʹରԠͰ͖Δɻ ɾCDN͸ෳ਺ڌ఺὎৑௕ੑΞοϓ ྫΛ͋͛ΔͱɺBLOB+CDN͸Ұ࣌తʹΞΫηε͕ٸ૿͢ΔΩϟ ϯϖʔϯαΠτͰ࢖͏ͱޮՌతͳߏ੒ͱͳΔɻ

    ʢCDNʹ͍ͭͯͷࢀߟࢿྉɿCDNͰػձଛࣦΛճආʂCDNͷ࢓ ૊Έ͔ΒಋೖޮՌͷࢼࢉ·Ͱ෼͔Γ΍͘͢͝঺հ URL:https://knowledge.sakura.ad.jp/7085/ʣ
  23. 2ͷߏ੒ਤ Πϯλʔωοτ ίϯςϯπΛฦ͢ ΞΫηε blob storage/web/index.html CDN ίϯςϯπ൓ө

  24. Ϧιʔεͷ࡞੒Λબ୒

  25. CDNΛબ୒

  26. ϦιʔεάϧʔϓɺετϨʔδΞΧ΢ϯτ໊ɺϨϓϦέʔγϣϯΛೖྗ Ұҙɿ೚ҙ ඪ४

  27. CDNͷϓϩϑΝΠϧ὎ΤϯυϙΠϯτ὎ΤϯυϙΠϯτͷϗετ໊Λίϐʔ

  28. ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτʹΞΫηε ὎CDN΁ͷ൓ө͸10෼΄Ͳ͔͔Δʢࠓճ͸ඪ४MS※CDNͷछྨʹΑͬͯ൓ө࣌ؒ΋ҧ͏ʣ

  29. 10෼ޙ͘Β͍ʹ࠶౓ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτʹΞΫηε

  30. ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτͷҟͳΔϑΝΠϧύεʹΞΫηε

  31. ࠓճ͸΍Γ·ͤΜ͕ɺڵຯ͕Θ͍ͨΒҎԼ΋ ௐ΂ͯ΍ͬͯΈ͍ͯͩ͘͞ɻ • ࣗ෼Ͱऔಘͨ͠υϝΠϯΛ࢖༻͢Δ https://docs.microsoft.com/ja-jp/azure/storage/blobs/storage-https-custom-domain-cdn • HTTP὎HTTPS΁ͷϦμΠϨΫτ https://docs.microsoft.com/ja-jp/azure/cdn/cdn-rules-engine

  32. blob storageΛ ϑΝΠϧαʔ όͱͯ͠࢖͏ ɾετϨʔδ ΞΧ΢ϯτͷίϯςϯπΛ؆୯ʹ؅ཧ

  33. ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτͷҟͳΔϑΝΠϧύεʹΞΫηε azure storage explorerͰݕࡧ͠ɺμ΢ϯϩʔυΠϯετʔϧ

  34. CDN ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτͷҟͳΔϑΝΠϧύεʹΞΫηε Azure Environment:Azure Λબ୒

  35. CDN ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτͷҟͳΔϑΝΠϧύεʹΞΫηε AzureΞΧ΢ϯτͱͷඥ෇͚Λߦ͏

  36. CDN ϒϥ΢βͰϓϥΠϚϦΤϯυϙΠϯτͷҟͳΔϑΝΠϧύεʹΞΫηε Ξοϓϩʔυ΍μ΢ϯϩʔυ౳ͷૢ࡞ΛGUIͰߦ͑Δ