-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
- Added ServerFullName property to powershell type. - Modified tests to validate.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 @@ | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this file
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
There was a problem hiding this comment.
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]); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment
There was a problem hiding this comment.
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 @@ | |||
# |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is "fixed"
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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")] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should match.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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")); |
There was a problem hiding this comment.
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.
Renaming EnivronmentName parameter to RolloutEnvironment Fixing other review comments.
@@ -0,0 +1,108 @@ | |||
# |
There was a problem hiding this comment.
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 @@ | |||
# |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"fixed"
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should match.
@markcowl Thanks for the comments. I've fixed all of them now. |
@markcowl , @cormacpayne, I've addressed all of the comments. thanks! |
There was a problem hiding this 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 @@ | |||
# |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove app.config
There was a problem hiding this comment.
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"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this file
@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. |
@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> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
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")] |
There was a problem hiding this comment.
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.
@athipp the setup is failing as it cannot find the below file |
@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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.,
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 | ||
# |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
-Closed the old pr targeting 3.2.