Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Merge pull request #186 from Azure/dev
Browse files Browse the repository at this point in the history
Management of AMS expiration date, support for extension, update to MK.IO
  • Loading branch information
xpouyat authored Jun 13, 2024
2 parents d87ff86 + b15fa75 commit aa1b516
Show file tree
Hide file tree
Showing 37 changed files with 1,323 additions and 1,185 deletions.
7 changes: 4 additions & 3 deletions AMSExplorer/AMSClient/AMSClientV3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Azure.ResourceManager;
using Azure.ResourceManager.Media;
using Microsoft.Identity.Client;
using Microsoft.Identity.Client.Desktop;
using Microsoft.Rest;
using System;
using System.Diagnostics;
Expand Down Expand Up @@ -62,8 +63,8 @@ public AMSClientV3(AzureEnvironment myEnvironment, string azureSubscriptionId, C
//.WithAuthority(AzureCloudInstance.AzurePublic, credentialsEntry.AadTenantId)
.WithAuthority(environment.AADSettings.AuthenticationEndpoint + string.Format("{0}", credentialsEntry.AadTenantId ?? "organizations"))
.WithDefaultRedirectUri()
//.WithRedirectUri("http://localhost")
.WithBroker(true)
//.WithRedirectUri("http://localhost")
.WithWindowsDesktopFeatures(new BrokerOptions(BrokerOptions.OperatingSystems.Windows))
.Build();
}
else // SP
Expand Down Expand Up @@ -180,7 +181,7 @@ public async Task<MediaServicesAccountResource> ConnectAndGetNewClientV3Async(Fo

if (firstTimeAuth && connectToMKIO)
{
// form for MK/IO
// form for MK.IO
MKIOConnection mkioConnectionForm = new(credentialsEntry.MKIOSubscriptionName, credentialsEntry.MKIOClearToken);

if (mkioConnectionForm.ShowDialog() == DialogResult.OK)
Expand Down
25 changes: 13 additions & 12 deletions AMSExplorer/AMSExplorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<ApplicationHighDpiMode>SystemAware</ApplicationHighDpiMode>
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
<StartupObject>AMSExplorer.Program</StartupObject>
<Version>5.8.0.0</Version>
<Version>5.8.2.0</Version>
<ApplicationIcon>Azure Explorer_ico.ico</ApplicationIcon>
<Description></Description>
<Copyright>Copyright © 2023</Copyright>
<Company>$(Authors)Microsoft</Company>
<AssemblyVersion>5.8.1.0</AssemblyVersion>
<FileVersion>5.8.1.0</FileVersion>
<AssemblyVersion>5.8.2.0</AssemblyVersion>
<FileVersion>5.8.2.0</FileVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<PackageIcon>Azure Explorer.png</PackageIcon>
<PackageIconUrl />
Expand Down Expand Up @@ -90,24 +90,25 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Monitor.Query" Version="1.2.0" />
<PackageReference Include="Azure.ResourceManager" Version="1.9.0" />
<PackageReference Include="Azure.Monitor.Query" Version="1.3.1" />
<PackageReference Include="Azure.ResourceManager" Version="1.12.0" />
<PackageReference Include="Azure.ResourceManager.Media" Version="1.3.0" />
<PackageReference Include="Azure.ResourceManager.Resources" Version="1.7.0" />
<PackageReference Include="Azure.ResourceManager.Storage" Version="1.2.0" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.0" />
<PackageReference Include="Azure.ResourceManager.Resources" Version="1.7.3" />
<PackageReference Include="Azure.ResourceManager.Storage" Version="1.2.3" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.2" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="25.0.0" />
<PackageReference Include="Microsoft.Azure.Storage.DataMovement" Version="2.0.5" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.58.1" />
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.61.3" />
<PackageReference Include="Microsoft.Identity.Client.Desktop" Version="4.61.3" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.4.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2151.40" />
<PackageReference Include="MK.IO" Version="1.0.9" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.3" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2535.41" />
<PackageReference Include="MK.IO" Version="1.6.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.0" />
<PackageReference Include="System.Linq.Async.Queryable" Version="6.0.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion AMSExplorer/AssetInformation.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions AMSExplorer/AssetInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public partial class AssetInformation : Form
private string _serverManifestName = null;
private AmsClientRest _restClient;
private MKIOClient _MKIOclient;
private List<StreamingEndpointSchema> _MKIOStreamingEndpointList;
private IEnumerable<StreamingEndpointSchema> _MKIOStreamingEndpointList;
private AssetSchema _mkioasset = null;

public AssetInformation(Mainform mainform, AMSClientV3 amsClient, MediaAssetResource asset, IEnumerable<StreamingEndpointResource> streamingEndpoints, MKIOClient MKIOclient = null)
Expand Down Expand Up @@ -672,7 +672,7 @@ private async Task BuildLocatorsTreeAsync()
string locatorstatus = string.Empty;

Color colornode = GetLocatorApparence(locator, ref locatorstatus);
if (SelectedSE.Data.ResourceState != StreamingEndpointResourceState.Running)
if (SelectedSE.Data.ResourceState != Azure.ResourceManager.Media.Models.StreamingEndpointResourceState.Running)
{
colornode = Color.Red;
}
Expand Down Expand Up @@ -2286,7 +2286,7 @@ private async Task GetDRMTestTokenAsync()

List<Claim> claims = new();

foreach (ContentKeyPolicyTokenClaim claim in ckrestriction.RequiredClaims)
foreach (Azure.ResourceManager.Media.Models.ContentKeyPolicyTokenClaim claim in ckrestriction.RequiredClaims)
{
if (claim.ClaimType == "urn:microsoft:azure:mediaservices:contentkeyidentifier")
{
Expand Down Expand Up @@ -2798,10 +2798,10 @@ private async Task DisplayMKIOAssetInfoAsync()

DGMKIOInfo.Rows.Clear();

DGMKIOInfo.Rows.Add("MK/IO Name", _mkioasset.Name);
DGMKIOInfo.Rows.Add("MK/IO Description", _mkioasset.Properties.Description);
DGMKIOInfo.Rows.Add("MK.IO Name", _mkioasset.Name);
DGMKIOInfo.Rows.Add("MK.IO Description", _mkioasset.Properties.Description);

// fill the combo with list of MK/IO streaming endpoints
// fill the combo with list of MK.IO streaming endpoints
_MKIOStreamingEndpointList = await _MKIOclient.StreamingEndpoints.ListAsync();
comboBoxSEMKIO.Items.Clear();
foreach (var se in _MKIOStreamingEndpointList)
Expand All @@ -2817,7 +2817,7 @@ private async Task DisplayMKIOAssetInfoAsync()
}

/// <summary>
/// Build the treeview of locators for MK/IO
/// Build the treeview of locators for MK.IO
/// </summary>
/// <returns></returns>
private async Task BuildMKIOLocatorsTreeAsync(AssetSchema mkioasset)
Expand Down Expand Up @@ -2871,7 +2871,7 @@ private async Task BuildMKIOLocatorsTreeAsync(AssetSchema mkioasset)
string locatorstatus = string.Empty;

Color colornode = Color.Black;
if (SelectedSE.Properties.ResourceState != StreamingEndpointResourceState.Running)
if (SelectedSE.Properties.ResourceState != MK.IO.Models.StreamingEndpointResourceState.Running)
{
colornode = Color.Red;
}
Expand All @@ -2884,7 +2884,7 @@ private async Task BuildMKIOLocatorsTreeAsync(AssetSchema mkioasset)
TreeViewLocatorsMKIO.Nodes.Add(myLocNode);
TreeViewLocatorsMKIO.Nodes[indexloc].Nodes.Add(new TreeNode(AMSExplorer.Properties.Resources.AssetInformation_BuildLocatorsTree_LocatorInformation));

LocTreeAddTextEntryToNode(TreeViewLocatorsMKIO, indexloc, 0, "Streaming locator Id: {0}", locator.Properties.StreamingLocatorId);
LocTreeAddTextEntryToNode(TreeViewLocatorsMKIO, indexloc, 0, "Streaming locator Id: {0}", locator.Properties.StreamingLocatorId.ToString());
LocTreeAddTextEntryToNode(TreeViewLocatorsMKIO, indexloc, 0, AMSExplorer.Properties.Resources.AssetInformation_BuildLocatorsTree_Name0, locator.Name);
LocTreeAddTextEntryToNode(TreeViewLocatorsMKIO, indexloc, 0, "Streaming policy name: {0}", locator.Properties.StreamingPolicyName);
LocTreeAddTextEntryToNode(TreeViewLocatorsMKIO, indexloc, 0, "Default content key policy name: {0}", locator.Properties.DefaultContentKeyPolicyName);
Expand All @@ -2908,11 +2908,11 @@ private async Task BuildMKIOLocatorsTreeAsync(AssetSchema mkioasset)
foreach (string p in path.Paths)
{
appendExtension = string.Empty;
if (path.StreamingProtocol == StreamingPolicyStreamingProtocol.Dash && !p.EndsWith(Constants.mpd))
if (path.StreamingProtocol == StreamingPathsStreamingProtocol.Dash && !p.EndsWith(Constants.mpd))
{
appendExtension = Constants.mpd;
}
else if (path.StreamingProtocol == StreamingPolicyStreamingProtocol.Hls && !p.EndsWith(Constants.m3u8))
else if (path.StreamingProtocol == StreamingPathsStreamingProtocol.Hls && !p.EndsWith(Constants.m3u8))
{
appendExtension = Constants.m3u8;
}
Expand Down
2 changes: 1 addition & 1 deletion AMSExplorer/AssetInformation.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2510,7 +2510,7 @@
<value>7</value>
</data>
<data name="tabPageMKIO.Text" xml:space="preserve">
<value>MK/IO</value>
<value>MK.IO</value>
</data>
<data name="&gt;&gt;tabPageMKIO.Name" xml:space="preserve">
<value>tabPageMKIO</value>
Expand Down
4 changes: 2 additions & 2 deletions AMSExplorer/Bitmaps.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions AMSExplorer/Bitmaps.resx
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
<data name="passthrough_std" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>IconsPNG\passthrough_std.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="mk_io_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>BitmapsPNG\mk-io-blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="MKIO_Default" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>BitmapsPNG\MKIO Default.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added AMSExplorer/BitmapsPNG/MKIO Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed AMSExplorer/BitmapsPNG/mk-io-blue.png
Binary file not shown.
10 changes: 5 additions & 5 deletions AMSExplorer/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class Constants
public const string Webview2Installer = "https://go.microsoft.com/fwlink/p/?LinkId=2124703";
public const string Webview2RegPath64 = "SOFTWARE\\WOW6432Node\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}";
public const string Webview2RegPath32 = "SOFTWARE\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}";
public const string Webview2MinVersion = "119.0.2151.40";
public const string Webview2MinVersion = "125.0.2535.41";

public const string GitHubAMSEVersionPrimaryV3 = "https://raw.githubusercontent.com/Azure/Azure-Media-Services-Explorer/main/versionv3.json";
public const string GitHubAMSEVersionSecondaryV3 = "https://amsexplorer.azureedge.net/release/versionv3.json";
Expand Down Expand Up @@ -92,8 +92,8 @@ public static class Constants

public const string DemoCaptionMaker = @"https://testdrive-archive.azurewebsites.net/Graphics/CaptionMaker/Default.html";

public const string MKIOPortal = @"https://io.mediakind.com";
public const string MKIOApp = @"https://app.io.mediakind.com/";
public const string MKIOWebSite = @"https://www.mk.io";
public const string MKIOPortal = @"https://app.mk.io/";

public const string LinkFeedbackAMS = "https://aka.ms/amsvoice";

Expand Down Expand Up @@ -144,8 +144,8 @@ public static class Constants
public const string LinkAMSManagedIdentities = "https://learn.microsoft.com/en-us/azure/media-services/latest/concept-managed-identities";
public const string LinkAMSCustomerManagedKeys = "https://learn.microsoft.com/en-us/azure/media-services/latest/concept-use-customer-managed-keys-byok";

public const string LinkMKIOPortal = "https://io.mediakind.com";
public const string LinkMKIOMigrationDoc = "https://docs.io.mediakind.com/docs/migrating-from-ams";
public const string LinkMKIOPortal = "https://app.mk.io";
public const string LinkMKIOMigrationDoc = "https://docs.mk.io/docs/migrating-from-ams";

public const string LinkAMSE = "https://aka.ms/amse";
public const string LinkMailtoAMSE = "mailto:[email protected]?subject=Azure Media Services Explorer - Question/Comment";
Expand Down
4 changes: 2 additions & 2 deletions AMSExplorer/DataGrid/DataGridViewAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public TimeRangeValue TimeFilterTimeRange
}
public int? DisplayedCount => _MyObservAssetV3 != null ? _MyObservAssetV3.Count : null;

public List<AssetSchema> ListMKIOAssets;
public IEnumerable<AssetSchema> ListMKIOAssets;

public void Init(AMSClientV3 client, SynchronizationContext syncontext, bool enableMKIOInfo)
{
Expand Down Expand Up @@ -175,7 +175,7 @@ public void Init(AMSClientV3 client, SynchronizationContext syncontext, bool ena
Columns["AlternateId"].Visible = Properties.Settings.Default.DisplayAssetAltIDinGrid;
Columns["StorageAccountName"].Visible = Properties.Settings.Default.DisplayAssetStorageinGrid;
Columns["StorageAccountName"].HeaderText = "Storage account";
Columns["MKIOMigrated"].HeaderText = "In MK/IO";
Columns["MKIOMigrated"].HeaderText = "In MK.IO";
Columns["MKIOMigrated"].Visible = enableMKIOInfo;
Columns["SizeLong"].Visible = false;
Columns["LastModifiedOn"].Visible = false;
Expand Down
12 changes: 6 additions & 6 deletions AMSExplorer/ExportToExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,13 @@ private async Task Excel_DoWorkAsync(CancellationToken cancellationToken)
Row rowAMSENote = CreateNewRow(AMSENote);


// MK/IO
// MK.IO
var allMKIOAssets = new List<AssetSchema>();

if (_mkioClient != null)
{
// list assets with pages
var mkioAssetsResult = await _mkioClient.Assets.ListAsPageAsync(null, 20);
var mkioAssetsResult = await _mkioClient.Assets.ListAsPageAsync(top : 20);
while (true)
{
// do stuff here using mkioAssetsResult.Results
Expand Down Expand Up @@ -427,7 +427,7 @@ private async Task Excel_DoWorkAsync(CancellationToken cancellationToken)
listHeader.Add("Streaming locators count");
if (_mkioClient != null)
{
listHeader.Add("In MK/IO");
listHeader.Add("In MK.IO");
}

if (detailed)
Expand Down Expand Up @@ -709,13 +709,13 @@ private async Task CSV_DoWorkAsync(CancellationToken cancellationToken)
var streamingEndpoints = _amsClient.AMSclient.GetStreamingEndpoints().GetAllAsync().ToListAsync();
var selist = streamingEndpoints.Result;

// MK/IO
// MK.IO
var allMKIOAssets = new List<AssetSchema>();

if (_mkioClient != null)
{
// list assets with pages
var mkioAssetsResult = _mkioClient.Assets.ListAsPage(null, 20);
var mkioAssetsResult = _mkioClient.Assets.ListAsPage(top: 20);
while (true)
{
// do stuff here using mkioAssetsResult.Results
Expand Down Expand Up @@ -820,7 +820,7 @@ private async Task CSV_DoWorkAsync(CancellationToken cancellationToken)

if (_mkioClient != null)
{
linec.Add("In MK/IO");
linec.Add("In MK.IO");
}

if (detailed)
Expand Down
2 changes: 1 addition & 1 deletion AMSExplorer/ExportToExcel.resx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
<value>69</value>
</data>
<data name="label8.Text" xml:space="preserve">
<value>asset name, description, times, storage info, locators count, MK/IO status</value>
<value>asset name, description, times, storage info, locators count, MK.IO status</value>
</data>
<data name="&gt;&gt;label8.Name" xml:space="preserve">
<value>label8</value>
Expand Down
Loading

0 comments on commit aa1b516

Please sign in to comment.