GithubHelp home page GithubHelp logo

tzkmx / storage-blobs-php-quickstart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/storage-blobs-php-quickstart

0.0 1.0 0.0 812 KB

Code for QuickStart article for accessing blobs with PHP

License: MIT License

PHP 100.00%

storage-blobs-php-quickstart's Introduction

services platforms author
storage
php
roygara

Transfer objects to and from Azure Blob storage using PHP

This repository contains a simple sample project to help you getting started with Azure storage using .NET as the development language.

Prerequisites

To complete this tutorial:

To complete this quickstart:

If you don't have an Azure subscription, create a free account before you begin.

Create a storage account using the Azure portal

First, create a new general-purpose storage account to use for this quickstart.

  1. Go to the Azure portal and log in using your Azure account.
  2. Enter a unique name for your storage account. Keep these rules in mind for naming your storage account:
    • The name must be between 3 and 24 characters in length.
    • The name may contain numbers and lowercase letters only.
  3. Make sure that the following default values are set:
    • Deployment model is set to Resource manager.
    • Account kind is set to General purpose.
    • Performance is set to Standard.
    • Replication is set to Locally Redundant storage (LRS).
  4. Select your subscription.
  5. For Resource group, create a new one and give it a unique name.
  6. Select the Location to use for your storage account.
  7. Check Pin to dashboard and click Create to create your storage account.

After your storage account is created, it is pinned to the dashboard. Click on it to open it. Under Settings, click Access keys. Select the primary key and copy the associated Connection string to the clipboard, then paste it into a text editor for later use.

Put the connection string in an environment variable

This solution requires a connection string be stored in an environment variable securely on the machine running the sample. Follow one of the examples below depending on your Operating System to create the environment variable. If using windows close out of your open IDE or shell and restart it to be able to read the environment variable.

Linux

export storageconnectionstring="<yourconnectionstring>"

Windows

setx storageconnectionstring "<yourconnectionstring>"

At this point, you can run this application. It creates its own file to upload and download, and then cleans up after itself by deleting everything at the end.

More information

The Azure storage documentation includes a rich set of tutorials and conceptual articles, which serve as a good complement to the samples.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

storage-blobs-php-quickstart's People

Contributors

roygara avatar microsoftopensource avatar msftgits avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.