This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Retriving vnet information | |
$vnet = Get-AzVirtualNetwork -Name vnet-americasuniversity -ResourceGroupName CoreResources | |
# Adding appgtw-subnet to the existing VNet | |
$subnetAGConfig = Add-AzVirtualNetworkSubnetConfig ` | |
-Name appgtw-subnet ` | |
-AddressPrefix 10.1.5.0/28 ` | |
-VirtualNetwork $vnet | |
# Adding apim-subnet to the existing VNet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$resGroupName = "AUManager_Shared_Resources" | |
$location = "eastus" # select your prefered region | |
New-AzResourceGroup -Name $resGroupName -Location $location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task<ActionResult> RunQueryVideoAsync(SearchDataVideo model) | |
{ | |
// Retrieving the access token from the service | |
string accessToken = await GetVideoIndexerAccessToken(); | |
// Setting up HTTP client request | |
HttpClient _httpClientSearchVideos = new HttpClient(); | |
// Pulling off video indexer API information | |
_builder = new ConfigurationBuilder().AddJsonFile("appsettings.json"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task<ActionResult> RunQueryAsync(SearchData model) | |
{ | |
InitSearch(); | |
var parameters = new SearchParameters | |
{ | |
// Enter content property names into this list so only these values will be returned. | |
// If Select is empty, all values will be returned, which can be inefficient. | |
Select = new[] { "Column1", "Column2", "ColumnN" } | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("A_InsightsGenerator")] | |
public static string GeneratesInsights([ActivityTrigger] AMSVideo amsVideoPublished, TraceWriter log) | |
{ | |
// Building up Json sentence | |
dynamic flexibleObj = new ExpandoObject(); | |
flexibleObj.assetId = amsVideoPublished.Asset.Id; | |
flexibleObj.videoFileName = amsVideoPublished.Video.VideoFileName; | |
flexibleObj.streamingVideoURL = amsVideoPublished.StreamingURL; | |
var jsonStr = JsonConvert.SerializeObject(flexibleObj); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("A_PublishesEncodedAsset")] | |
public static async Task<string> PublishesEncodedAsset([ActivityTrigger] string resultEncoding, TraceWriter log) | |
{ | |
// Step 1: Create the context | |
AzureAdTokenCredentials tokenCredentials = new AzureAdTokenCredentials(_tenantDomain, new AzureAdClientSymmetricKey(_clientId, _clientSecret), AzureEnvironments.AzureCloudEnvironment); | |
var tokenProvider = new AzureAdTokenProvider(tokenCredentials); | |
_context = new CloudMediaContext(new Uri(_restApiUrl), tokenProvider); | |
string streamingUrl; | |
// Step 2: Builds the streaming url for the encoded and published asset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("A_JobEncodingGenerator")] | |
public static string GeneratesEncoder([ActivityTrigger] InitialSetupResult initialSetupResult, TraceWriter log) | |
{ | |
IJob job; | |
// Step 1: Setting up queue, context and endpoint | |
string endPointAddress = Guid.NewGuid().ToString(); | |
AzureAdTokenCredentials tokenCredentials = new AzureAdTokenCredentials(_tenantDomain, new AzureAdClientSymmetricKey(_clientId, _clientSecret), AzureEnvironments.AzureCloudEnvironment); | |
var tokenProvider = new AzureAdTokenProvider(tokenCredentials); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class A_InitialSetupGenerator | |
{ | |
// AD auth variables | |
static readonly string _tenantDomain = Environment.GetEnvironmentVariable("AMSAADTenantDomain"); | |
static readonly string _restApiUrl = Environment.GetEnvironmentVariable("AMSRESTAPIEndpoint"); | |
static readonly string _clientId = Environment.GetEnvironmentVariable("AMSClientId"); | |
static readonly string _clientSecret = Environment.GetEnvironmentVariable("AMSClientSecret"); | |
static readonly string _storageConnection = Environment.GetEnvironmentVariable("StorageAccountConnection"); | |
[FunctionName("A_InitialSetupGenerator")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("O_Orchestrator")] | |
public static async Task<object> OrchestratesVideoProcessing([OrchestrationTrigger] DurableOrchestrationContext context, TraceWriter log) | |
{ | |
HttpResponseMessage httpResponse = new HttpResponseMessage(); | |
// Holding the video location through the context | |
var videoDto = context.GetInput<VideoAMS>(); | |
InitialSetupResult resultInitialSetup; | |
AMSVideo amsVideoPublished; | |
string resultEncoding, resultPublishing, resultInsights; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("Starter")] | |
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequestMessage req, [OrchestrationClient] DurableOrchestrationClient starter, TraceWriter log) | |
{ | |
// Reading call's body and typing it | |
string json = await req.Content.ReadAsStringAsync(); | |
var videoModel = JsonConvert.DeserializeObject<VideoAMS>(json); | |
// Sets up the content | |
string _accessPolicy = videoModel.AccessPolicyName; | |
string _assetName = videoModel.AssetName; |