diff --git a/ams/AzureResourceProvider.cs b/ams/AzureResourceProvider.cs index 1b37523..d806779 100644 --- a/ams/AzureResourceProvider.cs +++ b/ams/AzureResourceProvider.cs @@ -40,28 +40,16 @@ public async Task SetStorageResourceGroupsAsync(MediaServicesAccountResource acc if (mediaServiceResource.GetRawResponse().Status == 200) { storageAccounts = mediaServiceResource.Value.Data.StorageAccounts; - if (storageAccounts != null && storageAccounts.Any()) + + foreach (var storageAccount in storageAccounts) { - foreach (var storageAccount in storageAccounts) - { - string? storageAccountId = storageAccount.Id; - ///subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.storage/storageaccounts/{accountName} - if (!string.IsNullOrEmpty(storageAccountId)) - { - string[] parts; - parts = storageAccountId.Split('/'); - string resourceGroupName = parts[4]; - string storageAccName = parts[8]; - string subscriptionId = parts[2]; - var resourceGroupId = ResourceGroupResource.CreateResourceIdentifier( - subscriptionId, - resourceGroupName); - var resourceGroup = _armClient.GetResourceGroupResource(resourceGroupId); - _storageResourceGroups.Add(storageAccName, resourceGroup); - } - } + var storageAccountId = storageAccount.Id; + var resourceGroupId = ResourceGroupResource.CreateResourceIdentifier( + storageAccountId.SubscriptionId!, + storageAccountId.ResourceGroupName!); + var resourceGroup = _armClient.GetResourceGroupResource(resourceGroupId); + _storageResourceGroups.Add(storageAccountId.Name, resourceGroup); } - } } diff --git a/transform/ShakaPackager.cs b/transform/ShakaPackager.cs index 7d4c2a0..e8ea82a 100644 --- a/transform/ShakaPackager.cs +++ b/transform/ShakaPackager.cs @@ -62,11 +62,7 @@ public ShakaPackager(MigratorOptions options, AssetDetails assetDetails, TransMu videoStream = stream; numVideoStreams++; } - } - - foreach (var stream in clientManifest.Streams) - { - if (stream.Type == StreamType.Audio) + else if (stream.Type == StreamType.Audio) { audioStream = stream; numAudioStreams++;