DZone
Cloud Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Cloud Zone > How to Use the Storage Emulator with the Windows Azure SDK for PHP

How to Use the Storage Emulator with the Windows Azure SDK for PHP

Brian Swan user avatar by
Brian Swan
·
Apr. 23, 11 · Cloud Zone · News
Like (0)
Save
Tweet
9.18K Views

Join the DZone community and get the full member experience.

Join For Free

This is a short post to address this question: How do I use the local Storage Emulator (formerly known as Development Storage) when using the Windows Azure SDK for PHP? The Windows Azure Command Line Tools for PHP provide an option for running an application locally in the Compute Emulator, but I didn’t see an option for using the local Storage Emulator.  As it turns out, the answer is very simple, although somewhat difficult to find…

When constructing a new table, blob, or queue client, simply omit the constructor parameters:

// Create table, blob, and queue clients
// that use local development storage.
$tableClient = new Microsoft_WindowsAzure_Storage_Table();
$blobClient = new Microsoft_WindowsAzure_Storage_Blob();
$queueClient = new Microsoft_WindowsAzure_Storage_Queue();


Assuming you have installed all the prerequisites for using the Windows Azure SDK for PHP, that’s it. (You will have to start the Compute Emulator and Development Storage before testing your application.) The SDK has all the plumbing for utilizing the Storage Emulator. (I spent quite a bit of time trying to tweak Azure config files to get an application to use the Storage Emulator before realizing this.)

Testing an Azure application will have multiple phases, but initially testing against the local storage will save some storage costs. For more information about developing, testing, and deploying PHP applications to Windows Azure, check out these links:

  • Differences between the Compute Emulator and Windows Azure
  • Differences between the Storage Emulator and Windows Azure Storage Services
  • Deploying Your First PHP Application with the Windows Azure Command Line Tools for PHP
  • Accessing Windows Azure Table Storage from PHP
  • Accessing Windows Azure Blob Storage from PHP
  • Accessing Windows Azure Queues from PHP


Thanks.

-Brian

PHP Software development kit azure

Published at DZone with permission of Brian Swan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Integrate Third-Party Login Systems in Your Web App Using OAuth 2.0
  • The Evolution of Configuration Management: IaC vs. GitOps
  • Stupid Things Orgs Do That Kill Productivity w/ Netflix, FloSports & Refactoring.club
  • What Is ERP Testing? - A Brief Guide

Comments

Cloud Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo