Skip to content

Resubmitting AnalysisServices Servicemanagement APIs #3214

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 34 commits into from
Jan 12, 2017
Merged

Conversation

athipp
Copy link
Contributor

@athipp athipp commented Nov 21, 2016

-Closed the old pr targeting 3.2.

  • submitting a new PR targeting dev brancha and with suggested naming conventions for the API.

@athipp
Copy link
Contributor Author

athipp commented Nov 21, 2016

abandoned the old PR targeting 3.2.0 (#3192) and created a new one with appropriate naming. @shahabhijeet please take a look when you get a chance.

## Current Release

## Version 3.3.0
* Fixed bug in Get-AzureRMAnalysisServicesServer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go under current release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@@ -0,0 +1,106 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcowl ? Dont get it. This is a separate project and separate module. how will the dll be packaged if I remove this.

<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A simple reference, without evidence should do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trimmed it. System.Net.Http is necessary.

/// </summary>
public static string GetAadAuthenticatedToken(AsAzureContext asAzureContext, SecureString password, PromptBehavior promptBehavior, string clientId, string resourceUri, Uri resourceRedirectUri)
{
var authUriBuilder = new UriBuilder(asAzureContext.Environment.Endpoints[AsAzureEnvironment.AsRolloutEndpoints.AdAuthorityBaseUrl]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you should not use ADAL directly in the cmdlets - this places a restriction on the ADAL version. Instead, you shoudl use the AuthenticationFactory, or you shoudl use Microsoft.Rest.Azure.Authentication to acquire credentials.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of those options require the user to do Login-AzureRmAccount. For this dataplane api that does not work because the token audience is different. We discussed about this and agreed that I'll have to get token on my own.


public string Name { get; set; }

public Dictionary<AsRolloutEndpoints, string> Endpoints { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dictionary is not particularly serializable in powershell, consider using a Hashtable instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

/// <summary>
/// Gets or sets AS Azure environments.
/// </summary>
public Dictionary<string, AsAzureEnvironment> Environments { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@@ -0,0 +1,108 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ServiceManagement necessary in this manifest name. Consider a shorter name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcowl do you have any suggestions. Given that the assembly name is that I was keeping the .psd1 file name consistent. OR by manifest do you mean something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different manifest than the AzureRM.AnalysisServices.psd1. So we need some differentiation...I renamed AzureRM.AnalysisServices.ServiceManagement.psd1 to AzureRM.AnalysisServices.Dataplane .psd1 which is shorter

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about using Azure.AnalysisServices as this module name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is "fixed"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it fixed? The file has exactly the same name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this time for real :) sorry for the double work.

@@ -35,5 +35,5 @@
// by using the '*' as shown below:


[assembly: AssemblyVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyVersion("0.0.2")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should match the psd1

Copy link
Contributor Author

@athipp athipp Nov 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcowl I was told the .psd1 i donot need to update and will be done by powershell team. I can update them both to be 0.0.2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should match.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is "fixed"

{
param
(
$environment = "aspaaswestusloop1.asazure-int.windows.net",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not encode internal endpoints

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean here. This is just a default value to the test here. The user will provide this an input to the cmdlet.

[Fact]
public void TestAnalysisServicesServerRestart()
{
NewInstance.RunPsTest(string.Format("Test-AnalysisServicesServerRestart -environment '{0}'", "aspaaswestusloop1.asazure-int.windows.net"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a recording for this test? Also, do not encode internal endppoints, or particular regiosn in test code.

@@ -0,0 +1,108 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about using Azure.AnalysisServices as this module name

@@ -0,0 +1,106 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duplicate of the previous - the dlls and formats are the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"fixed"

<DelaySign>true</DelaySign>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AnalysisServices.ServiceManagement</OutputPath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this path? Again, why use AzureRM.AnalysisServices.ServiceManagement

We talked about using

AzureRM.AnalysisServices for the ARM module and
Azure.AnalysisServices for the data plane module. Please use these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"fixed"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not fixed, the path is the same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed for release as well

{
base.BeginProcessing();
#pragma warning disable 0618
if (RolloutEnvironment == null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant, it is taken care of by the ValidateNotNullOrEmpty attribute on the parameter

protected override void BeginProcessing()
{
base.BeginProcessing();
#pragma warning disable 0618
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you accessing that is marked as obsolete?


private const string testPassword = "testpassword";

private AddAzureASAccountCommand cmdlet;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should create this in the test - it should not be a private member

same for command runtime mock. These might be different for each test

using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Threading;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not have two sets of usings

+ "65kxhZWVUbTHaPuEvg03ZQ3esDb6wxQewJPAL-GARg6S9wIN776Esw8-53AWhzFu0fIut-9FXGma6jV7"
+ "MYPoUUcFuQzLZgphecPyMPXSVhummVCdBwX9sizxnmFA";

private Mock<ICommandRuntime> commandRuntimeMock;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment about member variables for values that might change from test to test

@@ -35,5 +35,5 @@
// by using the '*' as shown below:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dll-Help.psd1 file is not needed, please remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"fixed"

@@ -35,5 +35,5 @@
// by using the '*' as shown below:


[assembly: AssemblyVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyVersion("0.0.2")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should match.

@athipp
Copy link
Contributor Author

athipp commented Dec 2, 2016

@markcowl Thanks for the comments. I've fixed all of them now.

@athipp
Copy link
Contributor Author

athipp commented Dec 6, 2016

@markcowl , @cormacpayne, I've addressed all of the comments. thanks!

Copy link
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few issues not fixed. A few comments.

@@ -0,0 +1,108 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it fixed? The file has exactly the same name.

<DelaySign>true</DelaySign>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AnalysisServices.ServiceManagement</OutputPath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Release path does not match the Debug path

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed for release as well

password = Credential.Password;
}

#pragma warning disable 0618
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not fixed. The pragma is till there

<ProjectReference Include="..\Commands.AnalysisServices\Commands.AnalysisServices.csproj">
<Project>{8aab43e6-e8f6-4f91-af8a-6a63cd78ef1e}</Project>
<Name>Commands.AnalysisServices</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove app.config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

@markcowl
Copy link
Member

markcowl commented Dec 7, 2016

@shahabhijeet
Copy link
Contributor

@athipp can you address the feedback on this PR. This PR will be closed by EOW. Please reopen the PR or submit a new PR.

@cormacpayne
Copy link
Member

@athipp closing this PR since there has been no activity for a couple of weeks

<DelaySign>true</DelaySign>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\AzureRM.AnalysisServices.ServiceManagement</OutputPath>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed for release as well

password = Credential.Password;
}

#pragma warning disable 0618
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really fixed. :(

<ProjectReference Include="..\Commands.AnalysisServices\Commands.AnalysisServices.csproj">
<Project>{8aab43e6-e8f6-4f91-af8a-6a63cd78ef1e}</Project>
<Name>Commands.AnalysisServices</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -35,5 +35,5 @@
// by using the '*' as shown below:


[assembly: AssemblyVersion("0.0.1")]
[assembly: AssemblyFileVersion("0.0.1")]
[assembly: AssemblyVersion("0.0.2")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed all the current set of comments. Reopening this review for submission.

@shahabhijeet
Copy link
Contributor

@athipp the setup is failing as it cannot find the below file
'D:\workspace\powershell\setup..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.AnalysisServices\Microsoft.Azure.Commands.AnalysisServices.dll-help.xml'

@athipp
Copy link
Contributor Author

athipp commented Jan 10, 2017

@markcowl , @cormacpayne . I've addressed the previous comments and reopened the PR. Also addded platyps based help. please take a look. thanks!


public void OnImport()
{
// Nothing to do on assembly initialize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be defining your aliases here

Copy link
Contributor Author

@athipp athipp Jan 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought aliases are defined at the beginning of the cmdlet. Not sure what you mean here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Fixed.


public static Dictionary<string, AsAzureAuthInfo> AsAzureRolloutEnvironmentMapping = new Dictionary<string, AsAzureAuthInfo>()
{
{ "asazure-int.windows.net", new AsAzureAuthInfo()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not include internal endpoints here. No customers will ever use this. If using the internal endpoints is needed, you should have a mechanism for adding a new environment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a work item to externalize this endpoint into the environment. But i suspect I will not have time for that this release. I'll take a bug and do it in the next milestone.

base.BeginProcessing();
if (string.IsNullOrEmpty(RolloutEnvironment))
{
RolloutEnvironment = AsAzureClientSession.GetDefaultEnvironmentName();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly encourage you from moving away from a static Session structure - this causes problems when running cmdlets in parallel. For a future release, you should consider changing this to a Session variable.,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take this as a bug and fix it in the next release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened an issue - to track this. #3380

# Module manifest for module 'Microsoft.Azure.Commands.AnalysisServices.Dataplane'
#
# Generated by: Microsoft Corporation
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to include this module in the AzureRM module

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how I go about doing that. Any pointers?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@athipp I will take care of adding this module in AzureRM, so you can ignore this.

@shahabhijeet
Copy link
Contributor

@shahabhijeet shahabhijeet merged commit 2526f28 into Azure:dev Jan 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants