Skip to content
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

feat: Provide script to upload assemblies into an Integration Account #257

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
adf39eb
add Set-AzIntegrationAccountMaps.ps1 to project
pim-simons Dec 27, 2021
ddf02ef
add to project
pim-simons Dec 27, 2021
7832a2f
added Set-AzIntegrationAccountAssemblies and its unit tests
pim-simons Dec 27, 2021
a64460b
added integration tests
pim-simons Dec 29, 2021
901808e
added documentation
pim-simons Dec 29, 2021
f156766
Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Integrat…
pim-simons Dec 29, 2021
e670b73
Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Integrat…
pim-simons Dec 29, 2021
7420c78
Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Integrat…
pim-simons Dec 29, 2021
9ce6c7a
Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Integrat…
pim-simons Dec 29, 2021
5c1d883
Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Integrat…
pim-simons Dec 29, 2021
462243b
Update src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Integrat…
pim-simons Dec 29, 2021
2f0493d
Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAcco…
pim-simons Dec 29, 2021
30d8d95
Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAcco…
pim-simons Dec 29, 2021
0216dd7
Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAcco…
pim-simons Dec 29, 2021
adb421d
Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAcco…
pim-simons Dec 29, 2021
942f4df
Update src/Arcus.Scripting.Tests.Unit/Arcus.Scripting.IntegrationAcco…
pim-simons Dec 29, 2021
1698aeb
keep naming of tests consistent
pim-simons Dec 29, 2021
f4395d3
descriptive names for context
pim-simons Dec 29, 2021
1694280
removed -ErrorAction Stop from Act
pim-simons Dec 29, 2021
7863ca1
don't use points at the end of logging statements
pim-simons Dec 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 83 additions & 36 deletions docs/preview/02-Features/powershell/azure-integration-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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'.
# 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'
# ----------
```

Expand All @@ -105,55 +105,102 @@ 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 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'.
# 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'
# ----------
```

## 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'
# ----------
```
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,40 @@ function Set-AzIntegrationAccountMaps {
}
}

Export-ModuleMember -Function Set-AzIntegrationAccountMaps
Export-ModuleMember -Function Set-AzIntegrationAccountMaps

<#
.Synopsis
Upload/update a single, or multiple assemblies into an Azure Integration Account.

.Description
Provide a file- or folder-path to upload/update a single or multiple assemblies into an Integration Account.

.Parameter ResourceGroupName
The name of the Azure resource group where the Azure Integration Account is located.

.Parameter Name
The name of the Azure Integration Account into which the assemblies are to be uploaded/updated.

.Parameter AssemblyFilePath
The full path of a assembly that should be uploaded/updated.

.Parameter AssembliesFolder
The path to a directory containing all assemblies that should be uploaded/updated.

.Parameter ArtifactsPrefix
The prefix, if any, that should be added to the assemblies before uploading/updating.
#>
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<ItemGroup>
<Compile Include="Arcus.Scripting.IntegrationAccount.psd1" />
<Compile Include="Arcus.Scripting.IntegrationAccount.psm1" />
<Compile Include="Scripts\Set-AzIntegrationAccountAssemblies.ps1" />
<Compile Include="Scripts\Set-AzIntegrationAccountMaps.ps1" />
<Compile Include="Scripts\Set-AzIntegrationAccountSchemas.ps1" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
Loading