From adf39ebfe5351fba20fea1217774536f1b138346 Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Mon, 27 Dec 2021 15:52:04 +0100 Subject: [PATCH 01/20] add Set-AzIntegrationAccountMaps.ps1 to project --- .../Arcus.Scripting.IntegrationAccount.pssproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.pssproj b/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.pssproj index 52fc8d7f..eadd31dc 100644 --- a/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.pssproj +++ b/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.pssproj @@ -32,6 +32,7 @@ + From ddf02efeda06b1397f218095759eb2c7390be5e2 Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Mon, 27 Dec 2021 16:29:19 +0100 Subject: [PATCH 02/20] add to project --- .../Arcus.Scripting.Tests.Unit.pssproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.Tests.Unit.pssproj b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.Tests.Unit.pssproj index f0850d95..204bc212 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.Tests.Unit.pssproj +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.Tests.Unit.pssproj @@ -77,6 +77,7 @@ + From 7832a2f0a1a5d9cfe982bf093d161e517e58f148 Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Mon, 27 Dec 2021 17:14:45 +0100 Subject: [PATCH 03/20] added Set-AzIntegrationAccountAssemblies and its unit tests --- .../Arcus.Scripting.IntegrationAccount.psd1 | Bin 7808 -> 7894 bytes .../Arcus.Scripting.IntegrationAccount.psm1 | 38 +++- ...Arcus.Scripting.IntegrationAccount.pssproj | 1 + .../Set-AzIntegrationAccountAssemblies.ps1 | 73 +++++++ ...cus.Scripting.IntegrationAccount.tests.ps1 | 196 +++++++++++++++++- 5 files changed, 306 insertions(+), 2 deletions(-) create mode 100644 src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountAssemblies.ps1 diff --git a/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.psd1 b/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.psd1 index 92ae79721db0470a3dcfeddeba4f7a8f76067dd7..c58724dd41ba29644149c0f636324012d970b9d5 100644 GIT binary patch delta 22 ecmZp$y=J>%k^rO5 +function Set-AzIntegrationAccountAssemblies { + param( + [Parameter(Mandatory = $true)][string] $ResourceGroupName = $(throw "Resource group name is required"), + [Parameter(Mandatory = $true)][string] $Name = $(throw "Name of the Integration Account is required"), + [parameter(Mandatory = $false)][string] $AssemblyFilePath = $(if ($AssembliesFolder -eq '') { throw "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" }), + [parameter(Mandatory = $false)][string] $AssembliesFolder = $(if ($AssemblyFilePath -eq '') { throw "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" }), + [Parameter(Mandatory = $false)][string] $ArtifactsPrefix = '' + ) + + . $PSScriptRoot\Scripts\Set-AzIntegrationAccountAssemblies.ps1 -ResourceGroupName $ResourceGroupName -Name $Name -AssemblyFilePath $AssemblyFilePath -AssembliesFolder $AssembliesFolder -ArtifactsPrefix $ArtifactsPrefix +} + +Export-ModuleMember -Function Set-AzIntegrationAccountAssemblies \ No newline at end of file diff --git a/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.pssproj b/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.pssproj index eadd31dc..a45db662 100644 --- a/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.pssproj +++ b/src/Arcus.Scripting.IntegrationAccount/Arcus.Scripting.IntegrationAccount.pssproj @@ -32,6 +32,7 @@ + diff --git a/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountAssemblies.ps1 b/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountAssemblies.ps1 new file mode 100644 index 00000000..994d84d8 --- /dev/null +++ b/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountAssemblies.ps1 @@ -0,0 +1,73 @@ +Param( + [Parameter(Mandatory = $true)][string] $ResourceGroupName = $(throw "Resource group name is required"), + [Parameter(Mandatory = $true)][string] $Name = $(throw "Name of the Integration Account is required"), + [parameter(Mandatory = $false)][string] $AssemblyFilePath = $(if ($AssembliesFolder -eq '') { throw "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" }), + [parameter(Mandatory = $false)][string] $AssembliesFolder = $(if ($AssemblyFilePath -eq '') { throw "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" }), + [Parameter(Mandatory = $false)][string] $ArtifactsPrefix = '' +) + +if ($AssemblyFilePath -ne '' -and $AssembliesFolder -ne '') { + throw "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" +} + +function UploadAssembly { + param + ( + [System.IO.FileInfo][parameter(Mandatory = $true)]$Assembly + ) + + $assemblyName = $Assembly.BaseName + if ($ArtifactsPrefix -ne '') { + $assemblyName = $ArtifactsPrefix + $assemblyName + } + Write-Host "Uploading assembly '$assemblyName' into the Integration Account '$Name'." + + $existingAssembly = $null + try { + Write-Verbose "Checking if the assembly '$assemblyName' already exists in the Integration Account '$Name'." + $existingAssembly = Get-AzIntegrationAccountAssembly -ResourceGroupName $ResourceGroupName -IntegrationAccount $Name -Name $assemblyName -ErrorAction Stop + } + catch { + if ($_.Exception.Message.Contains('could not be found')) { + Write-Verbose "No assembly '$assemblyName' could not be found in Azure Integration Account '$Name'." + } + else { + throw $_.Exception + } + } + + try { + if ($existingAssembly -eq $null) { + Write-Verbose "Creating assembly '$assemblyName' in Azure Integration Account '$Name'" + $createdAssembly = New-AzIntegrationAccountAssembly -ResourceGroupName $ResourceGroupName -IntegrationAccount $Name -Name $assemblyName -AssemblyFilePath $Assembly.FullName -ErrorAction Stop + Write-Verbose ($createdAssembly | Format-List -Force | Out-String) + } + else { + Write-Verbose "Updating assembly '$assemblyName' in Azure Integration Account '$Name'" + $updatedAssembly = Set-AzIntegrationAccountAssembly -ResourceGroupName $ResourceGroupName -IntegrationAccount $Name -Name $assemblyName -AssemblyFilePath $Assembly.FullName -ErrorAction Stop + Write-Verbose ($updatedAssembly | Format-List -Force | Out-String) + } + Write-Host "Assembly '$assemblyName' has been uploaded into the Azure Integration Account '$Name'." + } + catch { + Write-Error "Failed to upload assembly '$assemblyName' in Azure Integration Account '$Name': '$($_.Exception.Message)_'" + } +} + +# Verify if Integration Account can be found based on the given information +$integrationAccount = Get-AzIntegrationAccount -ResourceGroupName $ResourceGroupName -Name $Name -ErrorAction SilentlyContinue +if ($integrationAccount -eq $null) { + Write-Error "Unable to find the Azure Integration Account with name '$Name' in resource group '$ResourceGroupName'" +} +else { + if ($AssembliesFolder -ne '' -and $AssemblyFilePath -eq '') { + foreach ($assembly in Get-ChildItem($AssembliesFolder) -File) { + UploadAssembly -Assembly $assembly + Write-Host '----------' + } + } + elseif ($AssembliesFolder -eq '' -and $AssemblyFilePath -ne '') { + [System.IO.FileInfo]$assembly = New-Object System.IO.FileInfo($AssemblyFilePath) + UploadAssembly -Assembly $assembly + } +} \ No newline at end of file diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 index 0f211f06..9f08b47f 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -1,4 +1,6 @@ -Describe "Arcus" { +Import-Module -Name $PSScriptRoot\..\Arcus.Scripting.IntegrationAccount -ErrorAction Stop + +Describe "Arcus" { InModuleScope Arcus.Scripting.IntegrationAccount { Context "Azure Integration Account Schemas" { It "Providing both schemaFilePath and schemasFolder should fail" { @@ -384,5 +386,197 @@ Assert-MockCalled New-AzIntegrationAccountMap -Times 0 } } + Context "Azure Integration Account Assemblies" { + It "Providing both assemblyFilePath and assembliesFolder should fail" { + # Arrange + $resourceGroupName = "rg-infrastructure" + $integrationAccountName = "unexisting-integration-account" + $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\LibraryThatDoesSomething.dll" + $assembliesFolder = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\" + + # Act + { + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath -AssembliesFolder $assembliesFolder -ErrorAction Stop + } | Should -Throw -ExpectedMessage "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" + + # Assert + Assert-VerifiableMock + } + It "Providing neither a assemblyFilePath and assembliesFolder should fail" { + # Arrange + $resourceGroupName = "rg-infrastructure" + $integrationAccountName = "unexisting-integration-account" + + # Act + { + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -ErrorAction Stop + } | Should -Throw -ExpectedMessage "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" + + # Assert + Assert-VerifiableMock + } + It "Providing only the assemblyFilePath to create an assembly is OK" { + # Arrange + $subscriptionId = [guid]::NewGuid() + $resourceGroupName = "rg-infrastructure" + $integrationAccountName = "unexisting-integration-account" + $integrationAccountResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName" + $assemblyName = 'Dummy_New_Assembly' + $assemblyResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName/assemblies/$assemblyName" + $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\$assemblyName.dll" + + Mock Get-AzIntegrationAccount { + return [pscustomobject]@{ Id = $integrationAccountResourceId; Name = $integrationAccountName; Type = 'Microsoft.Logic/integrationAccounts'; Location = 'westeurope'; Sku = 'Free' } + } -Verifiable + + Mock Get-AzIntegrationAccountAssembly { + return $null + } -Verifiable + + Mock Set-AzIntegrationAccountAssembly { + return $null + } + + Mock New-AzIntegrationAccountAssembly { + return [pscustomobject]@{ Id = $assemblyResourceId; Name = $assemblyName; Type = 'Microsoft.Logic/integrationAccounts/assemblies'; CreatedTime = [datetime]::UtcNow; ChangedTime = [datetime]::UtcNow } + } + + # Act + { + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath -ErrorAction Stop + } | Should -Not -Throw + + # Assert + Assert-VerifiableMock + Assert-MockCalled Get-AzIntegrationAccount -Times 1 + Assert-MockCalled Get-AzIntegrationAccountAssembly -Times 1 + Assert-MockCalled Set-AzIntegrationAccountAssembly -Times 0 + Assert-MockCalled New-AzIntegrationAccountAssembly -Times 1 + } + It "Providing only the assemblyFilePath to update an assembly is OK" { + # Arrange + $subscriptionId = [guid]::NewGuid() + $resourceGroupName = "rg-infrastructure" + $integrationAccountName = "unexisting-integration-account" + $integrationAccountResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName" + $assemblyName = 'Dummy_Existing_Assembly' + $assemblyResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName/assemblies/$assemblyName" + $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\$assemblyName.xslt" + + Mock Get-AzIntegrationAccount { + return [pscustomobject]@{ Id = $integrationAccountResourceId; Name = $integrationAccountName; Type = 'Microsoft.Logic/integrationAccounts'; Location = 'westeurope'; Sku = 'Free' } + } -Verifiable + + Mock Get-AzIntegrationAccountAssembly { + return [pscustomobject]@{ Id = $assemblyResourceId; Name = $assemblyName; Type = 'Microsoft.Logic/integrationAccounts/assemblies'; CreatedTime = [datetime]::UtcNow; ChangedTime = [datetime]::UtcNow } + } -Verifiable + + Mock Set-AzIntegrationAccountAssembly { + return [pscustomobject]@{ Id = $assemblyResourceId; Name = $assemblyName; Type = 'Microsoft.Logic/integrationAccounts/assemblies'; CreatedTime = [datetime]::UtcNow; ChangedTime = [datetime]::UtcNow } + } + + Mock New-AzIntegrationAccountAssembly { + return $null + } + + # Act + { + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath -ErrorAction Stop + } | Should -Not -Throw + + # Assert + Assert-VerifiableMock + Assert-MockCalled Get-AzIntegrationAccount -Times 1 + Assert-MockCalled Get-AzIntegrationAccountAssembly -Times 1 + Assert-MockCalled Set-AzIntegrationAccountAssembly -Times 1 + Assert-MockCalled New-AzIntegrationAccountAssembly -Times 0 + } + It "Providing only a assembliesFolder to create assemblies is OK" { + # Arrange + $subscriptionId = [guid]::NewGuid() + $resourceGroupName = "rg-infrastructure" + $integrationAccountName = "unexisting-integration-account" + $integrationAccountResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName" + $assembliesFolder = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\" + + Mock Get-ChildItem { + return @( + new-item -name "assembly1.dll" -type file -fo + new-item -name "assembly2.dll" -type file -fo + ) + } + + Mock Get-AzIntegrationAccount { + return [pscustomobject]@{ Id = $integrationAccountResourceId; Name = $integrationAccountName; Type = 'Microsoft.Logic/integrationAccounts'; Location = 'westeurope'; Sku = 'Free' } + } -Verifiable + + Mock Get-AzIntegrationAccountAssembly { + return $null + } -Verifiable + + Mock Set-AzIntegrationAccountAssembly { + return $null + } + + Mock New-AzIntegrationAccountAssembly { + return [pscustomobject]@{ Id = 'fake-resource-id'; Name = 'Dummy.dll'; Type = 'Microsoft.Logic/integrationAccounts/assemblies'; CreatedTime = [datetime]::UtcNow; ChangedTime = [datetime]::UtcNow } + } + + # Act + { + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ErrorAction Stop + } | Should -Not -Throw + + # Assert + Assert-VerifiableMock + Assert-MockCalled Get-AzIntegrationAccount -Times 1 + Assert-MockCalled Get-AzIntegrationAccountAssembly -Times 2 + Assert-MockCalled Set-AzIntegrationAccountAssembly -Times 0 + Assert-MockCalled New-AzIntegrationAccountAssembly -Times 2 + } + It "Providing only a assembliesFolder to update assemblies is OK" { + # Arrange + $subscriptionId = [guid]::NewGuid() + $resourceGroupName = "rg-infrastructure" + $integrationAccountName = "unexisting-integration-account" + $integrationAccountResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName" + $assembliesFolder = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\" + + Mock Get-ChildItem { + return @( + new-item -name "assembly1.dll" -type file -fo + new-item -name "assembly2.dll" -type file -fo + ) + } + + Mock Get-AzIntegrationAccount { + return [pscustomobject]@{ Id = $integrationAccountResourceId; Name = $integrationAccountName; Type = 'Microsoft.Logic/integrationAccounts'; Location = 'westeurope'; Sku = 'Free' } + } -Verifiable + + Mock Get-AzIntegrationAccountAssembly { + return [pscustomobject]@{ Id = 'fake-resource-id'; Name = 'Dummy.dll'; Type = 'Microsoft.Logic/integrationAccounts/assemblies'; CreatedTime = [datetime]::UtcNow; ChangedTime = [datetime]::UtcNow } + } -Verifiable + + Mock Set-AzIntegrationAccountAssembly { + return [pscustomobject]@{ Id = 'fake-resource-id'; Name = 'Dummy.dll'; Type = 'Microsoft.Logic/integrationAccounts/assemblies'; CreatedTime = [datetime]::UtcNow; ChangedTime = [datetime]::UtcNow } + } + + Mock New-AzIntegrationAccountAssembly { + return $null + } + + # Act + { + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ErrorAction Stop + } | Should -Not -Throw + + # Assert + Assert-VerifiableMock + Assert-MockCalled Get-AzIntegrationAccount -Times 1 + Assert-MockCalled Get-AzIntegrationAccountAssembly -Times 2 + Assert-MockCalled Set-AzIntegrationAccountAssembly -Times 2 + Assert-MockCalled New-AzIntegrationAccountAssembly -Times 0 + } + } } } From a64460b23f8b3354960525f51d37a3fc89e012e3 Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Wed, 29 Dec 2021 09:58:54 +0100 Subject: [PATCH 04/20] added integration tests --- ...cus.Scripting.IntegrationAccount.tests.ps1 | 145 ++++++++++++++++++ .../Arcus.Scripting.Tests.Integration.pssproj | 3 + .../Assemblies/AssemblyThatDoesSomething.dll | Bin 0 -> 4608 bytes .../AssemblyThatDoesSomethingElse.dll | Bin 0 -> 4608 bytes 4 files changed, 148 insertions(+) create mode 100644 src/Arcus.Scripting.Tests.Integration/Files/IntegrationAccount/Assemblies/AssemblyThatDoesSomething.dll create mode 100644 src/Arcus.Scripting.Tests.Integration/Files/IntegrationAccount/Assemblies/AssemblyThatDoesSomethingElse.dll diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 18067584..196015ee 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -406,5 +406,150 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } } + Context "Handling Assemblies" { + It "Try to upload single assembly to unexisting Integration Account" { + # Arrange + $resourceGroupName = $config.Arcus.ResourceGroupName + $integrationAccountName = "unexisting-integration-account" + $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\AssemblyThatDoesSomething.dll" + $assembly = Get-ChildItem($assemblyFilePath) -File + + # Act + { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ErrorAction Stop} | + Should -Throw + } + It "Create a single assembly in an Integration Account" { + # Arrange + $resourceGroupName = $config.Arcus.ResourceGroupName + $integrationAccountName = $config.Arcus.IntegrationAccount.Name + $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\AssemblyThatDoesSomething.dll" + $assembly = Get-ChildItem($assemblyFilePath) -File + $expectedAssemblyName = $assembly.BaseName + $executionDateTime = (Get-Date).ToUniversalTime() + + try { + # Act + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName + + # Assert + $actual = Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + $actual | Should -Not -BeNullOrEmpty + $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss") | Should -BeIn @($actual.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss"), $actual.Properties.ChangedTime.ToUniversalTime().AddSeconds(-1).ToString("yyyy-MM-ddTHH:mm:ss")) + $actual.Properties.CreatedTime | Should -BeGreaterOrEqual $executionDateTime + + } finally { + Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + } + } + It "Update a single assembly in an Integration Account" { + # Arrange + $resourceGroupName = $config.Arcus.ResourceGroupName + $integrationAccountName = $config.Arcus.IntegrationAccount.Name + $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\AssemblyThatDoesSomething.dll" + $assembly = Get-ChildItem($assemblyFilePath) -File + $expectedAssemblyName = $assembly.BaseName + $executionDateTime = (Get-Date).ToUniversalTime() + + $existingAssembly = New-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName -AssemblyFilePath $assembly.FullName + + try { + # Act + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName + + # Assert + $actual = Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + $actual | Should -Not -BeNullOrEmpty + $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss") | Should -BeIn ($existingAssembly.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss"), $existingAssembly.Properties.ChangedTime.ToUniversalTime().AddSeconds(-1).ToString("yyyy-MM-ddTHH:mm:ss")) + $actual.Properties.ChangedTime.ToUniversalTime() | Should -BeGreaterOrEqual $executionDateTime + $existingAssembly.Properties.CreatedTime.ToUniversalTime() | Should -BeLessOrEqual $actual.Properties.ChangedTime.ToUniversalTime() + + } finally { + Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + } + } + It "Create a single assembly, with prefix, in an Integration Account" { + # Arrange + $resourceGroupName = $config.Arcus.ResourceGroupName + $integrationAccountName = $config.Arcus.IntegrationAccount.Name + $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\AssemblyThatDoesSomething.dll" + $assembly = Get-ChildItem($assemblyFilePath) -File + $artifactsPrefix = "dev-" + $expectedAssemblyName = $artifactsPrefix + $assembly.BaseName + $executionDateTime = (Get-Date).ToUniversalTime() + + try { + # Act + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ArtifactsPrefix $artifactsPrefix + + # Assert + $actual = Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + $actual | Should -Not -BeNullOrEmpty + $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss") | Should -BeIn ($actual.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss"), $actual.Properties.ChangedTime.ToUniversalTime().AddSeconds(-1).ToString("yyyy-MM-ddTHH:mm:ss")) + $actual.Properties.CreatedTime | Should -BeGreaterOrEqual $executionDateTime + + } finally { + Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + } + } + It "Create multiple assemblies located in a folder in an Integration Account" { + # Arrange + $resourceGroupName = $config.Arcus.ResourceGroupName + $integrationAccountName = $config.Arcus.IntegrationAccount.Name + $assembliesFolder = "$PSScriptRoot\Files\IntegrationAccount\Assemblies" + $executionDateTime = (Get-Date).ToUniversalTime() + + try { + # Act + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder + + # Assert + foreach ($assembly in Get-ChildItem($assembliesFolder) -File) { + $expectedAssemblyName = $assembly.BaseName + + $actual = Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + $actual | Should -Not -BeNullOrEmpty + $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss") | Should -BeIn ($actual.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss"), $actual.Properties.ChangedTime.ToUniversalTime().AddSeconds(-1).ToString("yyyy-MM-ddTHH:mm:ss")) + $actual.Properties.CreatedTime | Should -BeGreaterOrEqual $executionDateTime + } + + } finally { + foreach ($assembly in Get-ChildItem($assembliesFolder) -File) { + $expectedAssemblyName = $assembly.BaseName + + Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + } + } + } + It "Create multiple assemblies, with prefix, located in a folder in an Integration Account" { + # Arrange + $resourceGroupName = $config.Arcus.ResourceGroupName + $integrationAccountName = $config.Arcus.IntegrationAccount.Name + $assembliesFolder = "$PSScriptRoot\Files\IntegrationAccount\Assemblies" + $artifactsPrefix = "dev-" + $executionDateTime = (Get-Date).ToUniversalTime() + + try { + # Act + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ArtifactsPrefix $artifactsPrefix + + # Assert + foreach ($assembly in Get-ChildItem($assembliesFolder) -File) { + $expectedAssemblyName = $artifactsPrefix + $assembly.BaseName + + $actual = Get-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + $actual | Should -Not -BeNullOrEmpty + $actual.Properties.CreatedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss") | Should -BeIn ($actual.Properties.ChangedTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss"), $actual.Properties.ChangedTime.ToUniversalTime().AddSeconds(-1).ToString("yyyy-MM-ddTHH:mm:ss")) + $actual.Properties.CreatedTime | Should -BeGreaterOrEqual $executionDateTime + } + + } finally { + foreach ($assembly in Get-ChildItem($assembliesFolder) -File) { + $expectedAssemblyName = $artifactsPrefix + $assembly.BaseName + + Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName + } + } + } + } } } \ No newline at end of file diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Tests.Integration.pssproj b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Tests.Integration.pssproj index 96eaf304..f9b5a2b7 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Tests.Integration.pssproj +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Tests.Integration.pssproj @@ -51,6 +51,7 @@ + @@ -84,6 +85,8 @@ + + diff --git a/src/Arcus.Scripting.Tests.Integration/Files/IntegrationAccount/Assemblies/AssemblyThatDoesSomething.dll b/src/Arcus.Scripting.Tests.Integration/Files/IntegrationAccount/Assemblies/AssemblyThatDoesSomething.dll new file mode 100644 index 0000000000000000000000000000000000000000..87dcb75bc6ebac65ec141fa4fbe7fb2a40520dc8 GIT binary patch literal 4608 zcmeHKPiz!r6n|g4t))Pvu@Vr$!D7T{Cfl@4#D8qtZLv_=(p^x|gwAfi?hek*Y-VN) z>p^RxL=6YMc+#LJIcS2B18FqjU_41;VoW%4Fvgn)FUEuQ_ukBOx2=!}c#!b6`}@B4 z=X>9K@0)$!^ziZbsg;OQ_%1IKUBbwe5xg-hLf!SyQWss^aAo%;HF0HkzHA3Z)%Qxi zRWXW|>w2M4(1u@g4cj%cQ#qsJ&1rM<=FUB_>*-OV36-LQJ9hq%>~@VFHa4m>Q9C3Z zk@O7gBq&4pEyQC>6gNvaexXl*G1E%3Zxd~izs4A|ku?p#?-b8xiN5AStffVwO^|Ja z-Ggg&H{vrZp^H@q_~)DK&B}s32OiN;l1mbIVwNEqHbZ?ngy3u&00OBA*QJRJL~r_m zUxZ9@n8k!^z=1bW1|CdbJ01*0wFo6@7zKebrVRE?=6AUl`|;j^FF%+#_xa?- zvsbTucxPvOH@meJD5I}2ac^p&Hp*v+zD4g)EW8Qo?0Joba|ef2?1B5t!ho4J`_uh> z``BR{IY0*+^uA7X72_uKpx#{Q+iodfi=WYlxqbB>&C#!zbC2vjaCAJ2@elCdGe7Kj z1&mBst`77NZD8h4)lXZa_%}y7iDV<@{N=o&+}={r*iPTkkE)&e6{A6y)xGpPRPD4Z z@2b;f`{_O4({vs< zLSF$7(Pdyx7_K{^VY$#^*y!N$Q z)QLqyl}OmP<<=XDxHKXU?Sk#tVUu>kF8G#T&zG$*>**lpRdiU!uV77K%{WEYTyKdv z=Q#1QmDPIQ(M2v2nZ?la6M5FQO0E}#b}>jqahPUQ8|~+`zhD=25FaTv#*u@aDx8GJ zOnIH+iwIXRji@q9g0tv(T#;@O2kGYv0YJuA;p)()zURiDHoMLV(T zdX*yTRMaNVDq0UV>qB?KCz1=3Bp8qKj@Bf5CGMFlTHtwxXX`2Ht&!#gQph^aVas-@ z5)_e-mP2Fh@+0uEcANDM|8oiVE4=FxEw0`w>gFiXIyu|%-SOfqUP95E6Pj%u!1Ne; z%?aQr&0sc;-ZTk*95@!eb<;Pg-~MXu%1J-kA3NfE0R4Rx@jam6)gm8$Y}_XrK3$q8 zPwe){?U9Gpf;52Mq7Zf-xQH&KF2kupOd+gn$V>m==_9d8Q}P+00_KEVwqxxG{8gwb zd(@GU1x}0m33x2X?mpGgiOaHo7WNv^O zsg?YW!MBe%8ujSIoseGnax6Px&lL^D)0W(GjWv8$w~;c@|AOxf-bSByUHxw=@HgDB1pNR2 literal 0 HcmV?d00001 diff --git a/src/Arcus.Scripting.Tests.Integration/Files/IntegrationAccount/Assemblies/AssemblyThatDoesSomethingElse.dll b/src/Arcus.Scripting.Tests.Integration/Files/IntegrationAccount/Assemblies/AssemblyThatDoesSomethingElse.dll new file mode 100644 index 0000000000000000000000000000000000000000..33c07b3c71473a3e3193f72ee8543423f9abcbe9 GIT binary patch literal 4608 zcmeHKPiP!v6n|f`iD}x#1Y@aK>%>%4lwm^}v})}pyGc#Wzh<}9R-u{QeA%5kJG0Ep zrd?YArYQ2=c&Ajh> zf9Cz2dEaFEiguiEzDvCQKo1z(Rhp<1oUVxb z4)i1_L+D=OwJnO9IUK*hhrlt>P77}k^~zs!jmb!xGO#<#`vsz(xDXp*g=hzO`=GaH zqiicWvlhB&b%B1iMc=G0+l!zP9VNLWaVKgSqA@enXG1XF?*IZrYQlAC0Rz#Se&CnD zlN=VX;Tmw@Es%i))7Op%MG>t)h#E#gV2vRIzsdggdTUqUrLWuO&ZV+PKKiBoy|1qR z-ng~1y`A003WS(z3_P3KsDla_qAQpkikUY6-Tkl7SpLYEiY@S*S>A7^&EfR$&;d5s zK@PA32ZOH?eT%gpGiWd$`nFpRSmRgBVIE(D$MW4 z|8cbne2EypF8Bk%?ZQ7Q`|h@n#bk73aRn4&S7gwL?B_CYPH*nM2pbB~UPJ_az@2mt za5p_7`yt?7Iv{vd@TB0Qf=>vx1e?fcFPU@~Jp_C&O#lz#G&AW@DgY1DTfk4zC%{?y z4EQ-@U{YTAF9N4ll4>9@0Rxzings4fglmv>tRNVor>DKex}%?=d?N^T)ts-ppW!NI(jrjtBdte(`XRrYSC#F?68$xu>7(P zC-4oS&v^dJoAoDbM<3UIV0-Rn;iS9d`Bf`~&~pA&E9<#ScDe40Ueid{tJZ8snDg4P z&dM%m%9Duae3YORHU;x~N&DI@=|rO`N;quWavM!STsPr|cF}h1utmDQxMrLQ%DH8o z%|*wF`?A&^z2xW;*MrPb==ljhXIo|03qrdTB&;|hGb)4j^V(mwOFD?V2j^%#$l2m) zSWKRaO=n2TP^zolAk~3QUmue_U8{#qz1H_l_mf>J{-)c@??<6+*YmzroAKQ7vn5^Q zC<_(eI}<4A-65}2it&h|-R8`AA?x{iv{rj8F2}*;5i<=dJ^gEsOU@2zj@6jK(?bJ_ z_H6l7Qn#WGc{K4!1cyVIRQQqbg-DW&SNUFR;Z@@K$*gm{&+u+DBy%>BoI)Bo$CIBZW@5lBy zX3Z(!ahk_&60>Or^d#^^^wmvYq^|zeI+c@obSO52aW9{!iCtcExD>2f9vcH%K-Gb!lCH8$j52P_(o$fX%Tk#Yk=rsbXn09 z?3cwlSGR`had*n76b~B%*J+7mHs*8ZIF_VdOhsL|88JnDo`WwBk=Ch%C~j7t)A+tn zwBGi{PBi;K^n~ Date: Wed, 29 Dec 2021 10:12:21 +0100 Subject: [PATCH 05/20] added documentation --- .../powershell/azure-integration-account.md | 51 ++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/docs/preview/02-Features/powershell/azure-integration-account.md b/docs/preview/02-Features/powershell/azure-integration-account.md index 1777b0ca..18360171 100644 --- a/docs/preview/02-Features/powershell/azure-integration-account.md +++ b/docs/preview/02-Features/powershell/azure-integration-account.md @@ -74,7 +74,7 @@ PS> Set-AzIntegrationAccountSchemas -ResourceGroupName 'my-resource-group' -Name # ---------- ``` -Uploading *all schemas* located in a specific folder into an Integration Account and remove the file-extension. +Uploading *all schemas* located in a specific folder into an Integration Account and set add a prefix to the name of the schemas. ```powershell PS> Set-AzIntegrationAccountSchemas -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -SchemasFolder "C:\Schemas" -ArtifactsPrefix 'dev-' # Uploading schema 'dev-MyFirstSchema.xsd' into the Azure Integration Account 'my-integration-account'. @@ -144,7 +144,7 @@ PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'm # ---------- ``` -Uploading *all maps* located in a specific folder into an Integration Account and remove the file-extension. +Uploading *all maps* located in a specific folder into an Integration Account and set add a prefix to the name of the maps. ```powershell PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -MapsFolder "C:\Maps" -ArtifactsPrefix 'dev-' # Uploading map 'dev-MyFirstMap.xslt' into the Azure Integration Account 'my-integration-account'. @@ -155,5 +155,52 @@ PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'm # ---------- ``` +## Uploading assemblies into an Azure Integration Account + +Upload/update a single, or multiple assemblies into an Azure Integration Account. + +| Parameter | Mandatory | Description | +| ---------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `ResourceGroupName` | yes | The name of the Azure resource group where the Azure Integration Account is located. | +| `Name` | yes | The name of the Azure Integration Account into which the maps are to be uploaded/updated. | +| `AssemblyFilePath` | conditional | The full path of an assembly that should be uploaded/updated. (_Mandatory if AssembliesFolder has not been specified_). | +| `AssembliesFolder` | conditional | The path to a directory containing all assemblies that should be uploaded/updated. (_Mandatory if AssemblyFilePath has not been specified_). | +| `ArtifactsPrefix` | no | The prefix, if any, that should be added to the assemblies before uploading/updating. | + +**Example** + +Uploading a *single assembly* into an Integration Account. +```powershell +PS> Set-AzIntegrationAccountAssemblies -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -AssemblyFilePath "C:\Assemblies\MyAssembly.dll" +# Uploading assembly 'MyAssembly.dll' into the Azure Integration Account 'my-integration-account'. +# Assembly 'MyAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +``` + +Uploading a *single assembly* into an Integration Account and set add a prefix to the name of the assembly within the Integration Account. +```powershell +PS> Set-AzIntegrationAccountAssemblies -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -AssemblyFilePath "C:\Assemblies\MyAssembly.dll" -ArtifactsPrefix 'dev-' +# Uploading assembly 'dev-MyAssembly.dll' into the Azure Integration Account 'my-integration-account'. +# Assembly 'dev-MyAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +``` +Uploading *all assemblies* located in a specific folder into an Integration Account. +```powershell +PS> Set-AzIntegrationAccountAssemblies -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -AssembliesFolder "C:\Assemblies" +# Uploading assembly 'MyFirstAssembly.dll' into the Azure Integration Account 'my-integration-account'. +# Assembly 'MyFirstAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# ---------- +# Uploading assembly 'MySecondAssembly.dll' into the Azure Integration Account 'my-integration-account'. +# Assembly 'MySecondAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# ---------- +``` +Uploading *all assemblies* located in a specific folder into an Integration Account and set add a prefix to the name of the assemblies. +```powershell +PS> Set-AzIntegrationAccountAssemblies -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -AssembliesFolder "C:\Assemblies" -ArtifactsPrefix 'dev-' +# Uploading assembly 'dev-MyFirstAssembly.dll' into the Azure Integration Account 'my-integration-account'. +# Assembly 'dev-MyFirstAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# ---------- +# Uploading assembly 'dev-MySecondAssembly.dll' into the Azure Integration Account 'my-integration-account'. +# Assembly 'dev-MySecondAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# ---------- +``` From f15676623166d5f6bb2d56ea3ee5ffe778d9a996 Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:02:42 +0100 Subject: [PATCH 06/20] Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 196015ee..7162613c 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -407,7 +407,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } Context "Handling Assemblies" { - It "Try to upload single assembly to unexisting Integration Account" { + It "Try to upload single assembly to unexisting Integration Account fails" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = "unexisting-integration-account" From e670b7306fbac9a7881b399f642572ce5714ca9a Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:02:49 +0100 Subject: [PATCH 07/20] Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 7162613c..356a8895 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -418,7 +418,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { { Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assembly.FullName -ErrorAction Stop} | Should -Throw } - It "Create a single assembly in an Integration Account" { + It "Create a single assembly in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name From 7420c78179dab7d7c1b859be6d34243369d7061d Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:02:58 +0100 Subject: [PATCH 08/20] Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 356a8895..71ac1af1 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -441,7 +441,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName } } - It "Update a single assembly in an Integration Account" { + It "Update a single assembly in an existing Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name From 9ce6c7ad513e5158481250f162369391345ca6ec Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:03:06 +0100 Subject: [PATCH 09/20] Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 71ac1af1..435b17ed 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -467,7 +467,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName } } - It "Create a single assembly, with prefix, in an Integration Account" { + It "Create a single assembly, with prefix, in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name From 5c1d883dfef9b110e0b3d5a998ff7f1d91db2c22 Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:03:12 +0100 Subject: [PATCH 10/20] Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 435b17ed..8516bcdd 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -491,7 +491,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName } } - It "Create multiple assemblies located in a folder in an Integration Account" { + It "Create multiple assemblies located in a folder in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name From 462243b68154ba1d0a8ffac96abb22a9f490b392 Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:03:18 +0100 Subject: [PATCH 11/20] Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 8516bcdd..19a85042 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -520,7 +520,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } } - It "Create multiple assemblies, with prefix, located in a folder in an Integration Account" { + It "Create multiple assemblies, with prefix, located in a folder in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name From 2f0493d1c2408e87b2b665e9fbfdfbbfa2149ae9 Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:03:27 +0100 Subject: [PATCH 12/20] Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 index 9f08b47f..01b5b3af 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -1,7 +1,7 @@ Import-Module -Name $PSScriptRoot\..\Arcus.Scripting.IntegrationAccount -ErrorAction Stop -Describe "Arcus" { - InModuleScope Arcus.Scripting.IntegrationAccount { +InModuleScope Arcus.Scripting.IntegrationAccount { + Describe "Arcus" { Context "Azure Integration Account Schemas" { It "Providing both schemaFilePath and schemasFolder should fail" { # Arrange From 30d8d95b2324f57a8b0491802afc1d6823aa6ef1 Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:03:39 +0100 Subject: [PATCH 13/20] Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 index 01b5b3af..8f932a13 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -421,7 +421,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $resourceGroupName = "rg-infrastructure" $integrationAccountName = "unexisting-integration-account" $integrationAccountResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName" - $assemblyName = 'Dummy_New_Assembly' + $assemblyName = 'Dummy_New_Assembly' $assemblyResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName/assemblies/$assemblyName" $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\$assemblyName.dll" From 0216dd7903924779f65382fba152828281c51ec9 Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:03:43 +0100 Subject: [PATCH 14/20] Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 index 8f932a13..7b67dcfe 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -423,7 +423,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { $integrationAccountResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName" $assemblyName = 'Dummy_New_Assembly' $assemblyResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Logic/integrationAccounts/$integrationAccountName/assemblies/$assemblyName" - $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\$assemblyName.dll" + $assemblyFilePath = "$PSScriptRoot\Files\IntegrationAccount\Assemblies\$assemblyName.dll" Mock Get-AzIntegrationAccount { return [pscustomobject]@{ Id = $integrationAccountResourceId; Name = $integrationAccountName; Type = 'Microsoft.Logic/integrationAccounts'; Location = 'westeurope'; Sku = 'Free' } From adb421d179dfc87dc6237854ad6c8234d7e7ca98 Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:03:56 +0100 Subject: [PATCH 15/20] Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 index 7b67dcfe..5541b09e 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -544,8 +544,8 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Mock Get-ChildItem { return @( - new-item -name "assembly1.dll" -type file -fo - new-item -name "assembly2.dll" -type file -fo + New-Item -Name "assembly1.dll" -Type File -fo + New-Item -Name "assembly2.dll" -Type File -fo ) } From 942f4df3884088eb641a06b852676c1aef359eba Mon Sep 17 00:00:00 2001 From: Pim Simons <32359437+pim-simons@users.noreply.github.com> Date: Wed, 29 Dec 2021 12:04:06 +0100 Subject: [PATCH 16/20] Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 Co-authored-by: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 index 5541b09e..205252bc 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -501,8 +501,8 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Mock Get-ChildItem { return @( - new-item -name "assembly1.dll" -type file -fo - new-item -name "assembly2.dll" -type file -fo + New-Item -Name "assembly1.dll" -Type File -fo + New-Item -Name "assembly2.dll" -Type File -fo ) } From 1698aeb3bdaa332f222aaeeabfede53e1da7d062 Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Wed, 29 Dec 2021 12:06:47 +0100 Subject: [PATCH 17/20] keep naming of tests consistent --- ...cus.Scripting.IntegrationAccount.tests.ps1 | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 19a85042..450de092 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -13,7 +13,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Connect-AzAccount -Credential $pscredential -TenantId $config.Arcus.TenantId -ServicePrincipal } Context "Handling Schemas" { - It "Try to upload single schema to unexisting Integration Account" { + It "Try to upload single schema to unexisting Integration Account fails" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = "unexisting-integration-account" @@ -24,7 +24,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { { Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schema.FullName -ErrorAction Stop } | Should -Throw } - It "Create a single schema in an Integration Account" { + It "Create a single schema in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -47,7 +47,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force } } - It "Update a single schema in an Integration Account" { + It "Update a single schema in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -73,7 +73,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force } } - It "Create a single schema, without extension, in an Integration Account" { + It "Create a single schema, without extension, in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -96,7 +96,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force } } - It "Create a single schema, without extension and with prefix, in an Integration Account" { + It "Create a single schema, without extension and with prefix, in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -120,7 +120,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountSchema -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaName $expectedSchemaName -Force } } - It "Create multiple schemas located in a folder in an Integration Account" { + It "Create multiple schemas located in a folder in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -149,7 +149,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } } - It "Create multiple schemas, without extension, located in a folder in an Integration Account" { + It "Create multiple schemas, without extension, located in a folder in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -178,7 +178,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } } - It "Create multiple schemas, without extension and with prefix, located in a folder in an Integration Account" { + It "Create multiple schemas, without extension and with prefix, located in a folder in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -210,7 +210,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } Context "Handling Maps" { - It "Try to upload single map to unexisting Integration Account" { + It "Try to upload single map to unexisting Integration Account fails" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = "unexisting-integration-account" @@ -221,7 +221,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { { Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $map.FullName -ErrorAction Stop} | Should -Throw } - It "Create a single map in an Integration Account" { + It "Create a single map in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -244,7 +244,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force } } - It "Update a single map in an Integration Account" { + It "Update a single map in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -270,7 +270,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force } } - It "Create a single map, without extension, in an Integration Account" { + It "Create a single map, without extension, in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -293,7 +293,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force } } - It "Create a single map, without extension and with prefix, in an Integration Account" { + It "Create a single map, without extension and with prefix, in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -317,7 +317,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountMap -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapName $expectedMapName -Force } } - It "Create multiple maps located in a folder in an Integration Account" { + It "Create multiple maps located in a folder in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -346,7 +346,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } } - It "Create multiple maps, without extension, located in a folder in an Integration Account" { + It "Create multiple maps, without extension, located in a folder in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -375,7 +375,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } } - It "Create multiple maps, without extension and with prefix, located in a folder in an Integration Account" { + It "Create multiple maps, without extension and with prefix, located in a folder in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name @@ -441,7 +441,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Remove-AzIntegrationAccountAssembly -ResourceGroupName $resourceGroupName -IntegrationAccountName $integrationAccountName -AssemblyName $expectedAssemblyName } } - It "Update a single assembly in an existing Integration Account succeeds" { + It "Update a single assembly in an Integration Account succeeds" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName $integrationAccountName = $config.Arcus.IntegrationAccount.Name From f4395d3f6252a5f1c59f987cd33250d68d112d27 Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Wed, 29 Dec 2021 12:07:59 +0100 Subject: [PATCH 18/20] descriptive names for context --- .../Arcus.Scripting.IntegrationAccount.tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 index 450de092..4167dac4 100644 --- a/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -12,7 +12,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { Disable-AzContextAutosave -Scope Process Connect-AzAccount -Credential $pscredential -TenantId $config.Arcus.TenantId -ServicePrincipal } - Context "Handling Schemas" { + Context "Uploading Schemas into an Azure Integration Account" { It "Try to upload single schema to unexisting Integration Account fails" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName @@ -209,7 +209,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } } - Context "Handling Maps" { + Context "Uploading Maps into an Azure Integration Account" { It "Try to upload single map to unexisting Integration Account fails" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName @@ -406,7 +406,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { } } } - Context "Handling Assemblies" { + Context "Uploading Assemblies into an Azure Integration Account" { It "Try to upload single assembly to unexisting Integration Account fails" { # Arrange $resourceGroupName = $config.Arcus.ResourceGroupName From 1694280c8ca85bea2a08f668c7b1a1e83f51f944 Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Wed, 29 Dec 2021 12:14:08 +0100 Subject: [PATCH 19/20] removed -ErrorAction Stop from Act --- ...cus.Scripting.IntegrationAccount.tests.ps1 | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 index 205252bc..8e97c409 100644 --- a/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 +++ b/src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAccount.tests.ps1 @@ -12,7 +12,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schemaFilePath -SchemasFolder $schemasFolder -ErrorAction Stop + Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schemaFilePath -SchemasFolder $schemasFolder } | Should -Throw -ExpectedMessage "Either the file path of a specific schema or the file path of a folder containing multiple schemas is required, e.g.: -SchemaFilePath 'C:\Schemas\Schema.xsd' or -SchemasFolder 'C:\Schemas'" # Assert @@ -25,7 +25,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -ErrorAction Stop + Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName } | Should -Throw -ExpectedMessage "Either the file path of a specific schema or the file path of a folder containing multiple schemas is required, e.g.: -SchemaFilePath 'C:\Schemas\Schema.xsd' or -SchemasFolder 'C:\Schemas'" # Assert @@ -59,7 +59,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schemaFilePath -ErrorAction Stop + Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schemaFilePath } | Should -Not -Throw # Assert @@ -97,7 +97,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schemaFilePath -ErrorAction Stop + Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemaFilePath $schemaFilePath } | Should -Not -Throw # Assert @@ -140,7 +140,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder -ErrorAction Stop + Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder } | Should -Not -Throw # Assert @@ -183,7 +183,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder -ErrorAction Stop + Set-AzIntegrationAccountSchemas -ResourceGroupName $resourceGroupName -Name $integrationAccountName -SchemasFolder $schemasFolder } | Should -Not -Throw # Assert @@ -204,7 +204,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $mapFilePath -MapsFolder $mapsFolder -ErrorAction Stop + Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $mapFilePath -MapsFolder $mapsFolder } | Should -Throw -ExpectedMessage "Either the file path of a specific map or the file path of a folder containing multiple maps is required, e.g.: -MapFilePath 'C:\Maps\map.xslt' or -MapsFolder 'C:\Maps'" # Assert @@ -217,7 +217,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -ErrorAction Stop + Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName } | Should -Throw -ExpectedMessage "Either the file path of a specific map or the file path of a folder containing multiple maps is required, e.g.: -MapFilePath 'C:\Maps\map.xslt' or -MapsFolder 'C:\Maps'" # Assert @@ -251,7 +251,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $mapFilePath -ErrorAction Stop + Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $mapFilePath } | Should -Not -Throw # Assert @@ -289,7 +289,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $mapFilePath -ErrorAction Stop + Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapFilePath $mapFilePath } | Should -Not -Throw # Assert @@ -332,7 +332,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder -ErrorAction Stop + Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder } | Should -Not -Throw # Assert @@ -375,7 +375,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder -ErrorAction Stop + Set-AzIntegrationAccountMaps -ResourceGroupName $resourceGroupName -Name $integrationAccountName -MapsFolder $mapsFolder } | Should -Not -Throw # Assert @@ -396,7 +396,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath -AssembliesFolder $assembliesFolder -ErrorAction Stop + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath -AssembliesFolder $assembliesFolder } | Should -Throw -ExpectedMessage "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" # Assert @@ -409,7 +409,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -ErrorAction Stop + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName } | Should -Throw -ExpectedMessage "Either the file path of a specific assembly or the file path of a folder containing multiple assemblies is required, e.g.: -AssemblyFilePath 'C:\Assemblies\assembly.dll' or -AssembliesFolder 'C:\Assemblies'" # Assert @@ -443,7 +443,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath -ErrorAction Stop + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath } | Should -Not -Throw # Assert @@ -481,7 +481,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath -ErrorAction Stop + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssemblyFilePath $assemblyFilePath } | Should -Not -Throw # Assert @@ -524,7 +524,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ErrorAction Stop + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder } | Should -Not -Throw # Assert @@ -567,7 +567,7 @@ InModuleScope Arcus.Scripting.IntegrationAccount { # Act { - Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder -ErrorAction Stop + Set-AzIntegrationAccountAssemblies -ResourceGroupName $resourceGroupName -Name $integrationAccountName -AssembliesFolder $assembliesFolder } | Should -Not -Throw # Assert From 7863ca153a912cc4ff015e5bf64e15059416bbe0 Mon Sep 17 00:00:00 2001 From: Pim Simons Date: Wed, 29 Dec 2021 13:44:00 +0100 Subject: [PATCH 20/20] don't use points at the end of logging statements --- .../powershell/azure-integration-account.md | 92 +++++++++---------- .../Set-AzIntegrationAccountAssemblies.ps1 | 8 +- .../Scripts/Set-AzIntegrationAccountMaps.ps1 | 8 +- .../Set-AzIntegrationAccountSchemas.ps1 | 8 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/docs/preview/02-Features/powershell/azure-integration-account.md b/docs/preview/02-Features/powershell/azure-integration-account.md index 18360171..d65888e9 100644 --- a/docs/preview/02-Features/powershell/azure-integration-account.md +++ b/docs/preview/02-Features/powershell/azure-integration-account.md @@ -35,53 +35,53 @@ Upload/update a single, or multiple schemas into an Azure Integration Account. Uploading a *single schema* into an Integration Account. ```powershell PS> Set-AzIntegrationAccountSchemas -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -SchemaFilePath "C:\Schemas\MySchema.xsd" -# Uploading schema 'MySchema.xsd' into the Azure Integration Account 'my-integration-account'. -# Schema 'MySchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading schema 'MySchema.xsd' into the Azure Integration Account 'my-integration-account' +# Schema 'MySchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account' ``` Uploading a *single schema* into an Integration Account and remove the file-extension. ```powershell PS> Set-AzIntegrationAccountSchemas -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -SchemaFilePath "C:\Schemas\MySchema.xsd" -RemoveFileExtensions -# Uploading schema 'MySchema' into the Azure Integration Account 'my-integration-account'. -# Schema 'MySchema' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading schema 'MySchema' into the Azure Integration Account 'my-integration-account' +# Schema 'MySchema' has been uploaded into the Azure Integration Account 'my-integration-account' ``` Uploading a *single schema* into an Integration Account and set add a prefix to the name of the schema within the Integration Account. ```powershell PS> Set-AzIntegrationAccountSchemas -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -SchemaFilePath "C:\Schemas\MySchema.xsd" -ArtifactsPrefix 'dev-' -# Uploading schema 'dev-MySchema.xsd' into the Azure Integration Account 'my-integration-account'. -# Schema 'dev-MySchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading schema 'dev-MySchema.xsd' into the Azure Integration Account 'my-integration-account' +# Schema 'dev-MySchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account' ``` Uploading *all schemas* located in a specific folder into an Integration Account. ```powershell PS> Set-AzIntegrationAccountSchemas -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -SchemasFolder "C:\Schemas" -# Uploading schema 'MyFirstSchema.xsd' into the Azure Integration Account 'my-integration-account'. -# Schema 'MyFirstSchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading schema 'MyFirstSchema.xsd' into the Azure Integration Account 'my-integration-account' +# Schema 'MyFirstSchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- -# Uploading schema 'MySecondSchema.xsd' into the Azure Integration Account 'my-integration-account'. -# Schema 'MySecondSchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading schema 'MySecondSchema.xsd' into the Azure Integration Account 'my-integration-account' +# Schema 'MySecondSchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- ``` Uploading *all schemas* located in a specific folder into an Integration Account and remove the file-extension. ```powershell PS> Set-AzIntegrationAccountSchemas -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -SchemasFolder "C:\Schemas" -RemoveFileExtensions -# Uploading schema 'MyFirstSchema' into the Azure Integration Account 'my-integration-account'. -# Schema 'MyFirstSchema' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading schema 'MyFirstSchema' into the Azure Integration Account 'my-integration-account' +# Schema 'MyFirstSchema' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- -# Uploading schema 'MySecondSchema' into the Azure Integration Account 'my-integration-account'. -# Schema 'MySecondSchema' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading schema 'MySecondSchema' into the Azure Integration Account 'my-integration-account' +# Schema 'MySecondSchema' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- ``` Uploading *all schemas* located in a specific folder into an Integration Account and set add a prefix to the name of the schemas. ```powershell PS> Set-AzIntegrationAccountSchemas -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -SchemasFolder "C:\Schemas" -ArtifactsPrefix 'dev-' -# Uploading schema 'dev-MyFirstSchema.xsd' into the Azure Integration Account 'my-integration-account'. -# Schema 'dev-MyFirstSchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading schema 'dev-MyFirstSchema.xsd' into the Azure Integration Account 'my-integration-account' +# Schema 'dev-MyFirstSchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- # Uploading schema 'dev-MySecondSchema.xsd' into the Azure Integration Account 'my-integration-account' -# Schema 'dev-MySecondSchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Schema 'dev-MySecondSchema.xsd' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- ``` @@ -105,53 +105,53 @@ Upload/update a single, or multiple maps into an Azure Integration Account. Uploading a *single map* into an Integration Account. ```powershell PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -MapFilePath "C:\Maps\MyMap.xslt" -# Uploading map 'MyMap.xslt' into the Azure Integration Account 'my-integration-account'. -# Map 'MyMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading map 'MyMap.xslt' into the Azure Integration Account 'my-integration-account' +# Map 'MyMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account' ``` Uploading a *single map* into an Integration Account and remove the file-extension. ```powershell PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -MapFilePath "C:\Maps\MyMap.xslt" -RemoveFileExtensions -# Uploading map 'MyMap' into the Azure Integration Account 'my-integration-account'. -# Map 'MyMap' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading map 'MyMap' into the Azure Integration Account 'my-integration-account' +# Map 'MyMap' has been uploaded into the Azure Integration Account 'my-integration-account' ``` Uploading a *single map* into an Integration Account and set add a prefix to the name of the schema within the Integration Account. ```powershell PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -MapFilePath "C:\Maps\MyMap.xslt" -ArtifactsPrefix 'dev-' -# Uploading smapchema 'dev-MyMap.xsd' into the Azure Integration Account 'my-integration-account'. -# Map 'dev-MyMap.xsd' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading smapchema 'dev-MyMap.xsd' into the Azure Integration Account 'my-integration-account' +# Map 'dev-MyMap.xsd' has been uploaded into the Azure Integration Account 'my-integration-account' ``` Uploading *all maps* located in a specific folder into an Integration Account. ```powershell PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -MapsFolder "C:\Maps" -# Uploading map 'MyFirstMap.xslt' into the Azure Integration Account 'my-integration-account'. -# Map 'MyFirstMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading map 'MyFirstMap.xslt' into the Azure Integration Account 'my-integration-account' +# Map 'MyFirstMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- -# Uploading map 'MySecondMap.xslt' into the Azure Integration Account 'my-integration-account'. -# Map 'MySecondMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading map 'MySecondMap.xslt' into the Azure Integration Account 'my-integration-account' +# Map 'MySecondMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- ``` Uploading *all maps* located in a specific folder into an Integration Account and remove the file-extension. ```powershell PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -MapsFolder "C:\Maps" -RemoveFileExtensions -# Uploading map 'MyFirstMap' into the Azure Integration Account 'my-integration-account'. -# Map 'MyFirstMap' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading map 'MyFirstMap' into the Azure Integration Account 'my-integration-account' +# Map 'MyFirstMap' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- -# Uploading map 'MySecondMap' into the Azure Integration Account 'my-integration-account'. -# Map 'MySecondMap' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading map 'MySecondMap' into the Azure Integration Account 'my-integration-account' +# Map 'MySecondMap' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- ``` Uploading *all maps* located in a specific folder into an Integration Account and set add a prefix to the name of the maps. ```powershell PS> Set-AzIntegrationAccountMaps -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -MapsFolder "C:\Maps" -ArtifactsPrefix 'dev-' -# Uploading map 'dev-MyFirstMap.xslt' into the Azure Integration Account 'my-integration-account'. -# Map 'dev-MyFirstMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading map 'dev-MyFirstMap.xslt' into the Azure Integration Account 'my-integration-account' +# Map 'dev-MyFirstMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- # Uploading map 'dev-MySecondMap.xslt' into the Azure Integration Account 'my-integration-account' -# Map 'dev-MySecondMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Map 'dev-MySecondMap.xslt' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- ``` @@ -172,35 +172,35 @@ Upload/update a single, or multiple assemblies into an Azure Integration Account Uploading a *single assembly* into an Integration Account. ```powershell PS> Set-AzIntegrationAccountAssemblies -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -AssemblyFilePath "C:\Assemblies\MyAssembly.dll" -# Uploading assembly 'MyAssembly.dll' into the Azure Integration Account 'my-integration-account'. -# Assembly 'MyAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading assembly 'MyAssembly.dll' into the Azure Integration Account 'my-integration-account' +# Assembly 'MyAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account' ``` Uploading a *single assembly* into an Integration Account and set add a prefix to the name of the assembly within the Integration Account. ```powershell PS> Set-AzIntegrationAccountAssemblies -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -AssemblyFilePath "C:\Assemblies\MyAssembly.dll" -ArtifactsPrefix 'dev-' -# Uploading assembly 'dev-MyAssembly.dll' into the Azure Integration Account 'my-integration-account'. -# Assembly 'dev-MyAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading assembly 'dev-MyAssembly.dll' into the Azure Integration Account 'my-integration-account' +# Assembly 'dev-MyAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account' ``` Uploading *all assemblies* located in a specific folder into an Integration Account. ```powershell PS> Set-AzIntegrationAccountAssemblies -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -AssembliesFolder "C:\Assemblies" -# Uploading assembly 'MyFirstAssembly.dll' into the Azure Integration Account 'my-integration-account'. -# Assembly 'MyFirstAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading assembly 'MyFirstAssembly.dll' into the Azure Integration Account 'my-integration-account' +# Assembly 'MyFirstAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- -# Uploading assembly 'MySecondAssembly.dll' into the Azure Integration Account 'my-integration-account'. -# Assembly 'MySecondAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading assembly 'MySecondAssembly.dll' into the Azure Integration Account 'my-integration-account' +# Assembly 'MySecondAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- ``` Uploading *all assemblies* located in a specific folder into an Integration Account and set add a prefix to the name of the assemblies. ```powershell PS> Set-AzIntegrationAccountAssemblies -ResourceGroupName 'my-resource-group' -Name 'my-integration-account' -AssembliesFolder "C:\Assemblies" -ArtifactsPrefix 'dev-' -# Uploading assembly 'dev-MyFirstAssembly.dll' into the Azure Integration Account 'my-integration-account'. -# Assembly 'dev-MyFirstAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading assembly 'dev-MyFirstAssembly.dll' into the Azure Integration Account 'my-integration-account' +# Assembly 'dev-MyFirstAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- -# Uploading assembly 'dev-MySecondAssembly.dll' into the Azure Integration Account 'my-integration-account'. -# Assembly 'dev-MySecondAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account'. +# Uploading assembly 'dev-MySecondAssembly.dll' into the Azure Integration Account 'my-integration-account' +# Assembly 'dev-MySecondAssembly.dll' has been uploaded into the Azure Integration Account 'my-integration-account' # ---------- ``` diff --git a/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountAssemblies.ps1 b/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountAssemblies.ps1 index 994d84d8..97bc9d91 100644 --- a/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountAssemblies.ps1 +++ b/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountAssemblies.ps1 @@ -20,16 +20,16 @@ function UploadAssembly { if ($ArtifactsPrefix -ne '') { $assemblyName = $ArtifactsPrefix + $assemblyName } - Write-Host "Uploading assembly '$assemblyName' into the Integration Account '$Name'." + Write-Host "Uploading assembly '$assemblyName' into the Integration Account '$Name'" $existingAssembly = $null try { - Write-Verbose "Checking if the assembly '$assemblyName' already exists in the Integration Account '$Name'." + Write-Verbose "Checking if the assembly '$assemblyName' already exists in the Integration Account '$Name'" $existingAssembly = Get-AzIntegrationAccountAssembly -ResourceGroupName $ResourceGroupName -IntegrationAccount $Name -Name $assemblyName -ErrorAction Stop } catch { if ($_.Exception.Message.Contains('could not be found')) { - Write-Verbose "No assembly '$assemblyName' could not be found in Azure Integration Account '$Name'." + Write-Verbose "No assembly '$assemblyName' could not be found in Azure Integration Account '$Name'" } else { throw $_.Exception @@ -47,7 +47,7 @@ function UploadAssembly { $updatedAssembly = Set-AzIntegrationAccountAssembly -ResourceGroupName $ResourceGroupName -IntegrationAccount $Name -Name $assemblyName -AssemblyFilePath $Assembly.FullName -ErrorAction Stop Write-Verbose ($updatedAssembly | Format-List -Force | Out-String) } - Write-Host "Assembly '$assemblyName' has been uploaded into the Azure Integration Account '$Name'." + Write-Host "Assembly '$assemblyName' has been uploaded into the Azure Integration Account '$Name'" } catch { Write-Error "Failed to upload assembly '$assemblyName' in Azure Integration Account '$Name': '$($_.Exception.Message)_'" diff --git a/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountMaps.ps1 b/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountMaps.ps1 index ea779efd..5abe0cfa 100644 --- a/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountMaps.ps1 +++ b/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountMaps.ps1 @@ -25,16 +25,16 @@ function UploadMap { if ($ArtifactsPrefix -ne '') { $mapName = $ArtifactsPrefix + $mapName } - Write-Host "Uploading map '$mapName' into the Integration Account '$Name'." + Write-Host "Uploading map '$mapName' into the Integration Account '$Name'" $existingMap = $null try { - Write-Verbose "Checking if the map '$mapName' already exists in the Integration Account '$Name'." + Write-Verbose "Checking if the map '$mapName' already exists in the Integration Account '$Name'" $existingMap = Get-AzIntegrationAccountMap -ResourceGroupName $ResourceGroupName -Name $Name -MapName $mapName -ErrorAction Stop } catch { if ($_.Exception.Message.Contains('could not be found')) { - Write-Verbose "No map '$mapName' could not be found in Azure Integration Account '$Name'." + Write-Verbose "No map '$mapName' could not be found in Azure Integration Account '$Name'" } else { throw $_.Exception @@ -52,7 +52,7 @@ function UploadMap { $updatedMap = Set-AzIntegrationAccountMap -ResourceGroupName $ResourceGroupName -Name $Name -MapName $mapName -MapFilePath $Map.FullName -ErrorAction Stop -Force Write-Verbose ($updatedMap | Format-List -Force | Out-String) } - Write-Host "Map '$mapName' has been uploaded into the Azure Integration Account '$Name'." + Write-Host "Map '$mapName' has been uploaded into the Azure Integration Account '$Name'" } catch { Write-Error "Failed to upload map '$mapName' in Azure Integration Account '$Name': '$($_.Exception.Message)_'" diff --git a/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountSchemas.ps1 b/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountSchemas.ps1 index ef551fe1..37c578f9 100644 --- a/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountSchemas.ps1 +++ b/src/Arcus.Scripting.IntegrationAccount/Scripts/Set-AzIntegrationAccountSchemas.ps1 @@ -24,17 +24,17 @@ function UploadSchema { if ($ArtifactsPrefix -ne '') { $schemaName = $ArtifactsPrefix + $schemaName } - Write-Host "Uploading schema '$schemaName' into the Integration Account '$Name'." + Write-Host "Uploading schema '$schemaName' into the Integration Account '$Name'" ## Check if the schema already exists $existingSchema = $null try { - Write-Verbose "Checking if the schema '$schemaName' already exists in the Integration Account '$Name'." + Write-Verbose "Checking if the schema '$schemaName' already exists in the Integration Account '$Name'" $existingSchema = Get-AzIntegrationAccountSchema -ResourceGroupName $ResourceGroupName -Name $Name -SchemaName $schemaName -ErrorAction Stop } catch { if ($_.Exception.Message.Contains('could not be found')) { - Write-Verbose "No schema '$schemaName' could not be found in Azure Integration Account '$Name'." + Write-Verbose "No schema '$schemaName' could not be found in Azure Integration Account '$Name'" } else { throw $_.Exception @@ -54,7 +54,7 @@ function UploadSchema { $updatedSchema = Set-AzIntegrationAccountSchema -ResourceGroupName $ResourceGroupName -Name $Name -SchemaName $schemaName -SchemaFilePath $schema.FullName -ErrorAction Stop -Force Write-Verbose ($updatedSchema | Format-List -Force | Out-String) } - Write-Host "Schema '$schemaName' has been uploaded into the Azure Integration Account '$Name'." + Write-Host "Schema '$schemaName' has been uploaded into the Azure Integration Account '$Name'" } catch { Write-Error "Failed to upload schema '$schemaName' in Azure Integration Account '$Name': '$($_.Exception.Message)_'"