PHP	
  Azure
A	
  brand	
  new	
  day

in 2 it
Michelangelo	
  van	
  Dam

PHP	
  Consultant

Community	
  
Leader

email:	
  michelangelo@in2it.be	
  
twi;er:	
  @drago...
#phpazure

in 2 it
Why	
  Windows	
  Azure?
‣ PHP	
  Developer	
  

‣ Write	
  web	
  applicaFons	
  
‣ Want	
  to	
  deploy	
  fast	
  and	
...
Azure	
  for	
  PHP	
  devs
‣ Supports	
  most	
  common	
  PHP	
  frameworks	
  
‣ Symfony,	
  Zend	
  Framework,	
  Sile...
Move	
  to	
  the	
  cloud

in 2 it
Or	
  more	
  complex
Centric Architecture
Application 3
2

Database

at
ic

Application 1

Database

Log

L

Storage
A
Ca...
Windows	
  Azure	
  Stack
Custom
Ready to go
Technology
Services
Data
Storage

Blob

Tables

Queue

CDN

Cache
in 2 it
Azure	
  SDK	
  for	
  PHP
‣ Contents	
  

‣ PHP	
  client	
  libraries	
  for	
  Windows	
  Azure	
  
‣ Command	
  line	
...
SDK	
  for	
  PHP
‣ WindowsAzure	
  

‣ Blob	
  
‣ Common	
  
‣ Queue	
  
‣ ServiceBus	
  
‣ ServiceManagement	
  
‣ Servi...
SDK	
  installaFon

Composer

PEAR

GIT

$	
  svn	
  export	
  h:ps://github.com/WindowsAzure/azure-­‐sdk-­‐for-­‐
php/tru...
PEAR	
  dependencies
‣ HTTP_Request2	
  
‣ Mail_mime	
  
‣ Mail_mimeDecode

in 2 it
Windows	
  Azure

Websites

Virtual	
  Machines

CDN
Mobile
Storage

Cloud	
  Services

QA

VPN
SLA

SSL
Big	
  Data
Media...
Azure	
  Websites

in 2 it
The	
  quickest	
  way	
  to	
  deploy	
  
to	
  the	
  cloud

in 2 it
Requirements
‣ A	
  PHP	
  project	
  
‣ A	
  version	
  control	
  system	
  

‣ local	
  (GIT,	
  Subversion,	
  TFS,	
 ...
One	
  important	
  thing!
‣ DocumentRoot	
  in	
  project	
  subdir	
  
‣ e.g.	
  public/index.php	
  

‣ Requirement	
  ...
in 2 it
Virtual	
  Machines

in 2 it
AlternaFve	
  way	
  to	
  achieve	
  
cloud	
  power

in 2 it
Usages
‣ Run	
  arbitrary	
  processes	
  
‣ e.g.	
  cron	
  processes	
  

‣ Provide	
  uFlity	
  services	
  
‣ e.g.	
  ...
in 2 it
Cloud	
  Services

in 2 it
I	
  was	
  clueless

:-(

?
?

?
in 2 it
Background
‣ Coming	
  from	
  a	
  UNIX/Linux	
  environment	
  
‣ Worked	
  as	
  system	
  administrator	
  
‣ Wrote	
 ...
Figuring	
  it	
  out
‣ Web	
  Role	
  

‣ A	
  web	
  site	
  or	
  service	
  running	
  on	
  the	
  internet	
  
‣ Can...
Why	
  Cloud	
  Services?
‣ All	
  the	
  power	
  of	
  Web	
  Sites	
  
‣ With	
  smart	
  scaling	
  capabiliFes	
  
‣ ...
Command	
  line	
  tools

h;p://www.windowsazure.com/en-­‐us/manage/linux/how-­‐to-­‐guides/command-­‐line-­‐tools/	
  
h;...
Endless	
  posibiliFes
WebApp

WebApp

WorkerApp

WinCache
Blob	
  Storage
Azure	
  SQL

Table	
  Storage

Queues

3rd-­‐p...
DTAP	
  environment
WorkstaHon

Windows	
  
Azure

Windows	
  
Azure

Web	
  Fabric

Staging

ProducHon
in 2 it
Web	
  Role	
  for	
  PHP	
  Local
‣ Start	
  Azure	
  Emulator	
  

‣ PS	
  C:devmyProject>	
  Start-­‐AzureEmulator
Crea...
in 2 it
in 2 it
in 2 it
in 2 it
in 2 it
in 2 it
Storage

in 2 it
Blob	
  storage
‣ Storage	
  for	
  binary	
  large	
  objects	
  (BLOB)	
  
‣ Block	
  blobs	
  (200GB)	
  
‣ Page	
  blo...
Blob	
  Storage	
  overview
image1.jpg
images
My	
  Company

image2.jpg
movies
movie1.mov
in 2 it
Usage	
  of	
  blobs

https://mycompany.blob.core.windows.net/image/image1.jpg	

https://cdn01.mycompany.com/image/image1....
Table	
  storage
‣ Storage	
  of	
  structured	
  data	
  
‣ Oken	
  referred	
  to	
  as	
  NoSQL	
  

‣ Implements	
  tr...
Table	
  Storage	
  overview

name	
  =	
  …

email	
  =	
  …

customer
name	
  =	
  …

email	
  =	
  …

Company
product

...
Accessing	
  Table	
  Store	
  data
‣ Using	
  REST	
  directly	
  

‣ GET	
  h;p://mycompany.table.core.windows.net/
cust...
Queue	
  Storage
‣ FIFO	
  type	
  storage	
  

‣ Processing	
  one	
  item	
  a	
  Fme	
  
‣ Messages	
  in	
  any	
  for...
Queue	
  Storage	
  overview
Email	
  3
Worker	
  
Role

Email	
  2
Email	
  1

Queue

Email	
  1
2

in 2 it
Accessing	
  Queue	
  Messages
‣ Directly	
  with	
  REST	
  
‣ GET	
  h;ps://

mycompany.queue.core.windows.net/
mailToSe...
A	
  lot	
  more…

Infrastructure

Big Data

Web

Mobile

Dev & Test

Media

Storage,	

Backup &	

Recovery

Identity &	

...
Free	
  trial
www.windowsazure.com

in 2 it
YouTube.com/WindowsAzure

in 2 it
Conclusion

in 2 it
Conclusion
‣ PHP	
  for	
  web	
  applicaFon	
  development	
  
‣ WAWS	
  for	
  rapid	
  prototyping	
  
‣ WACS	
  for	
 ...
PHP	
  checklist
‣ Get	
  your	
  prototypes	
  online	
  quickly	
  
‣ Ensure	
  your	
  apps	
  stay	
  online	
  all	
 ...
ited
Lim
✓
No	
  system	
  knowledge	
  necessary!

in 2 it
in 2 it

Michelangelo	
  van	
  Dam	
  
Zend	
  CerFfied	
  Engineer	
  
!

michelangelo@in2it.be
PHP	
  ConsulFng	
  -­‐	
...
CreaFve	
  Commons	
  Credits
‣ sunny	
  clouds:	
  h;p://www.flickr.com/
‣
‣
‣

photos/andyfitz/2340298916	
  
balloon:	
  ...
h:ps://joind.in/9997
If	
  you	
  liked	
  it,	
  thanks!	
  
If	
  not,	
  tell	
  me	
  how	
  to	
  improve
in 2 it
Thank	
  you

in 2 it
Upcoming SlideShare
Loading in …5
×

Php Azure - TrueNorthPHP 2013

6,298 views

Published on

Windows Azure provides many services that are very appealing for PHP developers, especially if you need to get started quickly.
In this talk I give my motivation to try out Windows Azure cloud solutions, and discuss the main features like web sites, virtual machines and cloud services. Combining these features with blob storage, table storage, queues, WinCache, CDN and SSL you can build robust, scalable and very performant web applications and deploy them in just a few minutes.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Php Azure - TrueNorthPHP 2013

  1. 1. PHP  Azure A  brand  new  day in 2 it
  2. 2. Michelangelo  van  Dam PHP  Consultant Community   Leader email:  michelangelo@in2it.be   twi;er:  @dragonbe   facebook:  dragonbe   ! Trainer Contact in 2 it
  3. 3. #phpazure in 2 it
  4. 4. Why  Windows  Azure? ‣ PHP  Developer   ‣ Write  web  applicaFons   ‣ Want  to  deploy  fast  and  safe   ‣ Prototyping   ‣ Not  a  sysadmin   ‣ Don’t  have  Fme  to  worry  about  plaIorms   ‣ Don’t  want  to  worry  about  scalability in 2 it
  5. 5. Azure  for  PHP  devs ‣ Supports  most  common  PHP  frameworks   ‣ Symfony,  Zend  Framework,  Silex,  Slim,  …   ‣ Building  robust  web  applicaFons   ‣ storage  and  CDN   ‣ easy  separaFon  of  responsibiliFes in 2 it
  6. 6. Move  to  the  cloud in 2 it
  7. 7. Or  more  complex Centric Architecture Application 3 2 Database at ic Application 1 Database Log L Storage A Cache Worker Y Storage E Cache R Log Mail Cache Queue Application 5 Proxy Service Layer 4 Web Application E R V Database I C Queue Queue E n Ap pl S Web Application io Proxy at ic Web Application Log pl io n Proxy API Ap Proxy Storage Mail Mail in 2 it
  8. 8. Windows  Azure  Stack Custom Ready to go Technology Services Data Storage Blob Tables Queue CDN Cache in 2 it
  9. 9. Azure  SDK  for  PHP ‣ Contents   ‣ PHP  client  libraries  for  Windows  Azure   ‣ Command  line  tools  for  Mac  &  Linux   ‣ Windows  Azure  powershell  for  Windows   ‣ Windows  Azure  Emulators  for  Windows in 2 it
  10. 10. SDK  for  PHP ‣ WindowsAzure   ‣ Blob   ‣ Common   ‣ Queue   ‣ ServiceBus   ‣ ServiceManagement   ‣ ServiceRunFme   ‣ Table in 2 it
  11. 11. SDK  installaFon Composer PEAR GIT $  svn  export  h:ps://github.com/WindowsAzure/azure-­‐sdk-­‐for-­‐ php/trunk/WindowsAzure  library/WindowsAzure   ! Subversion  Hp in 2 it
  12. 12. PEAR  dependencies ‣ HTTP_Request2   ‣ Mail_mime   ‣ Mail_mimeDecode in 2 it
  13. 13. Windows  Azure Websites Virtual  Machines CDN Mobile Storage Cloud  Services QA VPN SLA SSL Big  Data Media ACL IdenHty   Mgmt in 2 it
  14. 14. Azure  Websites in 2 it
  15. 15. The  quickest  way  to  deploy   to  the  cloud in 2 it
  16. 16. Requirements ‣ A  PHP  project   ‣ A  version  control  system   ‣ local  (GIT,  Subversion,  TFS,  WebDeploy)   ‣ on  line  (GitHub,  Bitbucket,  DropBox)   ‣ AlternaFve  tools   ‣ FTP  deploy   ‣ Using  VisualStudio  or  WebMatrix  to  deploy   ‣ About  15  minutes in 2 it
  17. 17. One  important  thing! ‣ DocumentRoot  in  project  subdir   ‣ e.g.  public/index.php   ‣ Requirement  for  web.config <rule name="GoPub" patternSyntax="Wildcard"> <match url="*" />     <action type="Rewrite" url="public/index.php" /> </rule> in 2 it
  18. 18. in 2 it
  19. 19. Virtual  Machines in 2 it
  20. 20. AlternaFve  way  to  achieve   cloud  power in 2 it
  21. 21. Usages ‣ Run  arbitrary  processes   ‣ e.g.  cron  processes   ‣ Provide  uFlity  services   ‣ e.g.  forward  proxy   ‣ Cloud  OS   ‣ Windows,  SQL  Server  or  Linux  in  the  cloud in 2 it
  22. 22. in 2 it
  23. 23. Cloud  Services in 2 it
  24. 24. I  was  clueless :-( ? ? ? in 2 it
  25. 25. Background ‣ Coming  from  a  UNIX/Linux  environment   ‣ Worked  as  system  administrator   ‣ Wrote  tools  in  Perl  (yeah,  I  know)   ‣ Used  to  Cron,  Shell,  CGI  and  Daemons   ‣ Worked  with  Windows  IIS   ‣ Never  had  to  set  things  up   ‣ Used  FTP  to  deploy  on  the  system   ‣ Never  knew  the  fact  it  was  a  web  role  in  IIS in 2 it
  26. 26. Figuring  it  out ‣ Web  Role   ‣ A  web  site  or  service  running  on  the  internet   ‣ Can  use  all  Windows  Azure  services   ‣ Worker  Role   ‣ Runs  processes  in  the  background   ‣ Can  use  all  Windows  Azure  services in 2 it
  27. 27. Why  Cloud  Services? ‣ All  the  power  of  Web  Sites   ‣ With  smart  scaling  capabiliFes   ‣ Memcache  like  caching  layer  per  instance   ‣ Staging/ProducFon  environments   ‣ With  smart  swapping   ‣ Allows  controlled  automated  deployments in 2 it
  28. 28. Command  line  tools h;p://www.windowsazure.com/en-­‐us/manage/linux/how-­‐to-­‐guides/command-­‐line-­‐tools/   h;p://msdn.microsok.com/en-­‐us/library/windowsazure/jj156055.aspx in 2 it
  29. 29. Endless  posibiliFes WebApp WebApp WorkerApp WinCache Blob  Storage Azure  SQL Table  Storage Queues 3rd-­‐party  MySQL in 2 it
  30. 30. DTAP  environment WorkstaHon Windows   Azure Windows   Azure Web  Fabric Staging ProducHon in 2 it
  31. 31. Web  Role  for  PHP  Local ‣ Start  Azure  Emulator   ‣ PS  C:devmyProject>  Start-­‐AzureEmulator Creating local package... Starting Emulator... Role is running at http://127.0.0.1:81 Started in 2 it
  32. 32. in 2 it
  33. 33. in 2 it
  34. 34. in 2 it
  35. 35. in 2 it
  36. 36. in 2 it
  37. 37. in 2 it
  38. 38. Storage in 2 it
  39. 39. Blob  storage ‣ Storage  for  binary  large  objects  (BLOB)   ‣ Block  blobs  (200GB)   ‣ Page  blobs  (1TB)   ‣ Unlimited  storage  capacity   ‣ Content  delivery  network  (CDN)   ‣ HTTP  and  HTTPS  support   ‣ CNAME  support   ‣ To  integrate  within  your  own  domain
 (e.g.  blob.mycompany.com)   ‣ Data  replicaFon in 2 it
  40. 40. Blob  Storage  overview image1.jpg images My  Company image2.jpg movies movie1.mov in 2 it
  41. 41. Usage  of  blobs https://mycompany.blob.core.windows.net/image/image1.jpg https://cdn01.mycompany.com/image/image1.jpg in 2 it
  42. 42. Table  storage ‣ Storage  of  structured  data   ‣ Oken  referred  to  as  NoSQL   ‣ Implements  tree-­‐like  data  storage  and   ‣ ‣ retrieval   Scalable  and  replicated   Supports  OData  protocol in 2 it
  43. 43. Table  Storage  overview name  =  …
 email  =  … customer name  =  …
 email  =  … Company product code  =  …
 price  =  … in 2 it
  44. 44. Accessing  Table  Store  data ‣ Using  REST  directly   ‣ GET  h;p://mycompany.table.core.windows.net/ customer   ‣ Using  SDK   ‣ h;ps://github.com/WindowsAzure/azure-­‐sdk-­‐ for-­‐php in 2 it
  45. 45. Queue  Storage ‣ FIFO  type  storage   ‣ Processing  one  item  a  Fme   ‣ Messages  in  any  format  of  64KB   ‣ Useful  for  deferred  acFons   ‣ Resize  of  images   ‣ Sending  out  mails   ‣… in 2 it
  46. 46. Queue  Storage  overview Email  3 Worker   Role Email  2 Email  1 Queue Email  1 2 in 2 it
  47. 47. Accessing  Queue  Messages ‣ Directly  with  REST   ‣ GET  h;ps:// mycompany.queue.core.windows.net/ mailToSend   ‣ Indirectly  using  SDK   ‣ h;ps://github.com/WindowsAzure/azure-­‐sdk-­‐ for-­‐php in 2 it
  48. 48. A  lot  more… Infrastructure Big Data Web Mobile Dev & Test Media Storage, Backup & Recovery Identity & Access Management in 2 it
  49. 49. Free  trial www.windowsazure.com in 2 it
  50. 50. YouTube.com/WindowsAzure in 2 it
  51. 51. Conclusion in 2 it
  52. 52. Conclusion ‣ PHP  for  web  applicaFon  development   ‣ WAWS  for  rapid  prototyping   ‣ WACS  for  scaling  web  apps  and  workers   ‣ WAVM  for  proxy,  tooling  and  scheduling in 2 it
  53. 53. PHP  checklist ‣ Get  your  prototypes  online  quickly   ‣ Ensure  your  apps  stay  online  all  the  Fme   ‣ Distribute  responsibiliFes   ‣ Integrate  3rd-­‐party  soluFons  easily in 2 it
  54. 54. ited Lim ✓ No  system  knowledge  necessary! in 2 it
  55. 55. in 2 it Michelangelo  van  Dam   Zend  CerFfied  Engineer   ! michelangelo@in2it.be PHP  ConsulFng  -­‐  QA  Audits  -­‐  Training  Courses   ! www.in2it.be in 2 it
  56. 56. CreaFve  Commons  Credits ‣ sunny  clouds:  h;p://www.flickr.com/ ‣ ‣ ‣ photos/andyfitz/2340298916   balloon:  h;p://www.flickr.com/photos/ ashraful/5836601848   flight:  h;p://www.flickr.com/photos/ unfinishedportrait/7712845996   train:  h;p://www.flickr.com/photos/ nomadic_lass/8508000688   in 2 it
  57. 57. h:ps://joind.in/9997 If  you  liked  it,  thanks!   If  not,  tell  me  how  to  improve in 2 it
  58. 58. Thank  you in 2 it

×