Skip to content

Commit 46658c9

Browse files
committed
Add new PowerBI module
1 parent 75c022c commit 46658c9

File tree

53 files changed

+9563
-106438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+9563
-106438
lines changed

TestMappings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
"src/ResourceManager/OperationalInsights/": [
8484
".\\src\\ResourceManager\\OperationalInsights\\Commands.OperationalInsights.Test\\bin\\Debug\\Microsoft.Azure.Commands.OperationalInsights.Test.dll"
8585
],
86+
"src/ResourceManager/PowerBI/": [
87+
".\\src\\ResourceManager\\PowerBI\\Commands.PowerBI.Test\\bin\\Debug\\Microsoft.Azure.Commands.PowerBI.Test.dll"
88+
],
8689
"src/ResourceManager/PowerBIEmbedded/": [
8790
".\\src\\ResourceManager\\PowerBIEmbedded\\Commands.PowerBIEmbedded.Test\\bin\\Debug\\Microsoft.Azure.Commands.PowerBIEmbedded.Test.dll"
8891
],

setup/azurecmdfiles.wxi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,23 @@
872872
<File Id="fil2725AD41AD388A79C41F93ADF90AADE3" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\OperationalInsightsStartup.ps1" />
873873
</Component>
874874
</Directory>
875+
<Directory Id="dirD954DE37AEE8CB504814FCCD117D9882" Name="AzureRM.PowerBI">
876+
<Component Id="cmp6711745BB7A04FD597FCCD38B884B763" Guid="*">
877+
<File Id="fil0C0033654A2B54E41178B0A68F0C7D88" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.PowerBI\AzureRM.PowerBI.psd1" />
878+
</Component>
879+
<Component Id="cmp471CBAE29E521DE0A19ACFDEFC21B3C4" Guid="*">
880+
<File Id="filFEE9389EAAF32152782F780B459DFB43" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.PowerBI\AzureRM.PowerBI.psm1" />
881+
</Component>
882+
<Component Id="cmp75D0A5F6F57389142C90EC4DE87716E4" Guid="*">
883+
<File Id="fil0D9D8E2FB46E44D3D7D9AAE576F42576" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.PowerBI\Microsoft.Azure.Commands.PowerBI.dll" />
884+
</Component>
885+
<Component Id="cmp57342412E2AC61128BB7816F76672221" Guid="*">
886+
<File Id="filA3D4DC4727532D56F3BA9AE94A7FAD2C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.PowerBI\Microsoft.Azure.Commands.PowerBI.dll-Help.xml" />
887+
</Component>
888+
<Component Id="cmp8F4F976262A66EA63365F39E635EA002" Guid="*">
889+
<File Id="fil6D99D377E428B5AC9249D4D555A08439" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.PowerBI\Microsoft.Azure.Management.PowerBIDedicated.dll" />
890+
</Component>
891+
</Directory>
875892
<Directory Id="dirC613916180ACDDF6B9274AA9594F6560" Name="AzureRM.PowerBIEmbedded">
876893
<Component Id="cmp07ACD4A07ADD8A358045C237522DA4C4" Guid="*">
877894
<File Id="fil1326C81C058BA9B188CE068472C2DF60" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.PowerBIEmbedded\AzureRM.PowerBIEmbedded.psd1" />
@@ -3430,6 +3447,11 @@
34303447
<ComponentRef Id="cmpC9691E1D00FBDB44AFB6B17AF835B85C" />
34313448
<ComponentRef Id="cmpFCA52566084FFD038E15FCF00D5071BB" />
34323449
<ComponentRef Id="cmpD40FCB9017580E2042019CEA18C95507" />
3450+
<ComponentRef Id="cmp6711745BB7A04FD597FCCD38B884B763" />
3451+
<ComponentRef Id="cmp471CBAE29E521DE0A19ACFDEFC21B3C4" />
3452+
<ComponentRef Id="cmp75D0A5F6F57389142C90EC4DE87716E4" />
3453+
<ComponentRef Id="cmp57342412E2AC61128BB7816F76672221" />
3454+
<ComponentRef Id="cmp8F4F976262A66EA63365F39E635EA002" />
34333455
<ComponentRef Id="cmp07ACD4A07ADD8A358045C237522DA4C4" />
34343456
<ComponentRef Id="cmpFDAC8616C4E824FA6880ECA8F8FF5128" />
34353457
<ComponentRef Id="cmp0F1E11B5C6A0C1527BB960FDCC4F4F34" />

src/ResourceManager.ForRefactoringOnly.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.DataFactoryV2", "R
249249
EndProject
250250
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.DataFactoryV2.Test", "ResourceManager\DataFactories\Commands.DataFactoryV2.Test\Commands.DataFactoryV2.Test.csproj", "{8E5612F5-4F26-49CA-B9AC-67A4C1DB74F3}"
251251
EndProject
252-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.PowerBIDedicated.Test", "ResourceManager\PowerBIDedicated\Commands.PowerBIDedicated.Test\Commands.PowerBIDedicated.Test.csproj", "{9056F1E3-0B1D-46CA-A435-F1E9AAE6DCC0}"
252+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.PowerBI.Test", "ResourceManager\PowerBIDedicated\Commands.PowerBIDedicated.Test\Commands.PowerBIDedicated.Test.csproj", "{9056F1E3-0B1D-46CA-A435-F1E9AAE6DCC0}"
253253
EndProject
254-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.PowerBIDedicated", "ResourceManager\PowerBIDedicated\Commands.PowerBIDedicated\Commands.PowerBIDedicated.csproj", "{B1B26198-8A48-4457-A969-831B2A871A0E}"
254+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.PowerBI", "ResourceManager\PowerBIDedicated\Commands.PowerBIDedicated\Commands.PowerBIDedicated.csproj", "{B1B26198-8A48-4457-A969-831B2A871A0E}"
255255
EndProject
256256
Global
257257
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/ResourceManager/PowerBIDedicated/AzureRM.PowerBIDedicated.psd1 renamed to src/ResourceManager/PowerBI/AzureRM.PowerBI.psd1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Module manifest for module 'PSGet_AzureRM.PowerBIDedicated'
2+
# Module manifest for module 'PSGet_AzureRM.PowerBI'
33
#
44
# Generated by: Microsoft Corporation
55
#
@@ -30,7 +30,7 @@ CompanyName = 'Microsoft Corporation'
3030
Copyright = '© Microsoft Corporation. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
33-
Description = 'Microsoft Azure PowerShell - PowerBI Embedded Capacity'
33+
Description = 'Microsoft Azure PowerShell - PowerBI'
3434

3535
# Minimum version of the Windows PowerShell engine required by this module
3636
PowerShellVersion = '3.0'
@@ -51,10 +51,10 @@ CLRVersion = '4.0'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '3.4.0'; })
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.0.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
57-
# RequiredAssemblies = @()
57+
RequiredAssemblies = '.\Microsoft.Azure.Management.PowerBIDedicated.dll'
5858

5959
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
6060
# ScriptsToProcess = @()
@@ -66,7 +66,7 @@ RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '3.4.0'; }
6666
# FormatsToProcess = @()
6767

6868
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
NestedModules = @('.\Microsoft.Azure.Commands.PowerBIDedicated.dll')
69+
NestedModules = @('.\Microsoft.Azure.Commands.PowerBI.dll')
7070

7171
# Functions 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 functions to export.
7272
FunctionsToExport = @()
@@ -101,10 +101,10 @@ PrivateData = @{
101101
PSData = @{
102102

103103
# Tags applied to this module. These help with module discovery in online galleries.
104-
Tags = 'Azure','ResourceManager','ARM','AzurePowerBIDedicated','PowerBIDedicated','PowerBIEmbeddedCapacity'
104+
Tags = 'Azure','ResourceManager','ARM','PowerBI','AzurePowerBI','PowerBIDedicated','PowerBIEmbeddedCapacity'
105105

106106
# A URL to the license for this module.
107-
LicenseUri = 'https://raw.githubusercontent.com/Azure/azure-powershell/preview/LICENSE.txt'
107+
LicenseUri = 'https://aka.ms/azps-license'
108108

109109
# A URL to the main website for this project.
110110
ProjectUri = 'https://github.com/Azure/azure-powershell'
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--
2+
Please leave this section at the top of the change log.
3+
4+
Changes for the current release should go under the section titled "Current Release", and should adhere to the following format:
5+
6+
## Current Release
7+
* Overview of change #1
8+
- Additional information about change #1
9+
* Overview of change #2
10+
- Additional information about change #2
11+
- Additional information about change #2
12+
* Overview of change #3
13+
* Overview of change #4
14+
- Additional information about change #4
15+
16+
## YYYY.MM.DD - Version X.Y.Z (Previous Release)
17+
* Overview of change #1
18+
- Additional information about change #1
19+
-->
20+
## Current Release
21+
22+
## Version 1.0.0
23+
* New Cmdlet Get-AzureRmPowerBIEmbeddedCapacity
24+
- Gets the details of an PowerBI Embedded Capacity.
25+
* New Cmdlet New-AzureRmPowerBIEmbeddedCapacity
26+
- Creates a new PowerBI Embedded Capacity
27+
* New Cmdlet Remove-AzureRmPowerBIEmbeddedCapacity
28+
- Deletes an instance of PowerBI Embedded Capacity
29+
* New Cmdlet Resume-AzureRmPowerBIEmbeddedCapacity
30+
- Resumes an instance of PowerBI Embedded Capacity
31+
* New Cmdlet Suspend-AzureRmPowerBIEmbeddedCapacity
32+
- Suspends an instance of PowerBI Embedded Capacity
33+
* New Cmdlet Test-AzureRmPowerBIEmbeddedCapacity
34+
- Tests the existence of an instance of PowerBI Embedded Capacity
35+
* New Cmdlet Update-AzureRmPowerBIEmbeddedCapacity
36+
- Modifies an instance of PowerBI Embedded Capacity
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<ProjectGuid>{9056F1E3-0B1D-46CA-A435-F1E9AAE6DCC0}</ProjectGuid>
1010
<OutputType>Library</OutputType>
1111
<AppDesignerFolder>Properties</AppDesignerFolder>
12-
<RootNamespace>Microsoft.Azure.Commands.PowerBIDedicated.Test</RootNamespace>
13-
<AssemblyName>Microsoft.Azure.Commands.PowerBIDedicated.Test</AssemblyName>
12+
<RootNamespace>Microsoft.Azure.Commands.PowerBI.Test</RootNamespace>
13+
<AssemblyName>Microsoft.Azure.Commands.PowerBI.Test</AssemblyName>
1414
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
1515
<FileAlignment>512</FileAlignment>
1616
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
@@ -173,8 +173,8 @@
173173
</ItemGroup>
174174
<ItemGroup>
175175
<Compile Include="Properties\AssemblyInfo.cs" />
176-
<Compile Include="ScenarioTests\PowerBIDedicatedTests.cs" />
177-
<Compile Include="ScenarioTests\PowerBIDedicatedTestsBase.cs" />
176+
<Compile Include="ScenarioTests\PowerBITests.cs" />
177+
<Compile Include="ScenarioTests\PowerBITestsBase.cs" />
178178
<Compile Include="ScenarioTests\UrlDecodingRecordMatcher.cs" />
179179
</ItemGroup>
180180
<ItemGroup>
@@ -207,16 +207,17 @@
207207
<None Include="ScenarioTests\Common.ps1">
208208
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
209209
</None>
210-
<None Include="ScenarioTests\PowerBIDedicatedTests.ps1">
210+
<None Include="ScenarioTests\PowerBITests.ps1" />
211+
<None Include="ScenarioTests\PowerBITests.ps1">
211212
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
212213
</None>
213-
<None Include="SessionRecords\Microsoft.Azure.Commands.PowerBIDedicated.Test.ScenarioTests.PowerBIDedicatedTests\TestPBIECapacity.json">
214+
<None Include="SessionRecords\Microsoft.Azure.Commands.PowerBI.Test.ScenarioTests.PowerBITests\TestPBIECapacity.json">
214215
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
215216
</None>
216-
<None Include="SessionRecords\Microsoft.Azure.Commands.PowerBIDedicated.Test.ScenarioTests.PowerBIDedicatedTests\TestNegativePBIECapacity.json">
217+
<None Include="SessionRecords\Microsoft.Azure.Commands.PowerBI.Test.ScenarioTests.PowerBITests\TestNegativePBIECapacity.json">
217218
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
218219
</None>
219-
<None Include="SessionRecords\Microsoft.Azure.Commands.PowerBIDedicated.Test.ScenarioTests.PowerBIDedicatedTests\TestPBIECapacityScale.json">
220+
<None Include="SessionRecords\Microsoft.Azure.Commands.PowerBI.Test.ScenarioTests.PowerBITests\TestPBIECapacityScale.json">
220221
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
221222
</None>
222223
</ItemGroup>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
// General Information about an assembly is controlled through the following
2020
// set of attributes. Change these attribute values to modify the information
2121
// associated with an assembly.
22-
[assembly: AssemblyTitle("Microsoft.Azure.Commands.PowerBIDedicated.Test")]
22+
[assembly: AssemblyTitle("Microsoft.Azure.Commands.PowerBI.Test")]
2323
[assembly: AssemblyDescription("")]
2424
[assembly: AssemblyConfiguration("")]
2525
[assembly: AssemblyCompany("")]
26-
[assembly: AssemblyProduct("Microsoft.Azure.Commands.PowerBIDedicated.Test")]
26+
[assembly: AssemblyProduct("Microsoft.Azure.Commands.PowerBI.Test")]
2727
[assembly: AssemblyCopyright("Copyright © Microsoft")]
2828
[assembly: AssemblyTrademark("")]
2929
[assembly: AssemblyCulture("")]
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,22 @@ Gets resource location for testing.
3636
#>
3737
function Get-Location
3838
{
39-
# TODO: should be implemented via Get-AzureRmResourceProvider
39+
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne `
40+
[Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
41+
{
42+
$namespace = "Microsoft.PowerBIDedicated"
43+
$type = "capacities"
44+
$location = Get-AzureRmResourceProvider -ProviderNamespace $namespace `
45+
| where {$_.ResourceTypes[0].ResourceTypeName -eq $type}
46+
47+
if ($location -eq $null)
48+
{
49+
return "West Central US"
50+
} else
51+
{
52+
return $location.Locations[0]
53+
}
54+
}
4055
return "West Central US"
4156
}
4257

@@ -46,7 +61,6 @@ Gets a resource group location for testing.
4661
#>
4762
function Get-RG-Location
4863
{
49-
# TODO: should be implemented via Get-AzureRmResourceProvider
5064
return "West US"
5165
}
5266

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
namespace Microsoft.Azure.Commands.PowerBIDedicated.Test.ScenarioTests
15+
namespace Microsoft.Azure.Commands.PowerBI.Test.ScenarioTests
1616
{
1717
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1818
using Xunit;
1919

20-
public class PowerBIDedicatedTests : PowerBIDedicatedTestsBase
20+
public class PowerBITests : PowerBITestsBase
2121
{
22-
public PowerBIDedicatedTests(Xunit.Abstractions.ITestOutputHelper output)
22+
public PowerBITests(Xunit.Abstractions.ITestOutputHelper output)
2323
{
2424
ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output));
2525
}
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,21 @@ function Test-PowerBIEmbeddedCapacity
9494
Assert-True {$found -eq 1} "Account created earlier is not found when listing all in subscription."
9595

9696
# Suspend PowerBI Embedded capacity
97-
Suspend-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName
98-
[array]$capacityGet = Get-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName
99-
$capacityGetItem = $capacityGet[0]
97+
$capacityGetItem = Suspend-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -PassThru
10098
# this is to ensure backward compatibility compatibility. The servie side would make change to differenciate state and provisioningState in future
10199
Assert-True {$capacityGetItem.State -like "Paused"}
102100
Assert-True {$capacityGetItem.ProvisioningState -like "Paused"}
103101

104102
# Resume PowerBI Embedded capacity
105-
Resume-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName
106-
[array]$capacityGet = Get-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName
103+
$capacityGetItem = Resume-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -PassThru
104+
[array]$capacityGet = Get-AzureRmPowerBIEmbeddedCapacity -ResourceId $capacityGetItem.Id
107105
$capacityGetItem = $capacityGet[0]
106+
Assert-AreEqual $capacityGetItem.Name $capacityGetItem.Name
108107
Assert-True {$capacityGetItem.ProvisioningState -like "Succeeded"}
109108
Assert-True {$capacityGetItem.State -like "Succeeded"}
110109

111110
# Delete PowerBI Embedded capacity
112-
Remove-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -PassThru
111+
Get-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName | Remove-AzureRmPowerBIEmbeddedCapacity -PassThru
113112

114113
# Verify that it is gone by trying to get it again
115114
Assert-Throws {Get-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
3434
using System.IO;
3535

36-
namespace Microsoft.Azure.Commands.PowerBIDedicated.Test.ScenarioTests
36+
namespace Microsoft.Azure.Commands.PowerBI.Test.ScenarioTests
3737
{
38-
public class PowerBIDedicatedTestsBase : RMTestBase
38+
public class PowerBITestsBase : RMTestBase
3939
{
4040
private LegacyTest.CSMTestEnvironmentFactory csmTestFactory;
4141
private EnvironmentSetupHelper helper;
@@ -53,16 +53,16 @@ public class PowerBIDedicatedTestsBase : RMTestBase
5353

5454
public GalleryClient GalleryClient { get; private set; }
5555

56-
public static PowerBIDedicatedTestsBase NewInstance
56+
public static PowerBITestsBase NewInstance
5757
{
5858
get
5959
{
60-
return new PowerBIDedicatedTestsBase();
60+
return new PowerBITestsBase();
6161
}
6262
}
6363

6464

65-
public PowerBIDedicatedTestsBase()
65+
public PowerBITestsBase()
6666
{
6767
helper = new EnvironmentSetupHelper();
6868
}
@@ -120,7 +120,7 @@ public void RunPsTestWorkflow(
120120
"ScenarioTests\\" + callingClassName + ".ps1",
121121
helper.RMProfileModule,
122122
helper.RMResourceModule,
123-
helper.GetRMModulePath(@"AzureRM.PowerBIDedicated.psd1"),
123+
helper.GetRMModulePath(@"AzureRM.PowerBI.psd1"),
124124
"AzureRM.Resources.ps1");
125125
try
126126
{

0 commit comments

Comments
 (0)