Create Media Services 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 creates a Media Services account in the specified subscription. Both request and response follow the data contract described later in this section.

The request may be specified as follows (replace <subscription-id> with your subscription ID):

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

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

Data Contract

The data contract for AccountCreationRequest is defined as follows:

[DataContract]   
public class AccountCreationRequest   
{   
    public AccountCreationRequest();   

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

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

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

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

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

The data contract for AccountCreationResult is defined as follows:

[DataContract]   
public sealed class AccountCreationResult   
{   
    public Guid AccountId { get; }   
    public string AccountName { get; }   
    public string Reason { get; }   

    [DataMember]   
    public HttpStatusCode StatusCode { get; set; }   
    public string Subscription { get; }   

    public static AccountCreationResult Failed(string reason, HttpStatusCode result = HttpStatusCode.BadRequest);   
    public static AccountCreationResult Success(Guid accountId, string accountName, string subscription); }  

Example

See How to: Use Media Services Management REST API.

See Also

Media Services Operations REST