Azure / azure-sdk-for-php

Microsoft Azure SDK for PHP
http://azure.microsoft.com/en-us/develop/php/
Apache License 2.0
415 stars 273 forks source link

Azure AD Support for Azure Media Services #959

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi everyone,

This PR modifies the Azure Media Services library to use Azure Active Directory (Azure AD) as the authentication mechanism. Please note that this change removes the previous authentication mechanism (ACS).

It is expected that any existing continuous integration configured on GitHub will fail to run integration/unit tests, as the authentication has changed. In particular, some environment variables have been removed (the testing tool does not read them anymore) and some others were added. See details below:

Removed environment variables

The following variables can be safely removed from the CI configuration:

AZURE_MEDIA_SERVICES_ACCOUNT_NAME
AZURE_MEDIA_SERVICES_ACCESS_KEY
AZURE_MEDIA_SERVICES_ENDPOINT_URI
AZURE_MEDIA_SERVICES_OAUTH_ENDPOINT_URI

Added environment variables

# Azure Environment. Valid values: AZURE_CLOUD_ENVIRONMENT, AZURE_CHINA_CLOUD_ENVIRONMENT, AZURE_GERMAN_CLOUD_ENVIRONMENT, AZURE_US_GOVERNMENT_ENVIRONMENT
setx AZURE_MEDIA_SERVICES_ENVIRONMENT AZURE_CLOUD_ENVIRONMENT

# Azure AD Service Principal settings for authentication (replace placeholders below)
setx AZURE_MEDIA_SERVICES_TENANT <my_tenat_domain_name>.onmicrosoft.com
setx AZURE_MEDIA_SERVICES_CLIENT_ID <my_aad_app_client_id>
setx AZURE_MEDIA_SERVICES_CLIENT_KEY <my_aad_app_client_key>

# Azure Media Services Account Endpoint (replace placeholders below)
setx AZURE_MEDIA_SERVICES_REST_API_ENDPOINT https://<my_account>.restv2.<my_region>.media.azure.net/api/

Please note that, in order to get the CI running again, the above environment variables must be configured with the valid Azure AD values for the Azure Media Service test account. To obtain the Azure AD values for the AMS account, please refer to: https://docs.microsoft.com/en-us/azure/media-services/media-services-portal-get-started-with-aad#service-principal-authentication

Please let me know if you have any questions!

msftclas commented 6 years ago

CLA assistant check
All CLA requirements met.

sergey-shandar commented 6 years ago

Related PR which is merged https://github.com/Azure/azure-sdk-for-php/pull/958#pullrequestreview-79285331