Microsoft Azure Blob Storage

Microsoft Azure Blob Storage is a cloud-based storage solution that allows users to store and manage large amounts of unstructured data, such as images, videos, documents, and logs. It provides scalable and secure storage for a wide range of applications, including data analytics, backup and archiving, and content delivery. With Azure Blob Storage, users can easily access and manipulate their data from anywhere in the world, while benefiting from high availability, durability, and redundancy.

OpenAPI Specification

azure-blob-storage-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Microsoft Azure Azure Blob Storage API
  description: >-
    Azure Blob Storage is Microsoft's object storage solution for the cloud.
    Blob Storage is optimized for storing massive amounts of unstructured data
    such as text or binary data. The REST API provides operations for working
    with containers and blobs in storage accounts, including creating, reading,
    updating, and deleting blobs and containers, managing metadata and properties,
    and performing lease and snapshot operations.
  version: '2024-05-04'
  contact:
    name: Microsoft Azure Support
    url: https://azure.microsoft.com/en-us/support/
    email: [email protected]
  license:
    name: Microsoft API License
    url: https://learn.microsoft.com/en-us/legal/
  x-logo:
    url: https://azure.microsoft.com/svghandler/azure-logo.png
servers:
- url: https://{accountName}.blob.core.windows.net
  description: Azure Blob Storage account endpoint
  variables:
    accountName:
      default: mystorageaccount
      description: The name of the Azure storage account.
security:
- sharedKey: []
- oauth2:
  - https://storage.azure.com/.default
- sasToken: []
tags:
- name: Blobs
  description: Operations on blobs
- name: Containers
  description: Operations on blob containers
paths:
  /:
    get:
      operationId: Service_GetProperties
      summary: Microsoft Azure Get Blob Service Properties
      description: >-
        Gets the properties of a storage account's Blob service, including
        properties for Storage Analytics and CORS rules.
      tags: []
      parameters:
      - name: restype
        in: query
        required: true
        schema:
          type: string
          enum:
          - service
        example: service
      - name: comp
        in: query
        required: true
        schema:
          type: string
          enum:
          - properties
        example: properties
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successfully returned the service properties.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageServiceProperties'
              examples:
                ServiceGetproperties200Example:
                  summary: Default Service_GetProperties 200 response
                  x-microcks-default: true
                  value:
                    Logging:
                      Version: example_value
                      Delete: true
                      Read: true
                      Write: true
                      RetentionPolicy:
                        Enabled: true
                        Days: 10
                    HourMetrics:
                      Version: example_value
                      Enabled: true
                      IncludeAPIs: true
                    MinuteMetrics:
                      Version: example_value
                      Enabled: true
                      IncludeAPIs: true
                    Cors:
                      CorsRule:
                      - {}
                    DefaultServiceVersion: example_value
                    DeleteRetentionPolicy:
                      Enabled: true
                      Days: 10
                    StaticWebsite:
                      Enabled: true
                      IndexDocument: example_value
                      ErrorDocument404Path: example_value
        default:
          description: An error occurred.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
              examples:
                ServiceGetpropertiesdefaultExample:
                  summary: Default Service_GetProperties default response
                  x-microcks-default: true
                  value:
                    Code: example_value
                    Message: example_value
                    AuthenticationErrorDetail: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{containerName}:
    put:
      operationId: Container_Create
      summary: Microsoft Azure Create a Container
      description: >-
        Creates a new container under the specified account. If the container
        with the same name already exists, the operation fails.
      tags:
      - Containers
      parameters:
      - $ref: '#/components/parameters/ContainerNameParameter'
      - name: restype
        in: query
        required: true
        schema:
          type: string
          enum:
          - container
        example: container
      - $ref: '#/components/parameters/ApiVersionParameter'
      - name: x-ms-blob-public-access
        in: header
        description: Specifies whether data in the container may be accessed publicly.
        schema:
          type: string
          enum:
          - container
          - blob
        example: container
      - name: x-ms-meta
        in: header
        description: >-
          Name-value pairs to associate with the container as metadata.
        schema:
          type: string
        example: example_value
      responses:
        '201':
          description: Successfully created the container.
          headers:
            ETag:
              schema:
                type: string
              description: The ETag for the container.
            Last-Modified:
              schema:
                type: string
                format: date-time-rfc1123
              description: The date/time that the container was last modified.
        '409':
          description: The container already exists.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
              examples:
                ContainerCreate409Example:
                  summary: Default Container_Create 409 response
                  x-microcks-default: true
                  value:
                    Code: example_value
                    Message: example_value
                    AuthenticationErrorDetail: example_value
        default:
          description: An error occurred.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
              examples:
                ContainerCreatedefaultExample:
                  summary: Default Container_Create default response
                  x-microcks-default: true
                  value:
                    Code: example_value
                    Message: example_value
                    AuthenticationErrorDetail: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    get:
      operationId: Container_ListBlobs
      summary: Microsoft Azure List Blobs in a Container
      description: Returns a list of the blobs under the specified container.
      tags:
      - Containers
      parameters:
      - $ref: '#/components/parameters/ContainerNameParameter'
      - name: restype
        in: query
        required: true
        schema:
          type: string
          enum:
          - container
        example: container
      - name: comp
        in: query
        required: true
        schema:
          type: string
          enum:
          - list
        example: list
      - $ref: '#/components/parameters/ApiVersionParameter'
      - name: prefix
        in: query
        description: Filters the results to return only blobs whose name begins with the specified prefix.
        schema:
          type: string
        example: example_value
      - name: delimiter
        in: query
        description: Filters the results to return only blobs with names up to the specified delimiter.
        schema:
          type: string
        example: example_value
      - name: marker
        in: query
        description: A string value that identifies the portion of the list to be returned.
        schema:
          type: string
        example: example_value
      - name: maxresults
        in: query
        description: Maximum number of blobs to return.
        schema:
          type: integer
          minimum: 1
          maximum: 5000
        example: 10
      - name: include
        in: query
        description: >-
          Specifies one or more datasets to include in the response:
          snapshots, metadata, uncommittedblobs, copy, deleted, tags,
          versions, deletedwithversions, immutabilitypolicy, legalhold,
          permissions.
        schema:
          type: string
        example: example_value
      responses:
        '200':
          description: Successfully listed the blobs.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/BlobEnumerationResults'
              examples:
                ContainerListblobs200Example:
                  summary: Default Container_ListBlobs 200 response
                  x-microcks-default: true
                  value:
                    ServiceEndpoint: example_value
                    ContainerName: example_value
                    Prefix: example_value
                    Marker: example_value
                    MaxResults: 10
                    Blobs:
                      Blob:
                      - {}
                      BlobPrefix:
                      - Name: Example Title
                    NextMarker: example_value
        default:
          description: An error occurred.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
              examples:
                ContainerListblobsdefaultExample:
                  summary: Default Container_ListBlobs default response
                  x-microcks-default: true
                  value:
                    Code: example_value
                    Message: example_value
                    AuthenticationErrorDetail: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: Container_Delete
      summary: Microsoft Azure Delete a Container
      description: Marks the specified container for deletion. The container and any blobs within it are later deleted.
      tags:
      - Containers
      parameters:
      - $ref: '#/components/parameters/ContainerNameParameter'
      - name: restype
        in: query
        required: true
        schema:
          type: string
          enum:
          - container
        example: container
      - $ref: '#/components/parameters/ApiVersionParameter'
      - name: x-ms-lease-id
        in: header
        description: Required if the container has an active lease.
        schema:
          type: string
        example: '500123'
      responses:
        '202':
          description: The container has been marked for deletion.
        default:
          description: An error occurred.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
              examples:
                ContainerDeletedefaultExample:
                  summary: Default Container_Delete default response
                  x-microcks-default: true
                  value:
                    Code: example_value
                    Message: example_value
                    AuthenticationErrorDetail: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{containerName}/{blob}:
    get:
      operationId: Blob_Download
      summary: Microsoft Azure Download a Blob
      description: >-
        Reads or downloads a blob from the system, including its metadata and
        properties. You can also read a snapshot.
      tags:
      - Blobs
      parameters:
      - $ref: '#/components/parameters/ContainerNameParameter'
      - $ref: '#/components/parameters/BlobNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      - name: Range
        in: header
        description: >-
          Return only the bytes of the blob in the specified range.
        schema:
          type: string
        example: example_value
      - name: x-ms-range-get-content-md5
        in: header
        description: When set to true and the Range header is specified, returns the MD5 hash for the range.
        schema:
          type: boolean
        example: true
      - name: snapshot
        in: query
        description: The snapshot parameter is an opaque DateTime value that specifies the blob snapshot.
        schema:
          type: string
        example: example_value
      responses:
        '200':
          description: Successfully downloaded the blob.
          headers:
            Content-Type:
              schema:
                type: string
            ETag:
              schema:
                type: string
            Last-Modified:
              schema:
                type: string
            x-ms-blob-type:
              schema:
                type: string
                enum:
                - BlockBlob
                - PageBlob
                - AppendBlob
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
              examples:
                BlobDownload200Example:
                  summary: Default Blob_Download 200 response
                  x-microcks-default: true
                  value: example_value
        '206':
          description: Successfully downloaded the requested range of the blob.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
              examples:
                BlobDownload206Example:
                  summary: Default Blob_Download 206 response
                  x-microcks-default: true
                  value: example_value
        default:
          description: An error occurred.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
              examples:
                BlobDownloaddefaultExample:
                  summary: Default Blob_Download default response
                  x-microcks-default: true
                  value:
                    Code: example_value
                    Message: example_value
                    AuthenticationErrorDetail: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      operationId: Blob_Upload
      summary: Microsoft Azure Upload a Blob
      description: Creates a new blob or replaces an existing blob within a container.
      tags:
      - Blobs
      parameters:
      - $ref: '#/components/parameters/ContainerNameParameter'
      - $ref: '#/components/parameters/BlobNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      - name: x-ms-blob-type
        in: header
        required: true
        description: The type of the blob.
        schema:
          type: string
          enum:
          - BlockBlob
          - PageBlob
          - AppendBlob
        example: BlockBlob
      - name: Content-Type
        in: header
        description: The MIME content type of the blob.
        schema:
          type: string
          default: application/octet-stream
        example: example_value
      - name: Content-Length
        in: header
        required: true
        description: The length of the request body in bytes.
        schema:
          type: integer
          format: int64
        example: 10
      - name: x-ms-blob-content-type
        in: header
        description: The content type to set for the blob.
        schema:
          type: string
        example: example_value
      - name: x-ms-blob-content-encoding
        in: header
        description: The content encoding to set for the blob.
        schema:
          type: string
        example: example_value
      - name: x-ms-access-tier
        in: header
        description: The tier to be set on the blob.
        schema:
          type: string
          enum:
          - Hot
          - Cool
          - Cold
          - Archive
        example: Hot
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
            examples:
              BlobUploadRequestExample:
                summary: Default Blob_Upload request
                x-microcks-default: true
                value: example_value
      responses:
        '201':
          description: Successfully uploaded the blob.
          headers:
            ETag:
              schema:
                type: string
            Last-Modified:
              schema:
                type: string
            Content-MD5:
              schema:
                type: string
        default:
          description: An error occurred.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
              examples:
                BlobUploaddefaultExample:
                  summary: Default Blob_Upload default response
                  x-microcks-default: true
                  value:
                    Code: example_value
                    Message: example_value
                    AuthenticationErrorDetail: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: Blob_Delete
      summary: Microsoft Azure Delete a Blob
      description: >-
        Marks the specified blob or snapshot for deletion. The blob is later
        deleted during garbage collection.
      tags:
      - Blobs
      parameters:
      - $ref: '#/components/parameters/ContainerNameParameter'
      - $ref: '#/components/parameters/BlobNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      - name: snapshot
        in: query
        description: The snapshot to delete.
        schema:
          type: string
        example: example_value
      - name: x-ms-delete-snapshots
        in: header
        description: >-
          Required if the blob has associated snapshots.
        schema:
          type: string
          enum:
          - include
          - only
        example: include
      - name: x-ms-lease-id
        in: header
        description: Required if the blob has an active lease.
        schema:
          type: string
        example: '500123'
      responses:
        '202':
          description: The blob has been marked for deletion.
        default:
          description: An error occurred.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
              examples:
                BlobDeletedefaultExample:
                  summary: Default Blob_Delete default response
                  x-microcks-default: true
                  value:
                    Code: example_value
                    Message: example_value
                    AuthenticationErrorDetail: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    head:
      operationId: Blob_GetProperties
      summary: Microsoft Azure Get blob properties
      description: >-
        Returns all user-defined metadata, standard HTTP properties, and system
        properties for the blob.
      tags:
      - Blobs
      parameters:
      - $ref: '#/components/parameters/ContainerNameParameter'
      - $ref: '#/components/parameters/BlobNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successfully returned the blob properties.
          headers:
            Content-Length:
              schema:
                type: integer
                format: int64
            Content-Type:
              schema:
                type: string
            ETag:
              schema:
                type: string
            Last-Modified:
              schema:
                type: string
            x-ms-blob-type:
              schema:
                type: string
                enum:
                - BlockBlob
                - PageBlob
                - AppendBlob
            x-ms-access-tier:
              schema:
                type: string
            x-ms-creation-time:
              schema:
                type: string
        default:
          description: An error occurred.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/StorageError'
components:
  securitySchemes:
    sharedKey:
      type: apiKey
      name: Authorization
      in: header
      description: Azure Storage shared key authorization.
    oauth2:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
          scopes:
            https://storage.azure.com/.default: Access Azure Storage
    sasToken:
      type: apiKey
      name: sig
      in: query
      description: Shared Access Signature token.
  parameters:
    ContainerNameParameter:
      name: containerName
      in: path
      required: true
      description: The name of the container.
      schema:
        type: string
        minLength: 3
        maxLength: 63
        pattern: '^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){1,61}[a-z0-9]$'
    BlobNameParameter:
      name: blob
      in: path
      required: true
      description: The name of the blob.
      schema:
        type: string
        maxLength: 1024
    ApiVersionParameter:
      name: x-ms-version
      in: header
      required: true
      description: Specifies the version of the operation to use for this request.
      schema:
        type: string
        default: '2024-05-04'
  schemas:
    StorageServiceProperties:
      type: object
      description: Storage service properties.
      properties:
        Logging:
          type: object
          description: Azure Analytics logging settings.
          properties:
            Version:
              type: string
              description: The version of Storage Analytics to configure.
            Delete:
              type: boolean
              description: Indicates whether all delete requests should be logged.
            Read:
              type: boolean
              description: Indicates whether all read requests should be logged.
            Write:
              type: boolean
              description: Indicates whether all write requests should be logged.
            RetentionPolicy:
              $ref: '#/components/schemas/RetentionPolicy'
          example: example_value
        HourMetrics:
          $ref: '#/components/schemas/Metrics'
        MinuteMetrics:
          $ref: '#/components/schemas/Metrics'
        Cors:
          type: object
          description: The set of CORS rules.
          properties:
            CorsRule:
              type: array
              items:
                $ref: '#/components/schemas/CorsRule'
          example: example_value
        DefaultServiceVersion:
          type: string
          description: The default version to use for requests to the Blob service.
          example: example_value
        DeleteRetentionPolicy:
          $ref: '#/components/schemas/RetentionPolicy'
        StaticWebsite:
          type: object
          description: The properties that enable static website hosting.
          properties:
            Enabled:
              type: boolean
            IndexDocument:
              type: string
            ErrorDocument404Path:
              type: string
          example: example_value
    RetentionPolicy:
      type: object
      description: The retention policy.
      properties:
        Enabled:
          type: boolean
          description: Indicates whether a retention policy is enabled.
          example: true
        Days:
          type: integer
          minimum: 1
          maximum: 365
          description: The number of days that metrics or logging data should be retained.
          example: 10
    Metrics:
      type: object
      description: Storage analytics metrics settings.
      properties:
        Version:
          type: string
          example: example_value
        Enabled:
          type: boolean
          example: true
        IncludeAPIs:
          type: boolean
          example: true
        RetentionPolicy:
          $ref: '#/components/schemas/RetentionPolicy'
    CorsRule:
      type: object
      description: CORS rule for the Blob service.
      properties:
        AllowedOrigins:
          type: string
          description: >-
            Comma-separated list of origin domains that are allowed via CORS.
          example: example_value
        AllowedMethods:
          type: string
          description: >-
            Comma-separated list of HTTP methods that are allowed. Options are
            DELETE, GET, HEAD, MERGE, POST, OPTIONS, PUT.
          example: example_value
        AllowedHeaders:
          type: string
          description: >-
            Comma-separated list of headers allowed to be part of the
            cross-origin request.
          example: example_value
        ExposedHeaders:
          type: string
          description: >-
            Comma-separated list of response headers to expose to CORS clients.
          example: example_value
        MaxAgeInSeconds:
          type: integer
          minimum: 0
          description: >-
            The maximum amount of time in seconds that a browser should cache the
            preflight OPTIONS request.
          example: 10
      required:
      - AllowedOrigins
      - AllowedMethods
      - AllowedHeaders
      - ExposedHeaders
      - MaxAgeInSeconds
    BlobEnumerationResults:
      type: object
      description: An enumeration of blobs.
      properties:
        ServiceEndpoint:
          type: string
          description: The service endpoint URL.
          example: example_value
        ContainerName:
          type: string
          description: The name of the container.
          example: example_value
        Prefix:
          type: string
          description: The prefix used to filter results.
          example: example_value
        Marker:
          type: string
          description: The marker used for pagination.
          example: example_value
        MaxResults:
          type: integer
          description: The maximum number of results.
          example: 10
        Blobs:
          type: object
          properties:
            Blob:
              type: array
              items:
                $ref: '#/components/schemas/BlobItem'
            BlobPrefix:
              type: array
              items:
                type: object
                properties:
                  Name:
                    type: string
          example: example_value
        NextMarker:
          type: string
          description: The next marker for pagination.
          example: example_value
    BlobItem:
      type: object
      description: A blob item in the enumeration results.
      properties:
        Name:
          type: string
          description: The name of the blob.
          example: Example Title
        Deleted:
          type: boolean
          description: Whether the blob is deleted.
          example: true
        Snapshot:
          type: string
          description: The snapshot DateTime.
          example: example_value
        VersionId:
          type: string
          description: The version ID of the blob.
          example: '500123'
        IsCurrentVersion:
          type: boolean
          description: Whether this is the current version.
          example: true
        Properties:
          $ref: '#/components/schemas/BlobProperties'
        Metadata:
          type: object
          additionalProperties:
            type: string
          description: The blob metadata.
          example: example_value
        Tags:
          type: object
          description: Blob tags.
          properties:
            TagSet:
              type: array
              items:
                type: object
                properties:
                  Key:
                    type: string
                  Value:
                    type: string
          example: example_value
      required:
      - Name
      - Properties
    BlobProperties:
      type: object
      description: Properties of a blob.
      properties:
        Creation-Time:
          type: string
          format: date-time-rfc1123
          description: The date/time the blob was created.
          example: example_value
        Last-Modified:
          type: string
          format: date-time-rfc1123
          description: The date/time the blob was last modified.
          example: example_value
        Etag:
          type: string
          description: The ETag of the blob.
          example: example_value
        Content-Length:
          type: integer
          format: int64
          description: The size of the blob in bytes.
          example: 10
        Content-Type:
          type: string
          description: The content type of the blob.
          example: example_value
        Content-Encoding:
          type: string
          description: The content encoding of the blob.
          example: example_value
        Content-Language:
          type: string
          description: The content language of the blob.
          example: example_value
        Content-MD5:
          type: string
          description: The MD5 hash of the blob content.
          example: example_value
        Content-Disposition:
          type: string
          description: The content disposition of the blob.
          example: example_value
        Cache-Control:
          type: string
          description: The cache control of the blob.
          example: example_value
        BlobType:
          type: string
          enum:
          - BlockBlob
          - PageBlob
          - AppendBlob
          description: The type of the blob.
          example: BlockBlob
        AccessTier:
          type: string
          enum:
          - Hot
          - Cool
          - Cold
          - Archive
          description: The access tier of the blob.
          example: Hot
        AccessTierInferred:
          type: boolean
          description: Whether the access tier was inferred.
          example: true
        LeaseStatus:
          type: string
          enum:
          - locked
          - unlocked
          description: The lease status.
          example: locked
        LeaseState:
          type: string
          enum:
          - available
          - leased
          - expired
          - breaking
          - broken
          description: The lease state.
          example: available
        ServerEncrypted:
          type: boolean
          description: Whether the blob data and metadata are encrypted.
          example: true
    StorageError:
      type: object
      description: Storage service error response.
      properties:
        Code:
          type: string
          description: The error code.
          example: example_value
        Message:
          type: string
          description: The error message.
          example: example_value
        AuthenticationErrorDetail:
          type: string
          description: Additional details for authentication errors.
          example: example_value