2013-04-19 1 views
0

나는 다음 S3 기능으로 윈도우 Azure 미디어 서비스에 상응하는 기능을 찾기 위해 노력하고있다 :이 같은 서명 URL을뿐만 아니라 CDN의 S3을 통해 달성 될 수 있다는 것을 들었습니다 http://www.bucketexplorer.com/documentation/amazon-s3--how-to-generate-url-for-amazon-s3-file.html#signedurl서명하는 URL의

(예 : Akamai).

2 질문.

1) WAMS에서 서명 된 URL을 구현하는 방법에 대한 권장 사항이 있습니까?

2) Azure가 Akamai와 같은 다른 CDN과 어떤 관계를 맺고 있는지 알 수 있습니까? 사전에

감사합니다.

답변

0

Windows Azure의이 기능에 해당하는 것은 Shared Access Signature입니다. Media Services는 SAS Origin Locators 생성을 지원합니다.

how to create SAS Locator with .NET SDK의 공식 설명서를 읽을 수 있습니다.

아니면 my project on GitHub를 확인할 수 있으며, 특정 자산에 대한 SAS 로케이터를 생성하기위한 Locators implementation in particular

코드 샘플은 다음과 같습니다

public string GetSasLocator(IAsset asset) 
{ 
    // Create an 1-day readonly access policy. 
    IAccessPolicy streamingPolicy = this.MediaService.MediaContext.AccessPolicies.Create("Full Access Policy", 
     TimeSpan.FromMinutes(20), 
     AccessPermissions.List | AccessPermissions.Read | AccessPermissions.Read); 

    // Create the origin locator. Set the start time as 5 minutes 
    // before the present so that the locator can be accessed immediately 
    // if there is clock skew between the client and server. 
    ILocator sasLocator = 
     (from l in this.MediaService.MediaContext.Locators 
     where l.Type == LocatorType.Sas && l.AssetId.Equals(asset.Id) 
     select l).FirstOrDefault(); 

    if (sasLocator != null && sasLocator.ExpirationDateTime < DateTime.UtcNow) 
    { 
     sasLocator.Delete(); 
     sasLocator = null; 
    } 

    if (sasLocator == null) 
    { 
     sasLocator = this.MediaService.MediaContext 
      .Locators.CreateSasLocator(asset, 
     streamingPolicy, 
     DateTime.UtcNow.AddMinutes(-5)); 
    } 
    // Create a full URL to the manifest file. Use this for playback 
    // in streaming media clients. 
    string sasUrl = sasLocator.Path; 

    // Display the full URL to the streaming manifest file. 
    Console.WriteLine("URL to for blob upload: "); 
    Console.WriteLine(sasUrl); 

    return sasUrl; 
} 
+0

, 덕분에 나는 조금에서 살펴볼 것이다. 나의 이해는 SAS 로케이터가 적응 비트 전송률이 아닌 콘텐츠를 위해 설계되었다는 것이 었습니다. 예를 들어 HLS 및 Smooth Streaming에는 Origin Locator가 필요합니다 (원본 게시물에 붙여 넣었어야 함). HLS 또는 Smooth Streaming에서이 방법을 사용할 수 있습니까? – user483044

+0

또 다른 메모, 당신의 코드 (github과 여기에)가 Time To Live (만료) 부분을 다루고있는 것처럼 보이지만 보안 기능을 제대로 다루지는 않습니다. 위에 나열된 서명 된 URL 기능을 사용하면 URL을로드하기 전에 URL의 소비자가 인증서/서명 손을 흔들어야합니다. 이 부분도 지원해야합니다. – user483044

관련 문제