Erstellen oder Aktualisieren einer Inhaltsschlüsselrichtlinie
Erstellen oder Aktualisieren einer Inhaltsschlüsselrichtlinie im Media Services-Konto
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}?api-version=2022-08-01
URI-Parameter
Name |
In |
Erforderlich |
Typ |
Beschreibung |
accountName
|
path |
True
|
string
|
Der Name des Media Services-Kontos.
|
contentKeyPolicyName
|
path |
True
|
string
|
Der Name der Inhaltsschlüsselrichtlinie.
|
resourceGroupName
|
path |
True
|
string
|
Der Name der Ressourcengruppe innerhalb des Azure-Abonnements.
|
subscriptionId
|
path |
True
|
string
|
Der eindeutige Bezeichner für ein Microsoft Azure-Abonnement.
|
api-version
|
query |
True
|
string
|
Die Version der API, die mit der Clientanforderung verwendet werden soll.
|
Anforderungstext
Name |
Erforderlich |
Typ |
Beschreibung |
properties.options
|
True
|
ContentKeyPolicyOption[]
|
Die Optionen für die Schlüsselrichtlinie.
|
properties.description
|
|
string
|
Eine Beschreibung der Richtlinie.
|
Antworten
Beispiele
Creates a Content Key Policy with ClearKey option and Token Restriction
Beispielanforderung
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaServices/contosomedia/contentKeyPolicies/PolicyWithClearKeyOptionAndSwtTokenRestriction?api-version=2022-08-01
{
"properties": {
"description": "ArmPolicyDescription",
"options": [
{
"name": "ClearKeyOption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": "AAAAAAAAAAAAAAAAAAAAAA=="
},
"restrictionTokenType": "Swt"
}
}
]
}
}
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyClearKeyConfiguration;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyRestrictionTokenType;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicySymmetricTokenKey;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyTokenRestriction;
import java.util.Arrays;
/**
* Samples for ContentKeyPolicies CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-
* policies-create-nodrm-token.json
*/
/**
* Sample code: Creates a Content Key Policy with ClearKey option and Token Restriction.
*
* @param manager Entry point to MediaServicesManager.
*/
public static void createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction(
com.azure.resourcemanager.mediaservices.MediaServicesManager manager) {
manager.contentKeyPolicies().define("PolicyWithClearKeyOptionAndSwtTokenRestriction")
.withExistingMediaService("contosorg", "contosomedia").withDescription("ArmPolicyDescription")
.withOptions(
Arrays.asList(new ContentKeyPolicyOption().withName("ClearKeyOption")
.withConfiguration(new ContentKeyPolicyClearKeyConfiguration())
.withRestriction(new ContentKeyPolicyTokenRestriction().withIssuer("urn:issuer")
.withAudience("urn:audience")
.withPrimaryVerificationKey(
new ContentKeyPolicySymmetricTokenKey().withKeyValue("AAAAAAAAAAAAAAAAAAAAAA==".getBytes()))
.withRestrictionTokenType(ContentKeyPolicyRestrictionTokenType.SWT))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.media import AzureMediaServices
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-media
# USAGE
python contentkeypoliciescreatenodrmtoken.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureMediaServices(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.content_key_policies.create_or_update(
resource_group_name="contoso",
account_name="contosomedia",
content_key_policy_name="PolicyWithClearKeyOptionAndSwtTokenRestriction",
parameters={
"properties": {
"description": "ArmPolicyDescription",
"options": [
{
"configuration": {"@odata.type": "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"},
"name": "ClearKeyOption",
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"audience": "urn:audience",
"issuer": "urn:issuer",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": "AAAAAAAAAAAAAAAAAAAAAA==",
},
"restrictionTokenType": "Swt",
},
}
],
}
},
)
print(response)
# x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armmediaservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json
func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmediaservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewContentKeyPoliciesClient().CreateOrUpdate(ctx, "contoso", "contosomedia", "PolicyWithClearKeyOptionAndSwtTokenRestriction", armmediaservices.ContentKeyPolicy{
Properties: &armmediaservices.ContentKeyPolicyProperties{
Description: to.Ptr("ArmPolicyDescription"),
Options: []*armmediaservices.ContentKeyPolicyOption{
{
Name: to.Ptr("ClearKeyOption"),
Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"),
},
Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"),
Audience: to.Ptr("urn:audience"),
Issuer: to.Ptr("urn:issuer"),
PrimaryVerificationKey: &armmediaservices.ContentKeyPolicySymmetricTokenKey{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"),
KeyValue: []byte("AAAAAAAAAAAAAAAAAAAAAA=="),
},
RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeSwt),
},
}},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ContentKeyPolicy = armmediaservices.ContentKeyPolicy{
// Name: to.Ptr("PolicyWithClearKeyOptionAndSwtTokenRestriction"),
// Type: to.Ptr("Microsoft.Media/mediaservices/contentKeyPolicies"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithClearKeyOptionAndSwtTokenRestriction"),
// Properties: &armmediaservices.ContentKeyPolicyProperties{
// Description: to.Ptr("ArmPolicyDescription"),
// Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-08T18:29:29.837Z"); return t}()),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-08T18:29:29.837Z"); return t}()),
// Options: []*armmediaservices.ContentKeyPolicyOption{
// {
// Name: to.Ptr("ClearKeyOption"),
// Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"),
// },
// PolicyOptionID: to.Ptr("e7d4d465-b6f7-4830-9a21-74a7326ef797"),
// Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"),
// AlternateVerificationKeys: []armmediaservices.ContentKeyPolicyRestrictionTokenKeyClassification{
// },
// Audience: to.Ptr("urn:audience"),
// Issuer: to.Ptr("urn:issuer"),
// PrimaryVerificationKey: &armmediaservices.ContentKeyPolicySymmetricTokenKey{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"),
// KeyValue: []byte(""),
// },
// RequiredClaims: []*armmediaservices.ContentKeyPolicyTokenClaim{
// },
// RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeSwt),
// },
// }},
// PolicyID: to.Ptr("2926c1bc-4dec-4a11-9d19-3f99006530a9"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMediaServices } = require("@azure/arm-mediaservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Content Key Policy in the Media Services account
*
* @summary Create or update a Content Key Policy in the Media Services account
* x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json
*/
async function createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() {
const subscriptionId =
process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso";
const accountName = "contosomedia";
const contentKeyPolicyName = "PolicyWithClearKeyOptionAndSwtTokenRestriction";
const parameters = {
description: "ArmPolicyDescription",
options: [
{
name: "ClearKeyOption",
configuration: {
odataType: "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration",
},
restriction: {
odataType: "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
audience: "urn:audience",
issuer: "urn:issuer",
primaryVerificationKey: {
odataType: "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
keyValue: Buffer.from("AAAAAAAAAAAAAAAAAAAAAA=="),
},
restrictionTokenType: "Swt",
},
},
],
};
const credential = new DefaultAzureCredential();
const client = new AzureMediaServices(credential, subscriptionId);
const result = await client.contentKeyPolicies.createOrUpdate(
resourceGroupName,
accountName,
contentKeyPolicyName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Media;
using Azure.ResourceManager.Media.Models;
// Generated from example definition: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json
// this example is just showing the usage of "ContentKeyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this MediaServicesAccountResource created on azure
// for more information of creating MediaServicesAccountResource, please refer to the document of MediaServicesAccountResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "contoso";
string accountName = "contosomedia";
ResourceIdentifier mediaServicesAccountResourceId = MediaServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
MediaServicesAccountResource mediaServicesAccount = client.GetMediaServicesAccountResource(mediaServicesAccountResourceId);
// get the collection of this ContentKeyPolicyResource
ContentKeyPolicyCollection collection = mediaServicesAccount.GetContentKeyPolicies();
// invoke the operation
string contentKeyPolicyName = "PolicyWithClearKeyOptionAndSwtTokenRestriction";
ContentKeyPolicyData data = new ContentKeyPolicyData()
{
Description = "ArmPolicyDescription",
Options =
{
new ContentKeyPolicyOption(new ContentKeyPolicyClearKeyConfiguration(),new ContentKeyPolicyTokenRestriction("urn:issuer","urn:audience",new ContentKeyPolicySymmetricTokenKey(Convert.FromBase64String("AAAAAAAAAAAAAAAAAAAAAA==")),ContentKeyPolicyRestrictionTokenType.Swt))
{
Name = "ClearKeyOption",
}
},
};
ArmOperation<ContentKeyPolicyResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, contentKeyPolicyName, data);
ContentKeyPolicyResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContentKeyPolicyData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"name": "PolicyWithClearKeyOptionAndSwtTokenRestriction",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithClearKeyOptionAndSwtTokenRestriction",
"type": "Microsoft.Media/mediaservices/contentKeyPolicies",
"properties": {
"policyId": "2926c1bc-4dec-4a11-9d19-3f99006530a9",
"created": "2018-08-08T18:29:29.837Z",
"lastModified": "2018-08-08T18:29:29.837Z",
"description": "ArmPolicyDescription",
"options": [
{
"policyOptionId": "e7d4d465-b6f7-4830-9a21-74a7326ef797",
"name": "ClearKeyOption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": ""
},
"alternateVerificationKeys": [],
"requiredClaims": [],
"restrictionTokenType": "Swt"
}
}
]
}
}
{
"name": "PolicyWithClearKeyOptionAndSwtTokenRestriction",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithClearKeyOptionAndSwtTokenRestriction",
"type": "Microsoft.Media/mediaservices/contentKeyPolicies",
"properties": {
"policyId": "2926c1bc-4dec-4a11-9d19-3f99006530a9",
"created": "2018-08-08T18:29:29.837Z",
"lastModified": "2018-08-08T18:29:29.837Z",
"description": "ArmPolicyDescription",
"options": [
{
"policyOptionId": "e7d4d465-b6f7-4830-9a21-74a7326ef797",
"name": "ClearKeyOption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": ""
},
"alternateVerificationKeys": [],
"requiredClaims": [],
"restrictionTokenType": "Swt"
}
}
]
}
}
Creates a Content Key Policy with multiple options
Beispielanforderung
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaServices/contosomedia/contentKeyPolicies/PolicyCreatedWithMultipleOptions?api-version=2022-08-01
{
"properties": {
"description": "ArmPolicyDescription",
"options": [
{
"name": "ClearKeyOption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": "AAAAAAAAAAAAAAAAAAAAAA=="
},
"restrictionTokenType": "Swt"
}
},
{
"name": "widevineoption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
"widevineTemplate": "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyOpenRestriction"
}
}
]
}
}
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyClearKeyConfiguration;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOpenRestriction;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyRestrictionTokenType;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicySymmetricTokenKey;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyTokenRestriction;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyWidevineConfiguration;
import java.util.Arrays;
/**
* Samples for ContentKeyPolicies CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-
* policies-create-multiple-options.json
*/
/**
* Sample code: Creates a Content Key Policy with multiple options.
*
* @param manager Entry point to MediaServicesManager.
*/
public static void createsAContentKeyPolicyWithMultipleOptions(
com.azure.resourcemanager.mediaservices.MediaServicesManager manager) {
manager.contentKeyPolicies().define("PolicyCreatedWithMultipleOptions")
.withExistingMediaService("contosorg", "contosomedia").withDescription("ArmPolicyDescription")
.withOptions(
Arrays.asList(
new ContentKeyPolicyOption().withName("ClearKeyOption")
.withConfiguration(new ContentKeyPolicyClearKeyConfiguration()).withRestriction(
new ContentKeyPolicyTokenRestriction()
.withIssuer("urn:issuer").withAudience("urn:audience")
.withPrimaryVerificationKey(new ContentKeyPolicySymmetricTokenKey().withKeyValue(
"AAAAAAAAAAAAAAAAAAAAAA==".getBytes()))
.withRestrictionTokenType(ContentKeyPolicyRestrictionTokenType.SWT)),
new ContentKeyPolicyOption().withName("widevineoption")
.withConfiguration(new ContentKeyPolicyWidevineConfiguration().withWidevineTemplate(
"{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"))
.withRestriction(new ContentKeyPolicyOpenRestriction())))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.media import AzureMediaServices
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-media
# USAGE
python contentkeypoliciescreatemultipleoptions.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureMediaServices(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.content_key_policies.create_or_update(
resource_group_name="contoso",
account_name="contosomedia",
content_key_policy_name="PolicyCreatedWithMultipleOptions",
parameters={
"properties": {
"description": "ArmPolicyDescription",
"options": [
{
"configuration": {"@odata.type": "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"},
"name": "ClearKeyOption",
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"audience": "urn:audience",
"issuer": "urn:issuer",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": "AAAAAAAAAAAAAAAAAAAAAA==",
},
"restrictionTokenType": "Swt",
},
},
{
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
"widevineTemplate": '{"allowed_track_types":"SD_HD","content_key_specs":[{"track_type":"SD","security_level":1,"required_output_protection":{"hdcp":"HDCP_V2"}}],"policy_overrides":{"can_play":true,"can_persist":true,"can_renew":false}}',
},
"name": "widevineoption",
"restriction": {"@odata.type": "#Microsoft.Media.ContentKeyPolicyOpenRestriction"},
},
],
}
},
)
print(response)
# x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armmediaservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json
func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithMultipleOptions() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmediaservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewContentKeyPoliciesClient().CreateOrUpdate(ctx, "contoso", "contosomedia", "PolicyCreatedWithMultipleOptions", armmediaservices.ContentKeyPolicy{
Properties: &armmediaservices.ContentKeyPolicyProperties{
Description: to.Ptr("ArmPolicyDescription"),
Options: []*armmediaservices.ContentKeyPolicyOption{
{
Name: to.Ptr("ClearKeyOption"),
Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"),
},
Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"),
Audience: to.Ptr("urn:audience"),
Issuer: to.Ptr("urn:issuer"),
PrimaryVerificationKey: &armmediaservices.ContentKeyPolicySymmetricTokenKey{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"),
KeyValue: []byte("AAAAAAAAAAAAAAAAAAAAAA=="),
},
RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeSwt),
},
},
{
Name: to.Ptr("widevineoption"),
Configuration: &armmediaservices.ContentKeyPolicyWidevineConfiguration{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration"),
WidevineTemplate: to.Ptr("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"),
},
Restriction: &armmediaservices.ContentKeyPolicyOpenRestriction{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyOpenRestriction"),
},
}},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ContentKeyPolicy = armmediaservices.ContentKeyPolicy{
// Name: to.Ptr("PolicyCreatedWithMultipleOptions"),
// Type: to.Ptr("Microsoft.Media/mediaservices/contentKeyPolicies"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyCreatedWithMultipleOptions"),
// Properties: &armmediaservices.ContentKeyPolicyProperties{
// Description: to.Ptr("ArmPolicyDescription"),
// Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-08T18:29:29.980Z"); return t}()),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-08T18:29:29.980Z"); return t}()),
// Options: []*armmediaservices.ContentKeyPolicyOption{
// {
// Name: to.Ptr("ClearKeyOption"),
// Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"),
// },
// PolicyOptionID: to.Ptr("8dac9510-770a-401f-8f2b-f72640977ed0"),
// Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"),
// AlternateVerificationKeys: []armmediaservices.ContentKeyPolicyRestrictionTokenKeyClassification{
// },
// Audience: to.Ptr("urn:audience"),
// Issuer: to.Ptr("urn:issuer"),
// PrimaryVerificationKey: &armmediaservices.ContentKeyPolicySymmetricTokenKey{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"),
// KeyValue: []byte(""),
// },
// RequiredClaims: []*armmediaservices.ContentKeyPolicyTokenClaim{
// },
// RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeSwt),
// },
// },
// {
// Name: to.Ptr("widevineoption"),
// Configuration: &armmediaservices.ContentKeyPolicyWidevineConfiguration{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration"),
// WidevineTemplate: to.Ptr("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"),
// },
// PolicyOptionID: to.Ptr("fc121776-6ced-4135-be92-f928dedc029a"),
// Restriction: &armmediaservices.ContentKeyPolicyOpenRestriction{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyOpenRestriction"),
// },
// }},
// PolicyID: to.Ptr("07ad673b-dc14-4230-adab-716622f33992"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMediaServices } = require("@azure/arm-mediaservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Content Key Policy in the Media Services account
*
* @summary Create or update a Content Key Policy in the Media Services account
* x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json
*/
async function createsAContentKeyPolicyWithMultipleOptions() {
const subscriptionId =
process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso";
const accountName = "contosomedia";
const contentKeyPolicyName = "PolicyCreatedWithMultipleOptions";
const parameters = {
description: "ArmPolicyDescription",
options: [
{
name: "ClearKeyOption",
configuration: {
odataType: "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration",
},
restriction: {
odataType: "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
audience: "urn:audience",
issuer: "urn:issuer",
primaryVerificationKey: {
odataType: "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
keyValue: Buffer.from("AAAAAAAAAAAAAAAAAAAAAA=="),
},
restrictionTokenType: "Swt",
},
},
{
name: "widevineoption",
configuration: {
odataType: "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
widevineTemplate:
'{"allowed_track_types":"SD_HD","content_key_specs":[{"track_type":"SD","security_level":1,"required_output_protection":{"hdcp":"HDCP_V2"}}],"policy_overrides":{"can_play":true,"can_persist":true,"can_renew":false}}',
},
restriction: {
odataType: "#Microsoft.Media.ContentKeyPolicyOpenRestriction",
},
},
],
};
const credential = new DefaultAzureCredential();
const client = new AzureMediaServices(credential, subscriptionId);
const result = await client.contentKeyPolicies.createOrUpdate(
resourceGroupName,
accountName,
contentKeyPolicyName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Media;
using Azure.ResourceManager.Media.Models;
// Generated from example definition: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json
// this example is just showing the usage of "ContentKeyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this MediaServicesAccountResource created on azure
// for more information of creating MediaServicesAccountResource, please refer to the document of MediaServicesAccountResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "contoso";
string accountName = "contosomedia";
ResourceIdentifier mediaServicesAccountResourceId = MediaServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
MediaServicesAccountResource mediaServicesAccount = client.GetMediaServicesAccountResource(mediaServicesAccountResourceId);
// get the collection of this ContentKeyPolicyResource
ContentKeyPolicyCollection collection = mediaServicesAccount.GetContentKeyPolicies();
// invoke the operation
string contentKeyPolicyName = "PolicyCreatedWithMultipleOptions";
ContentKeyPolicyData data = new ContentKeyPolicyData()
{
Description = "ArmPolicyDescription",
Options =
{
new ContentKeyPolicyOption(new ContentKeyPolicyClearKeyConfiguration(),new ContentKeyPolicyTokenRestriction("urn:issuer","urn:audience",new ContentKeyPolicySymmetricTokenKey(Convert.FromBase64String("AAAAAAAAAAAAAAAAAAAAAA==")),ContentKeyPolicyRestrictionTokenType.Swt))
{
Name = "ClearKeyOption",
},new ContentKeyPolicyOption(new ContentKeyPolicyWidevineConfiguration("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"),new ContentKeyPolicyOpenRestriction())
{
Name = "widevineoption",
}
},
};
ArmOperation<ContentKeyPolicyResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, contentKeyPolicyName, data);
ContentKeyPolicyResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContentKeyPolicyData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"name": "PolicyCreatedWithMultipleOptions",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyCreatedWithMultipleOptions",
"type": "Microsoft.Media/mediaservices/contentKeyPolicies",
"properties": {
"policyId": "07ad673b-dc14-4230-adab-716622f33992",
"created": "2018-08-08T18:29:29.98Z",
"lastModified": "2018-08-08T18:29:29.98Z",
"description": "ArmPolicyDescription",
"options": [
{
"policyOptionId": "8dac9510-770a-401f-8f2b-f72640977ed0",
"name": "ClearKeyOption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": ""
},
"alternateVerificationKeys": [],
"requiredClaims": [],
"restrictionTokenType": "Swt"
}
},
{
"policyOptionId": "fc121776-6ced-4135-be92-f928dedc029a",
"name": "widevineoption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
"widevineTemplate": "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyOpenRestriction"
}
}
]
}
}
{
"name": "PolicyCreatedWithMultipleOptions",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyCreatedWithMultipleOptions",
"type": "Microsoft.Media/mediaservices/contentKeyPolicies",
"properties": {
"policyId": "07ad673b-dc14-4230-adab-716622f33992",
"created": "2018-08-08T18:29:29.98Z",
"lastModified": "2018-08-08T18:29:29.98Z",
"description": "ArmPolicyDescription",
"options": [
{
"policyOptionId": "8dac9510-770a-401f-8f2b-f72640977ed0",
"name": "ClearKeyOption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": ""
},
"alternateVerificationKeys": [],
"requiredClaims": [],
"restrictionTokenType": "Swt"
}
},
{
"policyOptionId": "fc121776-6ced-4135-be92-f928dedc029a",
"name": "widevineoption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
"widevineTemplate": "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyOpenRestriction"
}
}
]
}
}
Creates a Content Key Policy with PlayReady option and Open Restriction
Beispielanforderung
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaServices/contosomedia/contentKeyPolicies/PolicyWithPlayReadyOptionAndOpenRestriction?api-version=2022-08-01
{
"properties": {
"description": "ArmPolicyDescription",
"options": [
{
"name": "ArmPolicyOptionName",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration",
"licenses": [
{
"allowTestDevices": true,
"securityLevel": "SL150",
"beginDate": "2017-10-16T18:22:53.46Z",
"playRight": {
"scmsRestriction": 2,
"digitalVideoOnlyContentRestriction": false,
"imageConstraintForAnalogComponentVideoRestriction": true,
"imageConstraintForAnalogComputerMonitorRestriction": false,
"allowPassingVideoContentToUnknownOutput": "NotAllowed"
},
"licenseType": "Persistent",
"contentKeyLocation": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"
},
"contentType": "UltraVioletDownload"
}
]
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyOpenRestriction"
}
}
]
}
}
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOpenRestriction;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyPlayReadyConfiguration;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyPlayReadyContentType;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyPlayReadyLicense;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyPlayReadyLicenseType;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyPlayReadyPlayRight;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyPlayReadyUnknownOutputPassingOption;
import com.azure.resourcemanager.mediaservices.models.SecurityLevel;
import java.time.OffsetDateTime;
import java.util.Arrays;
/**
* Samples for ContentKeyPolicies CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-
* policies-create-playready-open.json
*/
/**
* Sample code: Creates a Content Key Policy with PlayReady option and Open Restriction.
*
* @param manager Entry point to MediaServicesManager.
*/
public static void createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction(
com.azure.resourcemanager.mediaservices.MediaServicesManager manager) {
manager.contentKeyPolicies().define("PolicyWithPlayReadyOptionAndOpenRestriction")
.withExistingMediaService("contosorg", "contosomedia").withDescription("ArmPolicyDescription")
.withOptions(Arrays.asList(new ContentKeyPolicyOption().withName("ArmPolicyOptionName")
.withConfiguration(new ContentKeyPolicyPlayReadyConfiguration()
.withLicenses(Arrays.asList(new ContentKeyPolicyPlayReadyLicense().withAllowTestDevices(true)
.withSecurityLevel(SecurityLevel.SL150)
.withBeginDate(OffsetDateTime.parse("2017-10-16T18:22:53.46Z"))
.withPlayRight(new ContentKeyPolicyPlayReadyPlayRight().withScmsRestriction(2)
.withDigitalVideoOnlyContentRestriction(false)
.withImageConstraintForAnalogComponentVideoRestriction(true)
.withImageConstraintForAnalogComputerMonitorRestriction(false)
.withAllowPassingVideoContentToUnknownOutput(
ContentKeyPolicyPlayReadyUnknownOutputPassingOption.NOT_ALLOWED))
.withLicenseType(ContentKeyPolicyPlayReadyLicenseType.PERSISTENT)
.withContentKeyLocation(new ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader())
.withContentType(ContentKeyPolicyPlayReadyContentType.ULTRA_VIOLET_DOWNLOAD))))
.withRestriction(new ContentKeyPolicyOpenRestriction())))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.media import AzureMediaServices
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-media
# USAGE
python contentkeypoliciescreateplayreadyopen.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureMediaServices(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.content_key_policies.create_or_update(
resource_group_name="contoso",
account_name="contosomedia",
content_key_policy_name="PolicyWithPlayReadyOptionAndOpenRestriction",
parameters={
"properties": {
"description": "ArmPolicyDescription",
"options": [
{
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration",
"licenses": [
{
"allowTestDevices": True,
"beginDate": "2017-10-16T18:22:53.46Z",
"contentKeyLocation": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"
},
"contentType": "UltraVioletDownload",
"licenseType": "Persistent",
"playRight": {
"allowPassingVideoContentToUnknownOutput": "NotAllowed",
"digitalVideoOnlyContentRestriction": False,
"imageConstraintForAnalogComponentVideoRestriction": True,
"imageConstraintForAnalogComputerMonitorRestriction": False,
"scmsRestriction": 2,
},
"securityLevel": "SL150",
}
],
},
"name": "ArmPolicyOptionName",
"restriction": {"@odata.type": "#Microsoft.Media.ContentKeyPolicyOpenRestriction"},
}
],
}
},
)
print(response)
# x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armmediaservices_test
import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json
func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmediaservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewContentKeyPoliciesClient().CreateOrUpdate(ctx, "contoso", "contosomedia", "PolicyWithPlayReadyOptionAndOpenRestriction", armmediaservices.ContentKeyPolicy{
Properties: &armmediaservices.ContentKeyPolicyProperties{
Description: to.Ptr("ArmPolicyDescription"),
Options: []*armmediaservices.ContentKeyPolicyOption{
{
Name: to.Ptr("ArmPolicyOptionName"),
Configuration: &armmediaservices.ContentKeyPolicyPlayReadyConfiguration{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration"),
Licenses: []*armmediaservices.ContentKeyPolicyPlayReadyLicense{
{
AllowTestDevices: to.Ptr(true),
BeginDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-16T18:22:53.460Z"); return t }()),
ContentKeyLocation: &armmediaservices.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"),
},
ContentType: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload),
LicenseType: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyLicenseTypePersistent),
PlayRight: &armmediaservices.ContentKeyPolicyPlayReadyPlayRight{
AllowPassingVideoContentToUnknownOutput: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed),
DigitalVideoOnlyContentRestriction: to.Ptr(false),
ImageConstraintForAnalogComponentVideoRestriction: to.Ptr(true),
ImageConstraintForAnalogComputerMonitorRestriction: to.Ptr(false),
ScmsRestriction: to.Ptr[int32](2),
},
SecurityLevel: to.Ptr(armmediaservices.SecurityLevelSL150),
}},
},
Restriction: &armmediaservices.ContentKeyPolicyOpenRestriction{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyOpenRestriction"),
},
}},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ContentKeyPolicy = armmediaservices.ContentKeyPolicy{
// Name: to.Ptr("PolicyWithPlayReadyOptionAndOpenRestriction"),
// Type: to.Ptr("Microsoft.Media/mediaservices/contentKeyPolicies"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithPlayReadyOptionAndOpenRestriction"),
// Properties: &armmediaservices.ContentKeyPolicyProperties{
// Description: to.Ptr("ArmPolicyDescription"),
// Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2012-11-01T00:00:00.000Z"); return t}()),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-08T18:29:29.510Z"); return t}()),
// Options: []*armmediaservices.ContentKeyPolicyOption{
// {
// Name: to.Ptr("ArmPolicyOptionName"),
// Configuration: &armmediaservices.ContentKeyPolicyPlayReadyConfiguration{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration"),
// Licenses: []*armmediaservices.ContentKeyPolicyPlayReadyLicense{
// {
// AllowTestDevices: to.Ptr(true),
// BeginDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-16T18:22:53.460Z"); return t}()),
// ContentKeyLocation: &armmediaservices.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"),
// },
// ContentType: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload),
// LicenseType: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyLicenseTypePersistent),
// PlayRight: &armmediaservices.ContentKeyPolicyPlayReadyPlayRight{
// AllowPassingVideoContentToUnknownOutput: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed),
// DigitalVideoOnlyContentRestriction: to.Ptr(false),
// ImageConstraintForAnalogComponentVideoRestriction: to.Ptr(true),
// ImageConstraintForAnalogComputerMonitorRestriction: to.Ptr(false),
// ScmsRestriction: to.Ptr[int32](2),
// },
// SecurityLevel: to.Ptr(armmediaservices.SecurityLevelSL150),
// }},
// },
// PolicyOptionID: to.Ptr("c52f9af0-1f53-4775-8edb-af2d9a6e28cd"),
// Restriction: &armmediaservices.ContentKeyPolicyOpenRestriction{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyOpenRestriction"),
// },
// }},
// PolicyID: to.Ptr("a9bacd1d-60f5-4af3-8d2b-cf46ca5c9b04"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMediaServices } = require("@azure/arm-mediaservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Content Key Policy in the Media Services account
*
* @summary Create or update a Content Key Policy in the Media Services account
* x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json
*/
async function createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() {
const subscriptionId =
process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso";
const accountName = "contosomedia";
const contentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction";
const parameters = {
description: "ArmPolicyDescription",
options: [
{
name: "ArmPolicyOptionName",
configuration: {
odataType: "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration",
licenses: [
{
allowTestDevices: true,
beginDate: new Date("2017-10-16T18:22:53.46Z"),
contentKeyLocation: {
odataType:
"#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader",
},
contentType: "UltraVioletDownload",
licenseType: "Persistent",
playRight: {
allowPassingVideoContentToUnknownOutput: "NotAllowed",
digitalVideoOnlyContentRestriction: false,
imageConstraintForAnalogComponentVideoRestriction: true,
imageConstraintForAnalogComputerMonitorRestriction: false,
scmsRestriction: 2,
},
securityLevel: "SL150",
},
],
},
restriction: {
odataType: "#Microsoft.Media.ContentKeyPolicyOpenRestriction",
},
},
],
};
const credential = new DefaultAzureCredential();
const client = new AzureMediaServices(credential, subscriptionId);
const result = await client.contentKeyPolicies.createOrUpdate(
resourceGroupName,
accountName,
contentKeyPolicyName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Media;
using Azure.ResourceManager.Media.Models;
// Generated from example definition: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json
// this example is just showing the usage of "ContentKeyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this MediaServicesAccountResource created on azure
// for more information of creating MediaServicesAccountResource, please refer to the document of MediaServicesAccountResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "contoso";
string accountName = "contosomedia";
ResourceIdentifier mediaServicesAccountResourceId = MediaServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
MediaServicesAccountResource mediaServicesAccount = client.GetMediaServicesAccountResource(mediaServicesAccountResourceId);
// get the collection of this ContentKeyPolicyResource
ContentKeyPolicyCollection collection = mediaServicesAccount.GetContentKeyPolicies();
// invoke the operation
string contentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction";
ContentKeyPolicyData data = new ContentKeyPolicyData()
{
Description = "ArmPolicyDescription",
Options =
{
new ContentKeyPolicyOption(new ContentKeyPolicyPlayReadyConfiguration(new ContentKeyPolicyPlayReadyLicense[]
{
new ContentKeyPolicyPlayReadyLicense(true,ContentKeyPolicyPlayReadyLicenseType.Persistent,new ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader(),ContentKeyPolicyPlayReadyContentType.UltraVioletDownload)
{
SecurityLevel = PlayReadySecurityLevel.SL150,
BeginOn = DateTimeOffset.Parse("2017-10-16T18:22:53.46Z"),
PlayRight = new ContentKeyPolicyPlayReadyPlayRight(false,true,false,ContentKeyPolicyPlayReadyUnknownOutputPassingOption.NotAllowed)
{
ScmsRestriction = 2,
},
}
}),new ContentKeyPolicyOpenRestriction())
{
Name = "ArmPolicyOptionName",
}
},
};
ArmOperation<ContentKeyPolicyResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, contentKeyPolicyName, data);
ContentKeyPolicyResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContentKeyPolicyData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"name": "PolicyWithPlayReadyOptionAndOpenRestriction",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithPlayReadyOptionAndOpenRestriction",
"type": "Microsoft.Media/mediaservices/contentKeyPolicies",
"properties": {
"policyId": "a9bacd1d-60f5-4af3-8d2b-cf46ca5c9b04",
"created": "2012-11-01T00:00:00Z",
"lastModified": "2018-08-08T18:29:29.51Z",
"description": "ArmPolicyDescription",
"options": [
{
"policyOptionId": "c52f9af0-1f53-4775-8edb-af2d9a6e28cd",
"name": "ArmPolicyOptionName",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration",
"licenses": [
{
"allowTestDevices": true,
"beginDate": "2017-10-16T18:22:53.46Z",
"playRight": {
"scmsRestriction": 2,
"digitalVideoOnlyContentRestriction": false,
"imageConstraintForAnalogComponentVideoRestriction": true,
"imageConstraintForAnalogComputerMonitorRestriction": false,
"allowPassingVideoContentToUnknownOutput": "NotAllowed"
},
"licenseType": "Persistent",
"contentKeyLocation": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"
},
"contentType": "UltraVioletDownload",
"securityLevel": "SL150"
}
]
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyOpenRestriction"
}
}
]
}
}
{
"name": "PolicyWithPlayReadyOptionAndOpenRestriction",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithPlayReadyOptionAndOpenRestriction",
"type": "Microsoft.Media/mediaservices/contentKeyPolicies",
"properties": {
"policyId": "a9bacd1d-60f5-4af3-8d2b-cf46ca5c9b04",
"created": "2012-11-01T00:00:00Z",
"lastModified": "2018-08-08T18:29:29.51Z",
"description": "ArmPolicyDescription",
"options": [
{
"policyOptionId": "c52f9af0-1f53-4775-8edb-af2d9a6e28cd",
"name": "ArmPolicyOptionName",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration",
"licenses": [
{
"allowTestDevices": true,
"beginDate": "2017-10-16T18:22:53.46Z",
"playRight": {
"scmsRestriction": 2,
"digitalVideoOnlyContentRestriction": false,
"imageConstraintForAnalogComponentVideoRestriction": true,
"imageConstraintForAnalogComputerMonitorRestriction": false,
"allowPassingVideoContentToUnknownOutput": "NotAllowed"
},
"licenseType": "Persistent",
"contentKeyLocation": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"
},
"contentType": "UltraVioletDownload",
"securityLevel": "SL150"
}
]
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyOpenRestriction"
}
}
]
}
}
Creates a Content Key Policy with Widevine option and Token Restriction
Beispielanforderung
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaServices/contosomedia/contentKeyPolicies/PolicyWithWidevineOptionAndJwtTokenRestriction?api-version=2022-08-01
{
"properties": {
"description": "ArmPolicyDescription",
"options": [
{
"name": "widevineoption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
"widevineTemplate": "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyRsaTokenKey",
"exponent": "AQAB",
"modulus": "AQAD"
},
"alternateVerificationKeys": [
{
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": "AAAAAAAAAAAAAAAAAAAAAA=="
}
],
"restrictionTokenType": "Jwt"
}
}
]
}
}
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyRestrictionTokenType;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyRsaTokenKey;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicySymmetricTokenKey;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyTokenRestriction;
import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyWidevineConfiguration;
import java.util.Arrays;
/**
* Samples for ContentKeyPolicies CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-
* policies-create-widevine-token.json
*/
/**
* Sample code: Creates a Content Key Policy with Widevine option and Token Restriction.
*
* @param manager Entry point to MediaServicesManager.
*/
public static void createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction(
com.azure.resourcemanager.mediaservices.MediaServicesManager manager) {
manager.contentKeyPolicies().define("PolicyWithWidevineOptionAndJwtTokenRestriction")
.withExistingMediaService("contosorg", "contosomedia").withDescription("ArmPolicyDescription")
.withOptions(Arrays.asList(new ContentKeyPolicyOption().withName("widevineoption")
.withConfiguration(new ContentKeyPolicyWidevineConfiguration().withWidevineTemplate(
"{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"))
.withRestriction(new ContentKeyPolicyTokenRestriction().withIssuer("urn:issuer")
.withAudience("urn:audience")
.withPrimaryVerificationKey(new ContentKeyPolicyRsaTokenKey().withExponent("AQAB".getBytes())
.withModulus("AQAD".getBytes()))
.withAlternateVerificationKeys(Arrays.asList(
new ContentKeyPolicySymmetricTokenKey().withKeyValue("AAAAAAAAAAAAAAAAAAAAAA==".getBytes())))
.withRestrictionTokenType(ContentKeyPolicyRestrictionTokenType.JWT))))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.media import AzureMediaServices
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-media
# USAGE
python contentkeypoliciescreatewidevinetoken.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureMediaServices(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.content_key_policies.create_or_update(
resource_group_name="contoso",
account_name="contosomedia",
content_key_policy_name="PolicyWithWidevineOptionAndJwtTokenRestriction",
parameters={
"properties": {
"description": "ArmPolicyDescription",
"options": [
{
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
"widevineTemplate": '{"allowed_track_types":"SD_HD","content_key_specs":[{"track_type":"SD","security_level":1,"required_output_protection":{"hdcp":"HDCP_V2"}}],"policy_overrides":{"can_play":true,"can_persist":true,"can_renew":false}}',
},
"name": "widevineoption",
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"alternateVerificationKeys": [
{
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": "AAAAAAAAAAAAAAAAAAAAAA==",
}
],
"audience": "urn:audience",
"issuer": "urn:issuer",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyRsaTokenKey",
"exponent": "AQAB",
"modulus": "AQAD",
},
"restrictionTokenType": "Jwt",
},
}
],
}
},
)
print(response)
# x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armmediaservices_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json
func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmediaservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewContentKeyPoliciesClient().CreateOrUpdate(ctx, "contoso", "contosomedia", "PolicyWithWidevineOptionAndJwtTokenRestriction", armmediaservices.ContentKeyPolicy{
Properties: &armmediaservices.ContentKeyPolicyProperties{
Description: to.Ptr("ArmPolicyDescription"),
Options: []*armmediaservices.ContentKeyPolicyOption{
{
Name: to.Ptr("widevineoption"),
Configuration: &armmediaservices.ContentKeyPolicyWidevineConfiguration{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration"),
WidevineTemplate: to.Ptr("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"),
},
Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"),
AlternateVerificationKeys: []armmediaservices.ContentKeyPolicyRestrictionTokenKeyClassification{
&armmediaservices.ContentKeyPolicySymmetricTokenKey{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"),
KeyValue: []byte("AAAAAAAAAAAAAAAAAAAAAA=="),
}},
Audience: to.Ptr("urn:audience"),
Issuer: to.Ptr("urn:issuer"),
PrimaryVerificationKey: &armmediaservices.ContentKeyPolicyRsaTokenKey{
ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyRsaTokenKey"),
Exponent: []byte("AQAB"),
Modulus: []byte("AQAD"),
},
RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeJwt),
},
}},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ContentKeyPolicy = armmediaservices.ContentKeyPolicy{
// Name: to.Ptr("PolicyWithWidevineOptionAndJwtTokenRestriction"),
// Type: to.Ptr("Microsoft.Media/mediaservices/contentKeyPolicies"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithWidevineOptionAndJwtTokenRestriction"),
// Properties: &armmediaservices.ContentKeyPolicyProperties{
// Description: to.Ptr("ArmPolicyDescription"),
// Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-08T18:29:29.663Z"); return t}()),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-08T18:29:29.663Z"); return t}()),
// Options: []*armmediaservices.ContentKeyPolicyOption{
// {
// Name: to.Ptr("widevineoption"),
// Configuration: &armmediaservices.ContentKeyPolicyWidevineConfiguration{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration"),
// WidevineTemplate: to.Ptr("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"),
// },
// PolicyOptionID: to.Ptr("26fee004-8dfa-4828-bcad-5e63c637534f"),
// Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"),
// AlternateVerificationKeys: []armmediaservices.ContentKeyPolicyRestrictionTokenKeyClassification{
// &armmediaservices.ContentKeyPolicySymmetricTokenKey{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"),
// KeyValue: []byte(""),
// }},
// Audience: to.Ptr("urn:audience"),
// Issuer: to.Ptr("urn:issuer"),
// PrimaryVerificationKey: &armmediaservices.ContentKeyPolicyRsaTokenKey{
// ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyRsaTokenKey"),
// Exponent: []byte(""),
// Modulus: []byte(""),
// },
// RequiredClaims: []*armmediaservices.ContentKeyPolicyTokenClaim{
// },
// RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeJwt),
// },
// }},
// PolicyID: to.Ptr("bad1d030-7d5c-4643-8f1e-49807a4bf64c"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureMediaServices } = require("@azure/arm-mediaservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create or update a Content Key Policy in the Media Services account
*
* @summary Create or update a Content Key Policy in the Media Services account
* x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json
*/
async function createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() {
const subscriptionId =
process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso";
const accountName = "contosomedia";
const contentKeyPolicyName = "PolicyWithWidevineOptionAndJwtTokenRestriction";
const parameters = {
description: "ArmPolicyDescription",
options: [
{
name: "widevineoption",
configuration: {
odataType: "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
widevineTemplate:
'{"allowed_track_types":"SD_HD","content_key_specs":[{"track_type":"SD","security_level":1,"required_output_protection":{"hdcp":"HDCP_V2"}}],"policy_overrides":{"can_play":true,"can_persist":true,"can_renew":false}}',
},
restriction: {
odataType: "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
alternateVerificationKeys: [
{
odataType: "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
keyValue: Buffer.from("AAAAAAAAAAAAAAAAAAAAAA=="),
},
],
audience: "urn:audience",
issuer: "urn:issuer",
primaryVerificationKey: {
odataType: "#Microsoft.Media.ContentKeyPolicyRsaTokenKey",
exponent: Buffer.from("AQAB"),
modulus: Buffer.from("AQAD"),
},
restrictionTokenType: "Jwt",
},
},
],
};
const credential = new DefaultAzureCredential();
const client = new AzureMediaServices(credential, subscriptionId);
const result = await client.contentKeyPolicies.createOrUpdate(
resourceGroupName,
accountName,
contentKeyPolicyName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Media;
using Azure.ResourceManager.Media.Models;
// Generated from example definition: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json
// this example is just showing the usage of "ContentKeyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this MediaServicesAccountResource created on azure
// for more information of creating MediaServicesAccountResource, please refer to the document of MediaServicesAccountResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "contoso";
string accountName = "contosomedia";
ResourceIdentifier mediaServicesAccountResourceId = MediaServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
MediaServicesAccountResource mediaServicesAccount = client.GetMediaServicesAccountResource(mediaServicesAccountResourceId);
// get the collection of this ContentKeyPolicyResource
ContentKeyPolicyCollection collection = mediaServicesAccount.GetContentKeyPolicies();
// invoke the operation
string contentKeyPolicyName = "PolicyWithWidevineOptionAndJwtTokenRestriction";
ContentKeyPolicyData data = new ContentKeyPolicyData()
{
Description = "ArmPolicyDescription",
Options =
{
new ContentKeyPolicyOption(new ContentKeyPolicyWidevineConfiguration("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"),new ContentKeyPolicyTokenRestriction("urn:issuer","urn:audience",new ContentKeyPolicyRsaTokenKey(Convert.FromBase64String("AQAB"),Convert.FromBase64String("AQAD")),ContentKeyPolicyRestrictionTokenType.Jwt)
{
AlternateVerificationKeys =
{
new ContentKeyPolicySymmetricTokenKey(Convert.FromBase64String("AAAAAAAAAAAAAAAAAAAAAA=="))
},
})
{
Name = "widevineoption",
}
},
};
ArmOperation<ContentKeyPolicyResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, contentKeyPolicyName, data);
ContentKeyPolicyResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContentKeyPolicyData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"name": "PolicyWithWidevineOptionAndJwtTokenRestriction",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithWidevineOptionAndJwtTokenRestriction",
"type": "Microsoft.Media/mediaservices/contentKeyPolicies",
"properties": {
"policyId": "bad1d030-7d5c-4643-8f1e-49807a4bf64c",
"created": "2018-08-08T18:29:29.663Z",
"lastModified": "2018-08-08T18:29:29.663Z",
"description": "ArmPolicyDescription",
"options": [
{
"policyOptionId": "26fee004-8dfa-4828-bcad-5e63c637534f",
"name": "widevineoption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
"widevineTemplate": "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyRsaTokenKey",
"exponent": "",
"modulus": ""
},
"alternateVerificationKeys": [
{
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": ""
}
],
"requiredClaims": [],
"restrictionTokenType": "Jwt"
}
}
]
}
}
{
"name": "PolicyWithWidevineOptionAndJwtTokenRestriction",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosorg/providers/Microsoft.Media/mediaservices/contosomedia/contentKeyPolicies/PolicyWithWidevineOptionAndJwtTokenRestriction",
"type": "Microsoft.Media/mediaservices/contentKeyPolicies",
"properties": {
"policyId": "bad1d030-7d5c-4643-8f1e-49807a4bf64c",
"created": "2018-08-08T18:29:29.663Z",
"lastModified": "2018-08-08T18:29:29.663Z",
"description": "ArmPolicyDescription",
"options": [
{
"policyOptionId": "26fee004-8dfa-4828-bcad-5e63c637534f",
"name": "widevineoption",
"configuration": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
"widevineTemplate": "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"
},
"restriction": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
"issuer": "urn:issuer",
"audience": "urn:audience",
"primaryVerificationKey": {
"@odata.type": "#Microsoft.Media.ContentKeyPolicyRsaTokenKey",
"exponent": "",
"modulus": ""
},
"alternateVerificationKeys": [
{
"@odata.type": "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
"keyValue": ""
}
],
"requiredClaims": [],
"restrictionTokenType": "Jwt"
}
}
]
}
}
Definitionen
ContentKeyPolicy
Eine Inhaltsschlüsselrichtlinie-Ressource.
Name |
Typ |
Beschreibung |
id
|
string
|
Vollqualifizierte Ressourcen-ID für die Ressource. Beispiel: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
Der Name der Ressource
|
properties.created
|
string
|
Das Erstellungsdatum der Richtlinie.
|
properties.description
|
string
|
Eine Beschreibung der Richtlinie.
|
properties.lastModified
|
string
|
Das Datum der letzten Änderung der Richtlinie.
|
properties.options
|
ContentKeyPolicyOption[]
|
Die Optionen für die Schlüsselrichtlinie.
|
properties.policyId
|
string
|
Die ID der Legacyrichtlinie.
|
systemData
|
systemData
|
Die Systemmetadaten, die sich auf diese Ressource beziehen.
|
type
|
string
|
Der Typ der Ressource. Z. B. "Microsoft.Compute/virtualMachines" oder "Microsoft.Storage/storageAccounts"
|
ContentKeyPolicyClearKeyConfiguration
Stellt eine Konfiguration für Nicht-DRM-Schlüssel dar.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration
|
Der Diskriminator für abgeleitete Typen.
|
ContentKeyPolicyFairPlayConfiguration
Gibt eine Konfiguration für FairPlay-Lizenzen an.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration
|
Der Diskriminator für abgeleitete Typen.
|
ask
|
string
|
Der Schlüssel, der als FairPlay Application Secret-Schlüssel verwendet werden muss. Dies muss base64-codiert sein.
|
fairPlayPfx
|
string
|
Die Base64-Darstellung des FairPlay-Zertifikats im PKCS 12-Format (pfx) (einschließlich privatem Schlüssel).
|
fairPlayPfxPassword
|
string
|
Das Kennwort, das das FairPlay-Zertifikat im PKCS 12-Format (pfx) verschlüsselt.
|
offlineRentalConfiguration
|
ContentKeyPolicyFairPlayOfflineRentalConfiguration
|
Offline-Mietrichtlinie
|
rentalAndLeaseKeyType
|
ContentKeyPolicyFairPlayRentalAndLeaseKeyType
|
Der Miet- und Leaseschlüsseltyp.
|
rentalDuration
|
integer
|
Die Mietdauer. Muss größer als oder gleich 0 sein.
|
ContentKeyPolicyFairPlayOfflineRentalConfiguration
Name |
Typ |
Beschreibung |
playbackDurationSeconds
|
integer
|
Wiedergabedauer
|
storageDurationSeconds
|
integer
|
Speicherdauer
|
ContentKeyPolicyFairPlayRentalAndLeaseKeyType
Der Miet- und Leaseschlüsseltyp.
Name |
Typ |
Beschreibung |
DualExpiry
|
string
|
Dualer Ablauf für die Offline-Vermietung.
|
PersistentLimited
|
string
|
Der Inhaltsschlüssel kann beibehalten werden, und die gültige Dauer wird durch den Wert der Mietdauer begrenzt.
|
PersistentUnlimited
|
string
|
Der Inhaltsschlüssel kann mit einer unbegrenzten Dauer beibehalten werden.
|
Undefined
|
string
|
Die Schlüsseldauer wird nicht angegeben.
|
Unknown
|
string
|
Stellt einen ContentKeyPolicyFairPlayRentalAndLeaseKeyType dar, der in der aktuellen API-Version nicht verfügbar ist.
|
ContentKeyPolicyOpenRestriction
Stellt eine offene Einschränkung dar. Die Lizenz oder der Schlüssel werden bei jeder Anforderung übermittelt.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyOpenRestriction
|
Der Diskriminator für abgeleitete Typen.
|
ContentKeyPolicyOption
Stellt eine Richtlinienoption dar.
Name |
Typ |
Beschreibung |
configuration
|
ContentKeyPolicyConfiguration:
|
Die Schlüsselübermittlungskonfiguration.
|
name
|
string
|
Die Beschreibung der Richtlinienoption.
|
policyOptionId
|
string
|
Die Legacy-Richtlinienoptions-ID.
|
restriction
|
ContentKeyPolicyRestriction:
|
Die Anforderungen, die erfüllt werden müssen, um Schlüssel mit dieser Konfiguration bereitzustellen
|
ContentKeyPolicyPlayReadyConfiguration
Gibt eine Konfiguration für PlayReady-Lizenzen an.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration
|
Der Diskriminator für abgeleitete Typen.
|
licenses
|
ContentKeyPolicyPlayReadyLicense[]
|
Die PlayReady-Lizenzen.
|
responseCustomData
|
string
|
Die benutzerdefinierten Antwortdaten.
|
Gibt an, dass sich die Inhaltsschlüssel-ID im PlayReady-Header befindet.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
|
Der Diskriminator für abgeleitete Typen.
|
ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
Gibt an, dass die Inhaltsschlüssel-ID in der PlayReady-Konfiguration angegeben wird.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
|
Der Diskriminator für abgeleitete Typen.
|
keyId
|
string
|
Die Inhaltsschlüssel-ID.
|
ContentKeyPolicyPlayReadyContentType
Der PlayReady-Inhaltstyp.
Name |
Typ |
Beschreibung |
UltraVioletDownload
|
string
|
Inhaltstyp ultravioletter Download.
|
UltraVioletStreaming
|
string
|
Ultraviolettes Streaminginhaltstyp.
|
Unknown
|
string
|
Stellt einen ContentKeyPolicyPlayReadyContentType dar, der in der aktuellen API-Version nicht verfügbar ist.
|
Unspecified
|
string
|
Nicht angegebener Inhaltstyp.
|
ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction
Konfiguriert die Steuerungsbits für explizite analoge Fernsehausgaben. Weitere Informationen finden Sie in den PlayReady-Complianceregeln.
Name |
Typ |
Beschreibung |
bestEffort
|
boolean
|
Gibt an, ob diese Einschränkung auf Best Effort-Basis erzwungen wird.
|
configurationData
|
integer
|
Konfiguriert die Einschränkungssteuerungsbits. Muss zwischen 0 und 3 inklusive sein.
|
ContentKeyPolicyPlayReadyLicense
Die PlayReady-Lizenz
Name |
Typ |
Beschreibung |
allowTestDevices
|
boolean
|
Ein Flag, das angibt, ob Testgeräte die Lizenz verwenden können.
|
beginDate
|
string
|
Das Anfangsdatum der Lizenz
|
contentKeyLocation
|
ContentKeyPolicyPlayReadyContentKeyLocation:
|
Der Speicherort des Inhaltsschlüssels.
|
contentType
|
ContentKeyPolicyPlayReadyContentType
|
Der PlayReady-Inhaltstyp.
|
expirationDate
|
string
|
Das Ablaufdatum der Lizenz.
|
gracePeriod
|
string
|
Die Nachfrist der Lizenz.
|
licenseType
|
ContentKeyPolicyPlayReadyLicenseType
|
Der Lizenztyp.
|
playRight
|
ContentKeyPolicyPlayReadyPlayRight
|
Die Lizenz PlayRight
|
relativeBeginDate
|
string
|
Das relative Anfangsdatum der Lizenz.
|
relativeExpirationDate
|
string
|
Das relative Ablaufdatum der Lizenz.
|
securityLevel
|
SecurityLevel
|
Die Sicherheitsstufe.
|
ContentKeyPolicyPlayReadyLicenseType
Der Lizenztyp.
Name |
Typ |
Beschreibung |
NonPersistent
|
string
|
Nicht persistente Lizenz.
|
Persistent
|
string
|
Persistente Lizenz. Ermöglicht die Offlinewiedergabe.
|
Unknown
|
string
|
Stellt einen ContentKeyPolicyPlayReadyLicenseType dar, der in der aktuellen API-Version nicht verfügbar ist.
|
ContentKeyPolicyPlayReadyPlayRight
Konfiguriert das Play Right in der PlayReady-Lizenz.
Name |
Typ |
Beschreibung |
agcAndColorStripeRestriction
|
integer
|
Konfiguriert die automatische Verstärkungssteuerung (Automatic Gain Control, AGC) und Den Farbstreifen in der Lizenz. Muss zwischen 0 und 3 inklusive sein.
|
allowPassingVideoContentToUnknownOutput
|
ContentKeyPolicyPlayReadyUnknownOutputPassingOption
|
Konfiguriert Unbekannte Ausgabebehandlungseinstellungen der Lizenz.
|
analogVideoOpl
|
integer
|
Gibt die Ausgabeschutzebene für komprimiertes digitales Audio an.
|
compressedDigitalAudioOpl
|
integer
|
Gibt die Ausgabeschutzebene für komprimiertes digitales Audio an.
|
compressedDigitalVideoOpl
|
integer
|
Gibt die Ausgabeschutzebene für komprimiertes digitales Video an.
|
digitalVideoOnlyContentRestriction
|
boolean
|
Aktiviert die Bildeinschränkung für die Videoeinschränkung analoger Komponenten in der Lizenz.
|
explicitAnalogTelevisionOutputRestriction
|
ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction
|
Konfiguriert die Explizite Ausgangsbeschränkung für analoges Fernsehen in der Lizenz. Konfigurationsdaten müssen zwischen 0 und 3 einschließlich liegen.
|
firstPlayExpiration
|
string
|
Die Zeitspanne, in der die Lizenz gültig ist, nachdem die Lizenz zuerst zum Wiedergeben von Inhalten verwendet wird.
|
imageConstraintForAnalogComponentVideoRestriction
|
boolean
|
Aktiviert die Bildeinschränkung für die Videoeinschränkung analoger Komponenten in der Lizenz.
|
imageConstraintForAnalogComputerMonitorRestriction
|
boolean
|
Aktiviert die Bildeinschränkung für die Videoeinschränkung analoger Komponenten in der Lizenz.
|
scmsRestriction
|
integer
|
Konfiguriert das Serial Copy Management System (SCMS) in der Lizenz. Muss zwischen 0 und 3 inklusive sein.
|
uncompressedDigitalAudioOpl
|
integer
|
Gibt die Ausgabeschutzebene für nicht komprimiertes digitales Audio an.
|
uncompressedDigitalVideoOpl
|
integer
|
Gibt die Ausgabeschutzebene für nicht komprimiertes digitales Video an.
|
ContentKeyPolicyPlayReadyUnknownOutputPassingOption
Konfiguriert Unbekannte Ausgabebehandlungseinstellungen der Lizenz.
Name |
Typ |
Beschreibung |
Allowed
|
string
|
Das Übergeben des Videoteils geschützter Inhalte an eine unbekannte Ausgabe ist zulässig.
|
AllowedWithVideoConstriction
|
string
|
Das Übergeben des Videoteils geschützter Inhalte an eine unbekannte Ausgabe ist zulässig, jedoch mit eingeschränkter Auflösung.
|
NotAllowed
|
string
|
Das Übergeben des Videoteils geschützter Inhalte an eine unbekannte Ausgabe ist nicht zulässig.
|
Unknown
|
string
|
Stellt eine ContentKeyPolicyPlayReadyUnknownOutputPassingOption dar, die in der aktuellen API-Version nicht verfügbar ist.
|
ContentKeyPolicyRestrictionTokenType
Der Tokentyp.
Name |
Typ |
Beschreibung |
Jwt
|
string
|
JSON-Webtoken.
|
Swt
|
string
|
Einfaches Webtoken.
|
Unknown
|
string
|
Stellt einen ContentKeyPolicyRestrictionTokenType dar, der in der aktuellen API-Version nicht verfügbar ist.
|
ContentKeyPolicyRsaTokenKey
Gibt einen RSA-Schlüssel für die Tokenüberprüfung an.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyRsaTokenKey
|
Der Diskriminator für abgeleitete Typen.
|
exponent
|
string
|
Der RSA-Parameterexponent
|
modulus
|
string
|
Das RSA-Parametermodul
|
ContentKeyPolicySymmetricTokenKey
Gibt einen symmetrischen Schlüssel für die Tokenüberprüfung an.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicySymmetricTokenKey
|
Der Diskriminator für abgeleitete Typen.
|
keyValue
|
string
|
Der Schlüsselwert des Schlüssels
|
ContentKeyPolicyTokenClaim
Stellt einen Tokenanspruch dar.
Name |
Typ |
Beschreibung |
claimType
|
string
|
Tokenanspruchstyp.
|
claimValue
|
string
|
Tokenanspruchswert.
|
ContentKeyPolicyTokenRestriction
Stellt eine Tokeneinschränkung dar. Das bereitgestellte Token muss diesen Anforderungen für eine erfolgreiche Lizenz- oder Schlüsselübermittlung entsprechen.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyTokenRestriction
|
Der Diskriminator für abgeleitete Typen.
|
alternateVerificationKeys
|
ContentKeyPolicyRestrictionTokenKey[]:
|
Eine Liste mit alternativen Überprüfungsschlüsseln.
|
audience
|
string
|
Die Zielgruppe für das Token.
|
issuer
|
string
|
Der Tokenaussteller.
|
openIdConnectDiscoveryDocument
|
string
|
Das OpenID-Verbindungsermittlungsdokument.
|
primaryVerificationKey
|
ContentKeyPolicyRestrictionTokenKey:
|
Der primäre Überprüfungsschlüssel.
|
requiredClaims
|
ContentKeyPolicyTokenClaim[]
|
Eine Liste der erforderlichen Tokenansprüche.
|
restrictionTokenType
|
ContentKeyPolicyRestrictionTokenType
|
Der Tokentyp.
|
ContentKeyPolicyUnknownConfiguration
Stellt eine ContentKeyPolicyConfiguration dar, die in der aktuellen API-Version nicht verfügbar ist.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyUnknownConfiguration
|
Der Diskriminator für abgeleitete Typen.
|
ContentKeyPolicyUnknownRestriction
Stellt eine ContentKeyPolicyRestriction dar, die in der aktuellen API-Version nicht verfügbar ist.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyUnknownRestriction
|
Der Diskriminator für abgeleitete Typen.
|
ContentKeyPolicyWidevineConfiguration
Gibt eine Konfiguration für Widevine-Lizenzen an.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyWidevineConfiguration
|
Der Diskriminator für abgeleitete Typen.
|
widevineTemplate
|
string
|
Die Widevine-Vorlage.
|
ContentKeyPolicyX509CertificateTokenKey
Gibt ein Zertifikat für die Tokenüberprüfung an.
Name |
Typ |
Beschreibung |
@odata.type
|
string:
#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey
|
Der Diskriminator für abgeleitete Typen.
|
rawBody
|
string
|
Das Rohdatenfeld eines Zertifikats im PKCS 12-Format (X509Certificate2 in .NET)
|
createdByType
Der Identitätstyp, der die Ressource erstellt hat.
Name |
Typ |
Beschreibung |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
ErrorAdditionalInfo
Zusätzliche Informationen zum Ressourcenverwaltungsfehler.
Name |
Typ |
Beschreibung |
info
|
object
|
Zusätzliche Informationen.
|
type
|
string
|
Typ der zusätzlichen Informationen.
|
ErrorDetail
Die Fehlerdetails.
Name |
Typ |
Beschreibung |
additionalInfo
|
ErrorAdditionalInfo[]
|
Die zusätzlichen Fehlerinformationen.
|
code
|
string
|
Der Fehlercode.
|
details
|
ErrorDetail[]
|
Die Fehlerdetails.
|
message
|
string
|
Die Fehlermeldung.
|
target
|
string
|
Das Fehlerziel.
|
ErrorResponse
Fehlerantwort
Name |
Typ |
Beschreibung |
error
|
ErrorDetail
|
Das Fehlerobjekt.
|
SecurityLevel
Die Sicherheitsstufe.
Name |
Typ |
Beschreibung |
SL150
|
string
|
Für Clients, die sich in der Entwicklung oder im Test befinden. Kein Schutz vor unbefugter Verwendung.
|
SL2000
|
string
|
Für gehärtete Geräte und Anwendungen, die kommerzielle Inhalte nutzen. Software- oder Hardwareschutz.
|
SL3000
|
string
|
Nur für gehärtete Geräte. Hardwareschutz.
|
Unknown
|
string
|
Stellt einen SecurityLevel dar, der in der aktuellen API-Version nicht verfügbar ist.
|
systemData
Metadaten, die sich auf die Erstellung und letzte Änderung der Ressource beziehen.
Name |
Typ |
Beschreibung |
createdAt
|
string
|
Der Zeitstempel der Ressourcenerstellung (UTC).
|
createdBy
|
string
|
Die Identität, die die Ressource erstellt hat.
|
createdByType
|
createdByType
|
Der Identitätstyp, der die Ressource erstellt hat.
|
lastModifiedAt
|
string
|
Der Zeitstempel der letzten Änderung der Ressource (UTC)
|
lastModifiedBy
|
string
|
Die Identität, die die Ressource zuletzt geändert hat.
|
lastModifiedByType
|
createdByType
|
Der Identitätstyp, der die Ressource zuletzt geändert hat.
|