Skip to content

Commit bb3ccb1

Browse files
authored
Update SKU allowed values for PowerBI Embedded capacities (Azure#18670)
* Update sku allowed values and doc files * update tests with large skus * update changelog * Update ChangeLog.md * fix large sku scale test and revert sln * eol * revert
1 parent 8b22c86 commit bb3ccb1

20 files changed

+3456
-47
lines changed

src/PowerBIEmbedded/PowerBI.Test/ScenarioTests/PowerBITests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,12 @@ public void TestNegativePBIECapacity()
4343
{
4444
TestRunner.RunTestScript("Test-NegativePowerBIEmbeddedCapacity");
4545
}
46+
47+
[Fact]
48+
[Trait(Category.AcceptanceType, Category.CheckIn)]
49+
public void TestPBIECapacityLargeSku()
50+
{
51+
TestRunner.RunTestScript("Test-PowerBIEmbeddedCapacityLargeSku");
52+
}
4653
}
4754
}

src/PowerBIEmbedded/PowerBI.Test/ScenarioTests/PowerBITests.ps1

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,73 @@ function Test-NegativePowerBIEmbeddedCapacity
236236
Invoke-HandledCmdlet -Command {Remove-AzResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue} -IgnoreFailures
237237
}
238238
}
239+
240+
<#
241+
.SYNOPSIS
242+
Tests PowerBI Embedded Capacity lifecycle for large skus (A7,A8) (Create, Update, Scale, Get, Delete).
243+
#>
244+
function Test-PowerBIEmbeddedCapacityLargeSku
245+
{
246+
try
247+
{
248+
# Creating capacity
249+
$RGlocation = Get-RG-Location
250+
$location = Get-Location
251+
$resourceGroupName = Get-ResourceGroupName
252+
$capacityName = Get-PowerBIEmbeddedCapacityName
253+
254+
New-AzResourceGroup -Name $resourceGroupName -Location $RGlocation
255+
256+
$capacityCreated = New-AzPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -Location $location -Sku 'A7' -Administrator '[email protected]','[email protected]'
257+
258+
Assert-AreEqual $capacityName $capacityCreated.Name
259+
Assert-AreEqual $location $capacityCreated.Location
260+
Assert-AreEqual "Microsoft.PowerBIDedicated/capacities" $capacityCreated.Type
261+
Assert-AreEqual 2 $capacityCreated.Administrator.Count
262+
Assert-True {$capacityCreated.Id -like "*$resourceGroupName*"}
263+
264+
[array]$capacityGet = Get-AzPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName
265+
$capacityGetItem = $capacityGet[0]
266+
Assert-True {$capacityGetItem.State -like "Succeeded"}
267+
268+
# Test to make sure the capacity does exist
269+
Assert-True {Test-AzPowerBIEmbeddedCapacity -Name $capacityName}
270+
# Test it without specifying a resource group
271+
Assert-True {Test-AzPowerBIEmbeddedCapacity -Name $capacityName}
272+
273+
# Updating capacity and Scale up A7 -> A8
274+
$tagsToUpdate = @{"TestTag" = "TestUpdate"}
275+
$capacityUpdated = Update-AzPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -Tag $tagsToUpdate -Sku 'A8' -Administrator '[email protected]' -PassThru
276+
Assert-NotNull $capacityUpdated.Tag "Tag do not exists"
277+
Assert-NotNull $capacityUpdated.Tag["TestTag"] "The updated tag 'TestTag' does not exist"
278+
Assert-AreEqual $capacityUpdated.Administrator.Count 1
279+
Assert-AreEqual A8 $capacityUpdated.Sku
280+
Assert-NotNull $capacityUpdated.Administrator "Capacity Administrator list is empty"
281+
282+
# Suspend PowerBI Embedded capacity
283+
$capacityGetItem = Suspend-AzPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -PassThru
284+
[array]$capacityGet = Get-AzPowerBIEmbeddedCapacity -ResourceId $capacityGetItem.Id
285+
$capacityGetItem = $capacityGet[0]
286+
Assert-AreEqual $capacityGetItem.Name $capacityGetItem.Name
287+
Assert-True {$capacityGetItem.State -like "Paused"}
288+
289+
# Resume PowerBI Embedded capacity
290+
$capacityGetItem = Resume-AzPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -PassThru
291+
[array]$capacityGet = Get-AzPowerBIEmbeddedCapacity -ResourceId $capacityGetItem.Id
292+
$capacityGetItem = $capacityGet[0]
293+
Assert-AreEqual $capacityGetItem.Name $capacityGetItem.Name
294+
Assert-True {$capacityGetItem.State -like "Succeeded"}
295+
296+
# Delete PowerBI Embedded capacity
297+
Get-AzPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName | Remove-AzPowerBIEmbeddedCapacity -PassThru
298+
299+
# Verify that it is gone by trying to get it again
300+
Assert-Throws {Get-AzPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName}
301+
}
302+
finally
303+
{
304+
# cleanup the resource group that was used in case it still exists. This is a best effort task, we ignore failures here.
305+
Invoke-HandledCmdlet -Command {Remove-AzPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -ErrorAction SilentlyContinue} -IgnoreFailures
306+
Invoke-HandledCmdlet -Command {Remove-AzResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue} -IgnoreFailures
307+
}
308+
}

src/PowerBIEmbedded/PowerBI.Test/SessionRecords/Microsoft.Azure.Commands.PowerBI.Test.ScenarioTests.PowerBITests/TestPBIECapacityLargeSku.json

Lines changed: 3331 additions & 0 deletions
Large diffs are not rendered by default.

src/PowerBIEmbedded/PowerBI/Commands/NewAzureRmPowerBIEmbeddedCapacity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class NewPowerBIEmbeddedCapacity : PowerBICmdletBase
5656
Mandatory = true,
5757
HelpMessage = "Name of the Sku used to create the capacity")]
5858
[ValidateNotNullOrEmpty]
59-
[ValidateSet("A1", "A2", "A3", "A4", "A5", "A6", IgnoreCase = true)]
59+
[ValidateSet("A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", IgnoreCase = true)]
6060
public string Sku { get; set; }
6161

6262
[Parameter(

src/PowerBIEmbedded/PowerBI/Commands/UpdateAzureRmPowerBIEmbeddedCapacity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class UpdateAzurePowerBIEmbeddedCapacity : PowerBICmdletBase
5252
Mandatory = false,
5353
HelpMessage = "Name of the Sku used to create the capacity")]
5454
[ValidateNotNullOrEmpty]
55-
[ValidateSet("A1", "A2", "A3", "A4", "A5", "A6", IgnoreCase = true)]
55+
[ValidateSet("A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", IgnoreCase = true)]
5656
public string Sku { get; set; }
5757

5858
[Parameter(

src/PowerBIEmbedded/PowerBIEmbedded.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,4 @@ Global
153153
GlobalSection(ExtensibilityGlobals) = postSolution
154154
SolutionGuid = {DB4F6337-206E-4CC4-9940-C24794336EEB}
155155
EndGlobalSection
156-
EndGlobal
156+
EndGlobal

src/PowerBIEmbedded/PowerBIEmbedded/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Updated SKU allowed values to support A7 and A8
2122

2223
## Version 1.1.2
2324
* Updated assembly version of PowerBI cmdlets

src/PowerBIEmbedded/PowerBIEmbedded/help/Get-AzPowerBIEmbeddedCapacity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Azure.PowerShell.Cmdlets.PowerBI.dll-Help.xml
33
Module Name: Az.PowerBIEmbedded
44
ms.assetid: 5321FC62-3585-4493-A3D2-22CD82503CA7
@@ -144,7 +144,7 @@ Accept wildcard characters: False
144144
```
145145
146146
### CommonParameters
147-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
147+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
148148
149149
## INPUTS
150150

src/PowerBIEmbedded/PowerBIEmbedded/help/Get-AzPowerBIWorkspace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Azure.PowerShell.Cmdlets.PowerBIEmbedded.dll-Help.xml
33
Module Name: Az.PowerBIEmbedded
44
ms.assetid: 5321FC62-3585-4493-A3D2-22CD82503CA7
@@ -78,7 +78,7 @@ Accept wildcard characters: False
7878
```
7979
8080
### CommonParameters
81-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
81+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
8282
8383
## INPUTS
8484

src/PowerBIEmbedded/PowerBIEmbedded/help/Get-AzPowerBIWorkspaceCollection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Azure.PowerShell.Cmdlets.PowerBIEmbedded.dll-Help.xml
33
Module Name: Az.PowerBIEmbedded
44
ms.assetid: EEF32F48-00F6-4C57-B4F1-B58B566EAFEF
@@ -104,7 +104,7 @@ Accept wildcard characters: False
104104
```
105105
106106
### CommonParameters
107-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
107+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
108108
109109
## INPUTS
110110

0 commit comments

Comments
 (0)