-
Notifications
You must be signed in to change notification settings - Fork 4k
[Azure Analysis Services] Enable associate/dissociate gateway with AS. #6043
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
Changes from all commits
c65f394
6666142
f578d45
bdda3d5
86b1997
89febba
ba8ef9d
db15652
f098865
d92e0c9
d9592f4
f008839
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ public class SetAzureAnalysisServicesServer : AnalysisServicesCmdletBase | |
{ | ||
private const string ParamSetDefault = "Default"; | ||
private const string ParamSetDisableBackup = "DisableBackup"; | ||
private const string ParamSetDisassociatGateway = "DisassociateGateway"; | ||
|
||
[Parameter(ValueFromPipelineByPropertyName = true, Position = 0, Mandatory = true, | ||
HelpMessage = "Name of the server.")] | ||
|
@@ -88,6 +89,16 @@ public int ReadonlyReplicaCount | |
HelpMessage = "Firewall configuration")] | ||
public PsAzureAnalysisServicesFirewallConfig FirewallConfig { get; set; } | ||
|
||
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. @markcowl updated, please review again. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be in separate parameter sets. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @markcowl updated |
||
ParameterSetName = ParamSetDefault, | ||
HelpMessage = "Gateway resource ID")] | ||
public string GatewayResourceId { get; set; } | ||
|
||
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, | ||
ParameterSetName = ParamSetDisassociatGateway, | ||
HelpMessage = "Disassociate current gateway")] | ||
public SwitchParameter DisassociateGateway { get; set; } | ||
|
||
public override void ExecuteCmdlet() | ||
{ | ||
if (string.IsNullOrEmpty(Name)) | ||
|
@@ -147,7 +158,12 @@ public override void ExecuteCmdlet() | |
ReadonlyReplicaCount = -1; | ||
} | ||
|
||
AnalysisServicesServer updatedServer = AnalysisServicesClient.CreateOrUpdateServer(ResourceGroupName, Name, location, Sku, Tag, Administrator, currentServer, BackupBlobContainerUri, ReadonlyReplicaCount, DefaultConnectionMode, setting); | ||
if (DisassociateGateway.IsPresent) | ||
{ | ||
GatewayResourceId = AnalysisServicesClient.DissasociateGateway; | ||
} | ||
|
||
AnalysisServicesServer updatedServer = AnalysisServicesClient.CreateOrUpdateServer(ResourceGroupName, Name, location, Sku, Tag, Administrator, currentServer, BackupBlobContainerUri, ReadonlyReplicaCount, DefaultConnectionMode, setting, GatewayResourceId); | ||
|
||
if(PassThru.IsPresent) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.Azure.Management.Analysis.Models; | ||
|
||
namespace Microsoft.Azure.Commands.AnalysisServices.Models | ||
{ | ||
public class ServerGateway | ||
{ | ||
public string GatewayResourceId { get; set; } | ||
|
||
public string GatewayObjectId { get; set; } | ||
|
||
public string DmtsClusterUri { get; set; } | ||
|
||
internal static ServerGateway FromResourceGateway(GatewayDetails resourceGateway) | ||
{ | ||
return new ServerGateway() | ||
{ | ||
GatewayResourceId = resourceGateway.GatewayResourceId, | ||
GatewayObjectId = resourceGateway.GatewayObjectId != null ? resourceGateway.GatewayObjectId : null, | ||
DmtsClusterUri = resourceGateway.DmtsClusterUri != null ? resourceGateway.DmtsClusterUri : 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.
So, this test assumes that the gateway server already exists in the subscription/RG... Is it possible to create the gateway server as part of the test?
Otherwise some one (lets say a person in the PS team) would not be able to re-record the test.
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 have to be a pre-setup azure resource, which requires user to install unified gateway on their on-premise server and generate an gateway azure resource associated on it. It is not possible to automate the procedure in few lines of powershell scripts. This is LiveOnly test.
Uh oh!
There was an error while loading. Please reload this page.
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.
ok... can you add a comment to the test case that describes what all needs to be done for one to be able to set up the gateway server , the documentation could be as simple as pointing the person to follow an online guide on how to get it done as well ;) )?
That way the person running the test will have the instructions to do so....