Skip to content

New PowerBI Dedicated module #5010

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 14 commits into from
Dec 7, 2017
Merged

Conversation

selasagi
Copy link
Contributor

@selasagi selasagi commented Nov 19, 2017

Description


This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThru parameter.

Cmdlet Parameter Guidelines

  • Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

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

@selasagi some comments to take a look at.

In addition, there are a few additional things that need to be done.

(1) There are a few other files missing that you'll need in your project, such as a ChangeLog.md, documentation folder containing the breaking change markdown files, etc. You can check out the PowerBIEmbedded project as a guide to the files you'll need.

(2) You will need to regenerate the .wxi file so your module is a part of the installer. You can follow this guide for more information on how to do so.

(3) In order for your tests to run, you will need to add an entry for your test dll in the TestMappings.json file.

(4) You will need to deprecate the AzureRM.PowerBIEmbedded module. To do so, you will want to add a warning at the beginning of each cmdlet execution stating that the AzureRM.PowerBIEmbedded module will be deprecated in an upcoming breaking change release, and that users should use the AzureRM.PowerBI module instead.

# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '3.4.0'; })
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi this should be in-sync with the latest version of AzureRM.Profile, which is 4.0.0

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

# RootModule = ''

# Version number of this module.
ModuleVersion = '1.0.0'
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi is this service in public preview? If so, then this should release as 0.1.0

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 GM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry.. GA so I leave the version 1.0.0

Copyright = '� Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Microsoft Azure PowerShell - PowerBI Embedded Capacity'
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi please change this description

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

FunctionsToExport = @()

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = 'Resume-AzureRmPowerBIEmbeddedCapacity',
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi should these cmdlets have the prefix AzureRmPowerBIDedicated, or is AzureRmPowerBIEmbedded the correct prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AzureRmPowerBIEmbeddedCapacity

RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '3.4.0'; })

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi uncomment this field and put your management SDK dll in this list (i.e., .\Microsoft.Azure.Management.PowerBIDedicated.dll)

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

// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Commands.PowerBIDedicated")]
[assembly: AssemblyDescription("")]
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi please fill in as much information as you can. You can use the AssemblyInfo.cs file in Compute's project as an example

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

Administrator : {{[email protected]}}
State : Succeeded
ProvisioningState : Succeeded
Id : /subscriptions/78e47976-009f-4d4a-a961-6046cdabf459/resourceGroups/testRG/providers/Microsoft.PowerBIDedicated/capacities/testcapacity
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi not sure if you mind this subscription id being publicly visible in the example

## PARAMETERS

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.```yaml
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi this is a bug in the platyPS module - you will need to move the ```yaml string at the end of this line to a line by itself. Other parameters in this file follow the correct model. Please check all other markdown files for instances of this trailing ```yaml string in parameter descriptions

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

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net452" />
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi you will need to add your management SDK to this file, and you can go ahead and remove all of the other references found in 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.

done

@@ -0,0 +1,132 @@
#
# Module manifest for module 'PSGet_AzureRM.PowerBIDedicated'
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi sent another email about changing the name of this module to AzureRM.PowerBI

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

Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

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

@selasagi more comments to take a look at

-->
## Current Release

## Version 1.0.0
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi please remove the ## Version 1.0.0 header and move the below information to be under the ## Current Release header

<DelaySign>true</DelaySign>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi looks like you repeated an entry for <SignAssembly>, <AssemblyOriginatorKeyFile>, and <DelaySign>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. fixed

Copy link
Member

Choose a reason for hiding this comment

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

@selasagi looks like this is still an issue

HelpMessage = "Name of resource group under which the user want to retrieve the capacity.")]
[Parameter(
ParameterSetName = CapacityParameterSet,
Mandatory = false,
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi ResourceGroupName should be mandatory in the parameter set with 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.

Name can go also without ResourceGroupName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

{
// List all capacities in given resource group if avaliable otherwise all capacities in the subscription
var list = PowerBIClient.ListCapacities(ResourceGroupName);
list.ForEach(capacity => WriteObject(capacity));
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi for consistency, I would recommend changing this to WriteObject(list, true), which will enumerate the objects in the list for you and write them to the output stream

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

{
[Cmdlet(VerbsCommon.Get, "AzureRmPowerBIEmbeddedCapacity"),
OutputType(typeof(List<PSDedicatedCapacity>))]
public class GetAzurePowerBIEmbeddedCapacity : PowerBICmdletBase
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi the naming of these cmdlets still confuses me - you are receiving a DedicatedCapacity object from the server and transforming it into a PSDedicatedCapacity object, but the cmdlet is called Get-AzureRmPowerBIEmbeddedCapacity instead of Get-AzureRmPowerBIDedicatedCapacity. I was under the impression that PowerBIEmbedded objects are separate from PowerBIDedicated objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PSDedicatedCapacity changed to PSPowerBIEmbeddedCapacity


public override void ExecuteCmdlet()
{
string capacityName = string.Empty;
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi same comment about assigning this to Name and removing the if-statement

Mandatory = false,
HelpMessage = "Name of resource group under which want to test the capacity.")]
[ValidateNotNullOrEmpty]
public string ResourceGroupName { 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.

@selasagi what value does ResourceGroupName provide if Name is unique?


namespace Microsoft.Azure.Commands.PowerBI
{
[Cmdlet(VerbsData.Update, "AzureRmPowerBIEmbeddedCapacity", SupportsShouldProcess = true),
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi same comment about DefaultParameterSetName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added


public override void ExecuteCmdlet()
{
string capacityName = string.Empty;
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi same comment about setting this to Name and removing the below if-statement

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

{
get
{
return _capacity.Sku.Name;
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi for Sku and Tier properties, should we be null-checking _capacity.Sku?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add check

Mandatory = true,
HelpMessage = "Azure region where the capacity should be created.")]
[ValidateNotNullOrEmpty]
public string Location { 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.

@selasagi please consider adding the LocationCompleter for your creation scenarios that have a Location parameter: https://github.com/Azure/azure-powershell/wiki/PowerShell-Cmdlet-Design-Guidelines#location-completer

This will allow users to tab through valid locations in which they can create the given resource (by using the resource type to determine valid locations)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added. thanks

@cormacpayne
Copy link
Member

@selasagi two more comments:

(1) Please add the documentation folder to the root of your project and add the two corresponding files in there. This will help prepare for any breaking change that you might have in the future for your module.

(2) Are you going to deprecate the AzureRM.PowerBIEmbedded project and module and move the cmdlets into the new AzureRM.PowerBI module?

Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

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

@selasagi some additional comments that need to be resolved

@@ -1687,6 +1687,30 @@ Global
{8E5612F5-4F26-49CA-B9AC-67A4C1DB74F3}.Release|x64.Build.0 = Release|Any CPU
{8E5612F5-4F26-49CA-B9AC-67A4C1DB74F3}.Release|x86.ActiveCfg = Release|Any CPU
{8E5612F5-4F26-49CA-B9AC-67A4C1DB74F3}.Release|x86.Build.0 = Release|Any CPU
{9056F1E3-0B1D-46CA-A435-F1E9AAE6DCC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi are the changes in this file still 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.

removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry.. this one belong to Commands.AnalysisServices.Test.csproj. shouldn't remove

@@ -19,36 +19,19 @@
-->
## Current Release

## Version 4.0.0
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi please revert the deletions made to this file - the new content you are adding can remain under the ## Current Release header

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

@@ -12,7 +12,7 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '4.0.0'
ModuleVersion = '5.0.0'
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi please revert this version bump - we will handle bumping the versions during the 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

@@ -112,8 +120,7 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Add support for online help
- Run Get-Help with the -Online parameter to open the online help in your default Internet browser'
ReleaseNotes = '* Add support for PowerBI Embedded Capacity'
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi please revert this change to the release notes - we will handle updating this section during the release using our tooling

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

Choose a reason for hiding this comment

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

@selasagi can this file be remove? I thought the cmdlets were being shipped with AzureRM.PowerBIEmbedded

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,229 @@
<?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.

@selasagi any reason you are creating separate cmdlet and test projects for the new cmdlets? Why can't everything be contained in Commands.PowerBIEmbedded.Test and Commands.Management.PowerBI?

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 prefer to leave it separate because it will be easier later to remove the commands and the tests of the WorkspaceCollection

if (PassThru.IsPresent)
{
// Update the capacity current state
if (!PowerBIClient.TestCapacity(resourceGroupName, capacityName, out capacity))
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi why is this second TestCapacity call being made when PassThru is provided? Shouldn't it be made regardless of whether or not the user wants output?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If output required, I want that the output capacity state will be updateed/synced

if (PassThru.IsPresent)
{
// Update the capacity current state
if (!PowerBIClient.TestCapacity(resourceGroupName, capacityName, out capacity))
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi same comment

@@ -87,6 +87,7 @@ RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; RequiredVersion = '4.0.0';
@{ModuleName = 'AzureRM.Network'; RequiredVersion = '5.0.0'; },
@{ModuleName = 'AzureRM.NotificationHubs'; RequiredVersion = '4.0.0'; },
@{ModuleName = 'AzureRM.OperationalInsights'; RequiredVersion = '4.0.0'; },
@{ModuleName = 'AzureRM.PowerBI'; RequiredVersion = '1.0.0'; },
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi same comment - I thought the cmdlets would be shipped with AzureRM.PowerBIEmbedded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct

@cormacpayne cormacpayne removed their assignment Dec 5, 2017
@markcowl markcowl changed the base branch from preview to release-5.1.0 December 6, 2017 02:30
Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

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

@selasagi a few more comments. Also, are you still deprecating the existing workspace cmdlets in the future? If so, then you should add an Obsolete attribute on each of the cmdlets so users will know that they should use the new cmdlets you are adding moving forward.

- Modifies an instance of PowerBI Embedded Capacity

-## Version 4.0.0
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi looks like these headers have a - character in front of them, which is affecting how the markdown is being rendered

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

@@ -885,6 +885,9 @@
<Component Id="cmpA7B72722B1AC91C0B6B117CEAB00E3C0" Guid="*">
<File Id="fil40386C22E607E953293F5632EAC6393E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.PowerBIEmbedded\Microsoft.Azure.Commands.Management.PowerBIEmbedded.dll-Help.xml" />
</Component>
<Component Id="cmp20C58BA5A8D7263E84BE2BCB10783E8A" Guid="*">
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi the .wxi file should be regenerated since you are adding a couple new assemblies to the PowerBI project

@@ -0,0 +1,24 @@
using System;
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi this file is missing a license header

@@ -0,0 +1,36 @@
using System.Reflection;
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi this file is missing a license header

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
Copy link
Member

Choose a reason for hiding this comment

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

@selasagi both AssemblyVersion and AssemblyFileVersion should match the module version of AzureRM.PowerBIEmbedded

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 in commands & tests projects

@cormacpayne
Copy link
Member

@cormacpayne
Copy link
Member

@cormacpayne cormacpayne merged commit 014755f into Azure:release-5.1.0 Dec 7, 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