Skip to content

Vmss #61

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 118 commits into from
Nov 19, 2015
Merged

Vmss #61

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
8494341
Added Intelligence Pack cmdlets for PowerShell
chfunk Oct 28, 2015
23df400
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
chfunk Oct 28, 2015
7271ea2
Added session record, made additional fixes
chfunk Oct 30, 2015
f9d37a1
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
chfunk Oct 30, 2015
c6e3674
Removed app.config in Resource Manager common
chfunk Oct 30, 2015
75075fd
Reverted wxi change
chfunk Oct 30, 2015
38cc772
Use Get-AzureAailableExtension to get the latest extension version
eshaparmar Oct 30, 2015
779b065
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
chfunk Oct 30, 2015
ae57582
Updating data masking tests to work with MS25
yaakoviyun Nov 1, 2015
9b1c81d
Merge pull request #1 from Azure/dev
yaakoviyun Nov 1, 2015
3045c1d
Merge branch 'release-1.0.0' of https://github.com/Azure/azure-powers…
eshaparmar Nov 2, 2015
0cb1ae8
MSFT 4811945: [LIVESITE BLOCKING][HOTFIX] VMProvisioning: Collection …
vadimp-msft Nov 5, 2015
9a971f7
MSFT 4811945: [LIVESITE BLOCKING][HOTFIX] VMProvisioning: Collection …
vadimp-msft Nov 5, 2015
f8c2799
Fixing typo
vadimp-msft Nov 5, 2015
3a6ec36
Updated Operational Insights nuget package
chfunk Nov 5, 2015
8b50559
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
vadimp-msft Nov 6, 2015
627911c
Threat Detection new API + data masking changes
yaakoviyun Nov 8, 2015
406b6c2
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
yaakoviyun Nov 8, 2015
ecba4fb
Merge pull request #2 from Azure/dev
yaakoviyun Nov 8, 2015
eac3f50
Merge branch 'dev' of https://github.com/yaakoviyun/azure-powershell …
yaakoviyun Nov 8, 2015
e473aff
undo restore.config
yaakoviyun Nov 8, 2015
649b742
CR fixes
yaakoviyun Nov 8, 2015
3690804
CR comments
yaakoviyun Nov 9, 2015
f797488
CR comments
yaakoviyun Nov 9, 2015
692775b
Additional fixes
yaakoviyun Nov 9, 2015
6f12f86
add tests
yaakoviyun Nov 9, 2015
5e15c1d
Update AzureRMVMExtensionImage cmdlet name to AzureRmVMExtensionImage
hyonholee Nov 10, 2015
31b2f40
Addressing CR comments
vadimp-msft Nov 10, 2015
b3c3bdd
Fixing typo
vadimp-msft Nov 10, 2015
7082412
Class names consistent with PS guidance
vadimp-msft Nov 10, 2015
c725e91
Update from master
yaakoviyun Nov 10, 2015
c61799d
syntax error
yaakoviyun Nov 10, 2015
d8c9607
Revert "Threat Detection new API + data masking changes"
yaakoviyun Nov 10, 2015
2ebda65
Re-Adding reverted csproj changes
yaakoviyun Nov 10, 2015
4832d03
CR fixes
yaakoviyun Nov 10, 2015
1950934
Minor changes
yaakoviyun Nov 10, 2015
534c56d
added tests records
yaakoviyun Nov 10, 2015
ffa0643
more tests
yaakoviyun Nov 10, 2015
36ff79a
Show Debug contents when cloud exception occurs
hyonholee Nov 10, 2015
14f1c78
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
chfunk Nov 10, 2015
0902714
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
chfunk Nov 10, 2015
f697a1e
Expose SubStatus for Extension instance view
hyonholee Nov 10, 2015
421570b
Use BatchRestClient in Batch PowerShell
Nov 10, 2015
149e5df
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Nov 10, 2015
34887ae
Properly rename this class to match cmdlet name
Nov 10, 2015
839ff7b
More CR feedback addressed
vadimp-msft Nov 11, 2015
67f429c
Update Key Vault manual tests to handle Azure PowerShell 1.0 changes
seanbamsft Nov 11, 2015
ca46698
Adds file to session records
chfunk Nov 11, 2015
4982ea7
Re-record scenario tests
Nov 11, 2015
fae57c3
Fix all CR comment + adding some minor change for DM rule removal wit…
yaakoviyun Nov 11, 2015
b8ffaf1
Merge pull request #1252 from vadimp-msft/dev
markcowl Nov 11, 2015
a91c23a
Merge pull request #1256 from yaakoviyun/dev
markcowl Nov 11, 2015
4fea9bb
Merge pull request #1274 from seanbamsft/dev
markcowl Nov 11, 2015
d53217e
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
vadimp-msft Nov 11, 2015
d1ed25b
Bug fix for formatting the datetimeoffset string.
Nov 11, 2015
9f8ce1a
Merge pull request #186 from Azure/dev
huangpf Nov 11, 2015
03777c8
Merge pull request #187 from huangpf/dev
huangpf Nov 11, 2015
bf7c21c
Updating changelog.md
vadimp-msft Nov 11, 2015
ad80296
Enable BGInfo Extension by default
hyonholee Nov 11, 2015
6400ce6
Makes sure session record is copied
chfunk Nov 11, 2015
afd6bba
Merge remote-tracking branch 'refs/remotes/Azure/dev' into dev
chfunk Nov 11, 2015
6c2d9ee
bug fixes
Nov 11, 2015
92b5a66
Audit tests to create storage via templates
yoavrubin Nov 11, 2015
e48733c
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yoavrubin Nov 11, 2015
14be7de
Merge pull request #1279 from vadimp-msft/dev
yadavbdev Nov 11, 2015
bcc2cad
updating versions
Nov 12, 2015
6206d94
Fixed getting vault case sensitivity in Get-AzureRmKeyVault and code …
pomortaz Nov 11, 2015
b998b24
Merge pull request #1281 from shefaliv/hdi
markcowl Nov 12, 2015
4288585
adding test for case insensitive comparison when getting vault
pomortaz Nov 12, 2015
533708f
Threat detection tests to use dedicated template
yoavrubin Nov 12, 2015
4263ca5
Merge pull request #188 from Azure/dev
huangpf Nov 12, 2015
de46da4
Merge pull request #189 from huangpf/dev
huangpf Nov 12, 2015
80b7b4b
Merge pull request #1282 from yoavrubin/dev
Nov 12, 2015
4674a7c
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
Nov 12, 2015
e03d5d8
Merge pull request #1273 from pomortaz/dev
markcowl Nov 12, 2015
5762e86
Merge pull request #190 from Azure/dev
huangpf Nov 13, 2015
15ba060
Removes OpInsights from common
chfunk Nov 13, 2015
ad95d84
Merge pull request #191 from huangpf/dev
huangpf Nov 13, 2015
9df0d4b
CopyToOutputDirectory of threat detection tests
yoavrubin Nov 13, 2015
e00b74a
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yoavrubin Nov 13, 2015
2db6762
fixed indentation
eshaparmar Nov 13, 2015
2c723b0
fixed indentation
eshaparmar Nov 13, 2015
1bd6fc2
Merge branch 'dev' into dsc-version-update
eshaparmar Nov 13, 2015
954ac93
Merge pull request #1289 from yoavrubin/dev
markcowl Nov 13, 2015
81b36fa
Merge pull request #1290 from Azure/HDInsight102
markcowl Nov 13, 2015
b7660b4
Merge pull request #1241 from independentwork/dev
markcowl Nov 13, 2015
81c01c6
Merge pull request #1275 from jasper-schneider/productHeader
markcowl Nov 13, 2015
a17913b
Merge pull request #192 from Azure/dev
huangpf Nov 13, 2015
e0361c2
Fix a warning message when an OS disk is in a different resource group.
hyonholee Nov 13, 2015
eadb405
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Nov 13, 2015
9c4a532
Tests for job bug fix
Nov 14, 2015
0b1958e
Merge pull request #1293 from Azure/master
markcowl Nov 14, 2015
459d33f
Merge pull request #1292 from dscsolutions/dsc-version-update
markcowl Nov 14, 2015
bec90e3
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Nov 14, 2015
c62c8b5
Add TestVirtualMachineWithEmptyAuc record file
hyonholee Nov 14, 2015
5f16675
Merge pull request #193 from Azure/dev
huangpf Nov 14, 2015
c6c9279
Merge pull request #1285 from begoldsm/dev
markcowl Nov 16, 2015
7abeb64
Merge pull request #194 from huangpf/dev
huangpf Nov 17, 2015
dbc1c4a
Merge pull request #195 from Azure/dev
huangpf Nov 17, 2015
ce54486
Merge pull request #59 from Azure/dev
AzureRT Nov 17, 2015
2562e72
Merge pull request #58 from huangpf/dev
AzureRT Nov 17, 2015
bd4466b
Merge pull request #196 from huangpf/dev
huangpf Nov 17, 2015
d00d5a7
Merge pull request #197 from AzureRT/dev
huangpf Nov 17, 2015
858fe71
Ignore exceptions during end processing
hyonholee Nov 18, 2015
dabed73
Merge pull request #198 from AzureRT/vmss
huangpf Nov 18, 2015
033098f
BuildGenerateRDFE
huangpf Nov 18, 2015
6180751
Merge branch 'vmss' of https://github.com/huangpf/azure-powershell in…
huangpf Nov 18, 2015
cebf7f4
Fix
huangpf Nov 18, 2015
b2d1ffd
Skip Deployment API
huangpf Nov 18, 2015
407d4d2
Add Invoke Category for RDFE
huangpf Nov 18, 2015
44baf45
Recover Deployment Operations
huangpf Nov 18, 2015
13280d8
Fix Enum Problems
huangpf Nov 18, 2015
2c54ef6
Fix Param Name Duplication
huangpf Nov 18, 2015
59ab91f
Merge pull request #1294 from hyonholee/dev
markcowl Nov 18, 2015
a0ca367
Merge pull request #199 from Azure/dev
huangpf Nov 19, 2015
7962d21
Merge pull request #200 from huangpf/dev
huangpf Nov 19, 2015
19e9e42
Change Category to preview
huangpf Nov 19, 2015
92f1406
Update
huangpf Nov 19, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
* Azure SQL Database: new cmdlets for managing database threat detection policies:
* Get-AzureRmSqlDatabaseThreatDetectionPolicy
* Set-AzureRmSqlDatabaseThreatDetectionPolicy
* Remove-AzureRmSqlDatabaseThreatDetectionPolicy
* Azure RemoteApp: New cmdlets for managing stale machine accounts in AD:
* Get-AzureRemoteAppVmStaleAdObject
* Clear-AzureRemoteAppVmStaleAdObject

## 2015.11.09 version 1.0.1
* Azure Compute
* Added cmdlets for managing VM DiskEncryption extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
<Compile Include="ScenarioTests\FileTests.cs" />
<Compile Include="ScenarioTests\JobTests.cs" />
<Compile Include="ScenarioTests\PoolTests.cs" />
<Compile Include="ScenarioTests\ScenarioTestContext.cs" />
<Compile Include="ScenarioTests\ScenarioTestHelpers.cs" />
<Compile Include="ScenarioTests\SubscriptionTests.cs" />
<Compile Include="ScenarioTests\TaskTests.cs" />
Expand Down Expand Up @@ -274,7 +275,7 @@
</None>
<None Include="ScenarioTests\SubscriptionTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</None>
<None Include="ScenarioTests\TaskTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -568,7 +569,7 @@
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.SubscriptionTests\TestGetSubscriptionQuotas.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.TaskTests\TestCreateTask.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public void TestGetCertificateByThumbprint()
{
BatchController controller = BatchController.NewInstance;
BatchAccountContext context = null;
string thumbprintAlgorithm = null;
string thumbprint = null;
controller.RunPsTestWorkflow(
() => { return new string[] { string.Format("Test-GetCertificateByThumbprint '{0}' '{1}' '{2}'", accountName, BatchTestHelpers.TestCertificateAlgorithm, thumbprint) }; },
Expand Down Expand Up @@ -218,45 +217,4 @@ public void TestCancelCertificateDelete()
TestUtilities.GetCurrentMethodName());
}
}

// Cmdlets that use the HTTP Recorder interceptor for use with scenario tests
[Cmdlet(VerbsCommon.Get, "AzureBatchCertificate_ST", DefaultParameterSetName = Constants.ODataFilterParameterSet)]
public class GetBatchCertificateScenarioTestCommand : GetBatchCertificateCommand
{
protected override void ProcessRecord()
{
AdditionalBehaviors = new List<BatchClientBehavior>() { ScenarioTestHelpers.CreateHttpRecordingInterceptor() };
base.ProcessRecord();
}
}

[Cmdlet(VerbsCommon.New, "AzureBatchCertificate_ST", DefaultParameterSetName = FileParameterSet)]
public class NewBatchCertificateScenarioTestCommand : NewBatchCertificateCommand
{
protected override void ProcessRecord()
{
AdditionalBehaviors = new List<BatchClientBehavior>() { ScenarioTestHelpers.CreateHttpRecordingInterceptor() };
base.ProcessRecord();
}
}

[Cmdlet(VerbsCommon.Remove, "AzureBatchCertificate_ST")]
public class RemoveBatchCertificateScenarioTestCommand : RemoveBatchCertificateCommand
{
protected override void ProcessRecord()
{
AdditionalBehaviors = new List<BatchClientBehavior>() { ScenarioTestHelpers.CreateHttpRecordingInterceptor() };
base.ProcessRecord();
}
}

[Cmdlet(VerbsLifecycle.Stop, "AzureBatchCertificateDeletion_ST")]
public class StopBatchCertificateDeletionScenarioTestCommand : StopBatchCertificateDeletionCommand
{
protected override void ProcessRecord()
{
AdditionalBehaviors = new List<BatchClientBehavior>() { ScenarioTestHelpers.CreateHttpRecordingInterceptor() };
base.ProcessRecord();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,52 @@ Tests adding certificates to a Batch account
#>
function Test-AddCertificate
{
param([string]$accountName)

$context = Get-AzureRmBatchAccountKeys -Name $accountName

# Load certificates so thumbprints can be compared later
$localDir = ($pwd).Path # Use $pwd to get the local directory. If $pwd is not used, paths are relative to [Environment]::CurrentDirectory, which can be different
$cer2Path = $localDir + "\Resources\BatchTestCert02.cer"
$cer3Path = $localDir + "\Resources\BatchTestCert03.cer"
$pfx4Path = $localDir + "\Resources\BatchTestCert04.pfx"
$pfx5Path = $localDir + "\Resources\BatchTestCert05.pfx"

$password = "Passw0rd"
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force

$cer2 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $cer2Path
$cer3 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $cer3Path
$pfx4 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList @($pfx4Path,$securePassword)
$pfx5 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList @($pfx5Path,$securePassword)
$pfx5Bytes = [System.IO.File]::ReadAllBytes($pfx5Path)
try
{
# .cer by file path
New-AzureBatchCertificate_ST $cer2Path -BatchContext $context
$cert = Get-AzureBatchCertificate_ST "sha1" $cer2.Thumbprint -BatchContext $context
Assert-AreEqual $cer2.Thumbprint $cert.Thumbprint

# .cer by raw data
$cer3 | New-AzureBatchCertificate_ST -BatchContext $context
$cert = Get-AzureBatchCertificate_ST "sha1" $cer3.Thumbprint -BatchContext $context
Assert-AreEqual $cer3.Thumbprint $cert.Thumbprint
# .pfx by file path
New-AzureBatchCertificate_ST $pfx4Path -Password $password -BatchContext $context
$cert = Get-AzureBatchCertificate_ST "sha1" $pfx4.Thumbprint -BatchContext $context
Assert-AreEqual $pfx4.Thumbprint $cert.Thumbprint

# .pfx by raw data
New-AzureBatchCertificate_ST $pfx5Bytes -Password $password -BatchContext $context
$cert = Get-AzureBatchCertificate_ST "sha1" $pfx4.Thumbprint -BatchContext $context
Assert-AreEqual $pfx4.Thumbprint $cert.Thumbprint
}
finally
{
Get-AzureBatchCertificate_ST -BatchContext $context | Remove-AzureBatchCertificate_ST -Force -BatchContext $context
}
param([string]$accountName)

$context = Get-ScenarioTestContext $accountName

# Load certificates so thumbprints can be compared later
$localDir = ($pwd).Path # Use $pwd to get the local directory. If $pwd is not used, paths are relative to [Environment]::CurrentDirectory, which can be different
$cer2Path = $localDir + "\Resources\BatchTestCert02.cer"
$cer3Path = $localDir + "\Resources\BatchTestCert03.cer"
$pfx4Path = $localDir + "\Resources\BatchTestCert04.pfx"
$pfx5Path = $localDir + "\Resources\BatchTestCert05.pfx"

$password = "Passw0rd"
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force

$cer2 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $cer2Path
$cer3 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $cer3Path
$pfx4 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList @($pfx4Path,$securePassword)
$pfx5 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList @($pfx5Path,$securePassword)
$pfx5Bytes = [System.IO.File]::ReadAllBytes($pfx5Path)
try
{
# .cer by file path
New-AzureBatchCertificate $cer2Path -BatchContext $context
$cert = Get-AzureBatchCertificate "sha1" $cer2.Thumbprint -BatchContext $context
Assert-AreEqual $cer2.Thumbprint $cert.Thumbprint

# .cer by raw data
$cer3 | New-AzureBatchCertificate -BatchContext $context
$cert = Get-AzureBatchCertificate "sha1" $cer3.Thumbprint -BatchContext $context
Assert-AreEqual $cer3.Thumbprint $cert.Thumbprint
# .pfx by file path
New-AzureBatchCertificate $pfx4Path -Password $password -BatchContext $context
$cert = Get-AzureBatchCertificate "sha1" $pfx4.Thumbprint -BatchContext $context
Assert-AreEqual $pfx4.Thumbprint $cert.Thumbprint

# .pfx by raw data
New-AzureBatchCertificate $pfx5Bytes -Password $password -BatchContext $context
$cert = Get-AzureBatchCertificate "sha1" $pfx4.Thumbprint -BatchContext $context
Assert-AreEqual $pfx4.Thumbprint $cert.Thumbprint
}
finally
{
Get-AzureBatchCertificate -BatchContext $context | Remove-AzureBatchCertificate -Force -BatchContext $context
}
}

<#
Expand All @@ -72,13 +72,13 @@ Tests querying for a certificate by its thumbprint
#>
function Test-GetCertificateByThumbprint
{
param([string]$accountName, [string]$thumbprintAlgorithm, [string]$thumbprint)
param([string]$accountName, [string]$thumbprintAlgorithm, [string]$thumbprint)

$context = Get-AzureRmBatchAccountKeys -Name $accountName
$cert = Get-AzureBatchCertificate_ST $thumbprintAlgorithm $thumbprint -BatchContext $context
$context = Get-ScenarioTestContext $accountName
$cert = Get-AzureBatchCertificate $thumbprintAlgorithm $thumbprint -BatchContext $context

Assert-AreEqual $thumbprint $cert.Thumbprint
Assert-AreEqual $thumbprintAlgorithm $cert.ThumbprintAlgorithm
Assert-AreEqual $thumbprint $cert.Thumbprint
Assert-AreEqual $thumbprintAlgorithm $cert.ThumbprintAlgorithm
}

<#
Expand All @@ -87,21 +87,21 @@ Tests querying for Batch certs using a filter
#>
function Test-ListCertificatesByFilter
{
param([string]$accountName, [string]$state, [string]$toDeleteThumbprint, [string]$matches)
param([string]$accountName, [string]$state, [string]$toDeleteThumbprint, [string]$matches)

$context = Get-AzureRmBatchAccountKeys -Name $accountName
$filter = "state eq '$state'"
$context = Get-ScenarioTestContext $accountName
$filter = "state eq '$state'"

# Put a cert in the 'deleting' state
Remove-AzureBatchCertificate_ST "sha1" $toDeleteThumbprint -Force -BatchContext $context
# Put a cert in the 'deleting' state
Remove-AzureBatchCertificate "sha1" $toDeleteThumbprint -Force -BatchContext $context

$certs = Get-AzureBatchCertificate_ST -Filter $filter -BatchContext $context
$certs = Get-AzureBatchCertificate -Filter $filter -BatchContext $context

Assert-AreEqual $matches $certs.Length
foreach($cert in $certs)
{
Assert-AreEqual $state $cert.State
}
Assert-AreEqual $matches $certs.Length
foreach($cert in $certs)
{
Assert-AreEqual $state $cert.State
}
}

<#
Expand All @@ -110,29 +110,29 @@ Tests querying for Batch certs using a select clause
#>
function Test-GetAndListCertificatesWithSelect
{
param([string]$accountName, [string]$thumbprintAlgorithm, [string]$thumbprint)
param([string]$accountName, [string]$thumbprintAlgorithm, [string]$thumbprint)

$context = Get-AzureRmBatchAccountKeys -Name $accountName
$filter = "state eq 'active'"
$selectClause = "thumbprint,state"
$context = Get-ScenarioTestContext $accountName
$filter = "state eq 'active'"
$selectClause = "thumbprint,state"

# Test with Get cert API
$cert = Get-AzureBatchCertificate_ST $thumbprintAlgorithm $thumbprint -BatchContext $context
Assert-AreNotEqual $null $cert.Url
Assert-AreEqual $thumbprint $cert.Thumbprint
# Test with Get cert API
$cert = Get-AzureBatchCertificate $thumbprintAlgorithm $thumbprint -BatchContext $context
Assert-AreNotEqual $null $cert.Url
Assert-AreEqual $thumbprint $cert.Thumbprint

$cert = Get-AzureBatchCertificate_ST $thumbprintAlgorithm $thumbprint -Select $selectClause -BatchContext $context
Assert-AreEqual $null $cert.Url
Assert-AreEqual $thumbprint $cert.Thumbprint
$cert = Get-AzureBatchCertificate $thumbprintAlgorithm $thumbprint -Select $selectClause -BatchContext $context
Assert-AreEqual $null $cert.Url
Assert-AreEqual $thumbprint $cert.Thumbprint

# Test with List certs API
$cert = Get-AzureBatchCertificate_ST -Filter $filter -BatchContext $context
Assert-AreNotEqual $null $cert.Url
Assert-AreEqual $thumbprint $cert.Thumbprint
# Test with List certs API
$cert = Get-AzureBatchCertificate -Filter $filter -BatchContext $context
Assert-AreNotEqual $null $cert.Url
Assert-AreEqual $thumbprint $cert.Thumbprint

$cert = Get-AzureBatchCertificate_ST -Filter $filter -Select $selectClause -BatchContext $context
Assert-AreEqual $null $cert.Url
Assert-AreEqual $thumbprint $cert.Thumbprint
$cert = Get-AzureBatchCertificate -Filter $filter -Select $selectClause -BatchContext $context
Assert-AreEqual $null $cert.Url
Assert-AreEqual $thumbprint $cert.Thumbprint
}

<#
Expand All @@ -141,12 +141,12 @@ Tests querying for Batch certs and supplying a max count
#>
function Test-ListCertificatesWithMaxCount
{
param([string]$accountName, [string]$maxCount)
param([string]$accountName, [string]$maxCount)

$context = Get-AzureRmBatchAccountKeys -Name $accountName
$certs = Get-AzureBatchCertificate_ST -MaxCount $maxCount -BatchContext $context
$context = Get-ScenarioTestContext $accountName
$certs = Get-AzureBatchCertificate -MaxCount $maxCount -BatchContext $context

Assert-AreEqual $maxCount $certs.Length
Assert-AreEqual $maxCount $certs.Length
}

<#
Expand All @@ -155,12 +155,12 @@ Tests querying for all certs under an account
#>
function Test-ListAllCertificates
{
param([string]$accountName, [string]$count)
param([string]$accountName, [string]$count)

$context = Get-AzureRmBatchAccountKeys -Name $accountName
$certs = Get-AzureBatchCertificate_ST -BatchContext $context
$context = Get-ScenarioTestContext $accountName
$certs = Get-AzureBatchCertificate -BatchContext $context

Assert-AreEqual $count $certs.Length
Assert-AreEqual $count $certs.Length
}

<#
Expand All @@ -169,21 +169,21 @@ Tests deleting a cert
#>
function Test-DeleteCertificate
{
param([string]$accountName, [string]$thumbprintAlgorithm, [string]$thumbprint)
param([string]$accountName, [string]$thumbprintAlgorithm, [string]$thumbprint)

$context = Get-AzureRmBatchAccountKeys -Name $accountName
$context = Get-ScenarioTestContext $accountName

# Verify the cert exists
$cert = Get-AzureBatchCertificate_ST $thumbprintAlgorithm $thumbprint -BatchContext $context
Assert-AreEqual $thumbprint $cert.Thumbprint
# Verify the cert exists
$cert = Get-AzureBatchCertificate $thumbprintAlgorithm $thumbprint -BatchContext $context
Assert-AreEqual $thumbprint $cert.Thumbprint

Get-AzureBatchCertificate_ST $thumbprintAlgorithm $thumbprint -BatchContext $context | Remove-AzureBatchCertificate_ST -Force -BatchContext $context
Get-AzureBatchCertificate $thumbprintAlgorithm $thumbprint -BatchContext $context | Remove-AzureBatchCertificate -Force -BatchContext $context

# Verify the cert was deleted. Use the List API since the Get Certificate API will return a 404 if the cert isn't found.
$filter = "state eq 'deleting'"
$cert = Get-AzureBatchCertificate_ST -Filter $filter -BatchContext $context
Assert-True { $cert -eq $null -or $cert.Thumbprint -eq $thumbprint }
# Verify the cert was deleted. Use the List API since the Get Certificate API will return a 404 if the cert isn't found.
$filter = "state eq 'deleting'"
$cert = Get-AzureBatchCertificate -Filter $filter -BatchContext $context
Assert-True { $cert -eq $null -or $cert.Thumbprint -eq $thumbprint }
}

<#
Expand All @@ -192,19 +192,19 @@ Tests canceling a cert deletion
#>
function Test-TestCancelCertificateDelete
{
param([string]$accountName, [string]$thumbprintAlgorithm, [string]$thumbprint)
param([string]$accountName, [string]$thumbprintAlgorithm, [string]$thumbprint)

$context = Get-AzureRmBatchAccountKeys -Name $accountName
$context = Get-ScenarioTestContext $accountName

# Verify the cert is in the deletefailed state
$cert = Get-AzureBatchCertificate_ST $thumbprintAlgorithm $thumbprint -BatchContext $context
Assert-AreEqual 'deletefailed' $cert.State.ToString().ToLower()
# Verify the cert is in the deletefailed state
$cert = Get-AzureBatchCertificate $thumbprintAlgorithm $thumbprint -BatchContext $context
Assert-AreEqual 'deletefailed' $cert.State.ToString().ToLower()

Get-AzureBatchCertificate_ST $thumbprintAlgorithm $thumbprint -BatchContext $context | Stop-AzureBatchCertificateDeletion_ST -BatchContext $context
Get-AzureBatchCertificate $thumbprintAlgorithm $thumbprint -BatchContext $context | Stop-AzureBatchCertificateDeletion -BatchContext $context

# Verify the cert went back to the active state
$filter = "state eq 'active'"
$cert = Get-AzureBatchCertificate_ST -Filter $filter -BatchContext $context
Assert-AreEqual $thumbprint $cert.Thumbprint
# Verify the cert went back to the active state
$filter = "state eq 'active'"
$cert = Get-AzureBatchCertificate -Filter $filter -BatchContext $context
Assert-AreEqual $thumbprint $cert.Thumbprint
}
Loading