Skip to content

Update Cognitive Services Mgmt. PS with the latest Cognitive Services Mgmt. SDK #5200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ResourceManager/CognitiveServices/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
- Additional information about change #1
-->
## Current Release
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
* Integrate with Cognitive Services Management SDK version 3.0.0.

## Version 0.9.0
* Add support for online help
- Run Get-Help with the -Online parameter to open the online help in your default Internet browser
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription

## Version 0.8.7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<Reference Include="Microsoft.Azure.Management.Authorization">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.CognitiveServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.CognitiveServices.2.0.0\lib\net452\Microsoft.Azure.Management.CognitiveServices.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.CognitiveServices, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.CognitiveServices.3.0.0\lib\net452\Microsoft.Azure.Management.CognitiveServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.CognitiveServices" version="2.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Management.CognitiveServices" version="3.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Storage" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.6179.26854-prerelease" targetFramework="net45" />
Expand Down
13 changes: 11 additions & 2 deletions src/ResourceManager/CognitiveServices/CognitiveServices.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ResourceManager.Common", "..\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj", "{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}"
EndProject
Expand Down Expand Up @@ -38,6 +38,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authorizati
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Graph.RBAC", "..\..\Common\Commands.Common.Graph.RBAC\Commands.Common.Graph.RBAC.csproj", "{269ACF73-0A34-42DC-AB9C-4B15931A489D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Network", "..\..\Common\Commands.Common.Network\Commands.Common.Network.csproj", "{1338F7AE-7111-4ED3-8916-2D0FECC876F4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -112,6 +114,10 @@ Global
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Release|Any CPU.Build.0 = Release|Any CPU
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -120,4 +126,7 @@ Global
{F6F8A360-F203-4161-98A7-60097AB94193} = {13BB1C60-A70E-4780-ABEF-D5EE36754085}
{3436A126-EDC9-4060-8952-9A1BE34CDD95} = {13BB1C60-A70E-4780-ABEF-D5EE36754085}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {14AD56C1-8326-4E0A-98BC-A3E4ED25936E}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public override void ExecuteCmdlet()
}
else
{
var cognitiveServicesAccount = this.CognitiveServicesClient.CognitiveServicesAccounts.GetProperties(
var cognitiveServicesAccount = this.CognitiveServicesClient.Accounts.GetProperties(
this.ResourceGroupName,
this.Name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override void ExecuteCmdlet()

RunCmdLet(() =>
{
var cognitiveServicesKeys = this.CognitiveServicesClient.CognitiveServicesAccounts.ListKeys(
var cognitiveServicesKeys = this.CognitiveServicesClient.Accounts.ListKeys(
this.ResourceGroupName,
this.Name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public override void ExecuteCmdlet()
base.ExecuteCmdlet();
RunCmdLet(() =>
{
var cognitiveServicesKeys = this.CognitiveServicesClient.CognitiveServicesAccounts.ListSkus(
var cognitiveServicesKeys = this.CognitiveServicesClient.Accounts.ListSkus(
this.ResourceGroupName,
this.Name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ public override void ExecuteCmdlet()
}
}

var createAccountResponse = this.CognitiveServicesClient.CognitiveServicesAccounts.Create(
var createAccountResponse = this.CognitiveServicesClient.Accounts.Create(
this.ResourceGroupName,
this.Name,
createParameters);

var cognitiveServicesAccount = this.CognitiveServicesClient.CognitiveServicesAccounts.GetProperties(this.ResourceGroupName, this.Name);
var cognitiveServicesAccount = this.CognitiveServicesClient.Accounts.GetProperties(this.ResourceGroupName, this.Name);

this.WriteCognitiveServicesAccount(cognitiveServicesAccount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public override void ExecuteCmdlet()

RunCmdLet(() =>
{
var keys = this.CognitiveServicesClient.CognitiveServicesAccounts.RegenerateKey(
var keys = this.CognitiveServicesClient.Accounts.RegenerateKey(
this.ResourceGroupName,
this.Name,
this.KeyName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public override void ExecuteCmdlet()
{
RunCmdLet(() =>
{
this.CognitiveServicesClient.CognitiveServicesAccounts.Delete(
this.CognitiveServicesClient.Accounts.Delete(
this.ResourceGroupName,
this.Name);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public override void ExecuteCmdlet()
else
{
// Not updating anything (this is allowed) - just return the account, no need for approval.
var cognitiveServicesAccount = this.CognitiveServicesClient.CognitiveServicesAccounts.GetProperties(this.ResourceGroupName, this.Name);
var cognitiveServicesAccount = this.CognitiveServicesClient.Accounts.GetProperties(this.ResourceGroupName, this.Name);
WriteCognitiveServicesAccount(cognitiveServicesAccount);
return;
}
Expand All @@ -113,7 +113,7 @@ public override void ExecuteCmdlet()
{
RunCmdLet(() =>
{
var updatedAccount = this.CognitiveServicesClient.CognitiveServicesAccounts.Update(
var updatedAccount = this.CognitiveServicesClient.Accounts.Update(
this.ResourceGroupName,
this.Name,
sku,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.Management.CognitiveServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.CognitiveServices.2.0.0\lib\net452\Microsoft.Azure.Management.CognitiveServices.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.CognitiveServices, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.CognitiveServices.3.0.0\lib\net452\Microsoft.Azure.Management.CognitiveServices.dll</HintPath>
</Reference>
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
<Compile Include="ObsoletedModels\ProvisioningState.cs" />
<Compile Include="Models\PSCognitiveServicesAccount.cs" />
<Compile Include="Models\PSCognitiveServicesAccountKeys.cs" />
<Compile Include="Models\PSCognitiveServicesSkus.cs" />
Expand All @@ -74,7 +75,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="notice.txt" />
<None Include="..\AzureRM.CognitiveServices.psd1">
<Link>AzureRM.CognitiveServices.psd1</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down Expand Up @@ -110,6 +110,9 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="notice.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
<Target Name="AfterBuild">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccou
this.AccountType = cognitiveServicesAccount.Kind;
this.Etag = cognitiveServicesAccount.Etag;
this.ResourceType = cognitiveServicesAccount.Type;
this.ProvisioningState = cognitiveServicesAccount.ProvisioningState;
#pragma warning disable CS0436 // Type conflicts with imported type
#pragma warning disable CS0618 // Type or member is obsolete
this.ProvisioningState = (ProvisioningState)Enum.Parse(typeof(ProvisioningState), cognitiveServicesAccount.ProvisioningState);
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0436 // Type conflicts with imported type
this.Tags = cognitiveServicesAccount.Tags;
}

Expand All @@ -55,7 +59,11 @@ public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccou

public string Etag { get; private set; }

#pragma warning disable CS0436 // Type conflicts with imported type
#pragma warning disable CS0618 // Type or member is obsolete
public ProvisioningState? ProvisioningState { get; private set; }
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0436 // Type conflicts with imported type

public IDictionary<string, string> Tags { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Runtime.Serialization;

namespace Microsoft.Azure.Management.CognitiveServices.Models
{
[Obsolete("'ProvisioningState' enum is obsolete. It will be modeled as string in later version.")]
[JsonConverter(typeof(StringEnumConverter))]
public enum ProvisioningState
{
[EnumMember(Value = "Creating")] Creating,
[EnumMember(Value = "Moving")] Moving,
[EnumMember(Value = "Deleting")] Deleting,
[EnumMember(Value = "ResolvingDNS")] ResolvingDNS,
[EnumMember(Value = "Succeeded")] Succeeded,
[EnumMember(Value = "Failed")] Failed
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("0.9.0")]
[assembly: AssemblyFileVersion("0.9.0")]
[assembly: AssemblyVersion("0.9.1")]
[assembly: AssemblyFileVersion("0.9.1")]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Azure.Management.CognitiveServices" version="2.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Management.CognitiveServices" version="3.0.0" targetFramework="net452" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes/breaking-change-template.md
-->

# Upcoming Breaking Changes
# Upcoming Breaking Changes

## Release 1.0.x - May 2018

* ProvisioningState property will be changed to a string in an upcoming release.