Attach Storage Account

Note

It is now recommended to use the Azure Resource Manager (ARM) REST API endpoints, as described in Media Services management REST API reference.

The POST request method described in this topic attaches a storage account to the specified Media Services account. The data contract for AttachStorageAccount is defined later in this topic.

Caution

Currently, once a storage account is attached to the specified Media Services account, it cannot be detached.

The request may be specified as follows (replace <subscription-id> with your subscription ID, and <accountName> with your account name.):

Method Request URI
POST https://endpoint/<subscriptionId>/services/mediaservices/Accounts/<accountName>/StorageAccounts

A successful operation returns status code 204 (NoContent). For information about error codes, see Media Services Management Error Codes.

When attaching multiple storage accounts to your Media Services account, the following considerations apply:

  • All storage accounts attached to a Media Services account must be in the same data center as the Media Services account.

  • Currently, once a storage account is attached to the specified Media Services account, it cannot be detached.

  • Primary storage account is the one indicated during Media Services account creation time. Currently, you cannot change the default storage account.

Data Contract

The data contract for AttachStorageAccountRequest is defined as follows:

[DataContract]   
public class AttachStorageAccountRequest   
{   

    [DataMember]   
    public string StorageAccountKey { get; set; }   

    [DataMember]   
    public string StorageAccountName { get; set; }   

    [DataMember]   
    public string BlobStorageEndPointUri { get; set; }   
}

Example

See How to: Use Media Services Management REST API.