Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 11 additions & 1 deletion src/Workloads/Workloads.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks)
$ErrorActionPreference = 'Stop'

if($PSEdition -ne 'Core') {
Expand Down Expand Up @@ -169,4 +169,14 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

if (-not $DisableAfterBuildTasks){
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
Write-Host -ForegroundColor Green 'Running after build tasks...'
. $afterBuildTasksPath @afterBuildTasksArgs
}
}


Write-Host -ForegroundColor Green '-------------Done-------------'
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ function New-AzWorkloadsSapVirtualInstance {
[System.String]
# Managed resource group name
${ManagedResourceGroupName},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Category('Body')]
[System.String]
# Managed resource Network Access Type
${ManagedResourcesNetworkAccessType},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Category('Body')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ function New-AzWorkloadsSapVirtualInstance_CreateWithJsonTemplatePath {
# Managed resource group name
${ManagedResourceGroupName},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Category('Body')]
[System.String]
# Managed resource Network Access Type
${ManagedResourcesNetworkAccessType},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ITrackedResourceTags]))]
Expand Down Expand Up @@ -216,6 +222,11 @@ function New-AzWorkloadsSapVirtualInstance_CreateWithJsonTemplatePath {
$null = $PSBoundParameters.Remove('SapProduct');
}

if($PSBoundParameters.ContainsKey('ManagedResourcesNetworkAccessType')) {
$bodyHashTable.properties.managedResourcesNetworkAccessType = $ManagedResourcesNetworkAccessType.ToString()
$null = $PSBoundParameters.Remove('ManagedResourcesNetworkAccessType');
}

$bodyHashTable.properties.managedResourceGroupConfiguration = @{}

if($PSBoundParameters.ContainsKey('ManagedResourceGroupName')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ In this example, you Install the SAP software on the deployed infrastructure fo

### Example 5: Register an existing SAP system as a VIS
```powershell
New-AzWorkloadsSapVirtualInstance -ResourceGroupName 'TestRG' -Name L46 -Location eastus -Environment 'NonProd' -SapProduct 'S4HANA' -CentralServerVmId '/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourcegroups/powershell-cli-testrg/providers/microsoft.compute/virtualmachines/l46ascsvm' -Tag @{k1 = "v1"; k2 = "v2"} -ManagedResourceGroupName "L46-rg" -ManagedRgStorageAccountName 'acssstoragel46' -IdentityType 'UserAssigned' -UserAssignedIdentity @{'/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourcegroups/SAP-E2ETest-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/E2E-RBAC-MSI'= @{}}
New-AzWorkloadsSapVirtualInstance -ResourceGroupName 'TestRG' -Name L46 -Location eastus -Environment 'NonProd' -SapProduct 'S4HANA' -CentralServerVmId '/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourcegroups/powershell-cli-testrg/providers/microsoft.compute/virtualmachines/l46ascsvm' -Tag @{k1 = "v1"; k2 = "v2"} -IdentityType 'UserAssigned' -UserAssignedIdentity @{'/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourcegroups/SAP-E2ETest-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/E2E-RBAC-MSI'= @{}}
```

```output
Expand All @@ -63,3 +63,28 @@ L46 PowerShell-CLI-TestRG NonProd Succeeded S4HANA Regis

Use the New-AzWorkloadsSapVirtualInstance cmdlet with the suggested input parameters to register an existing SAP system as a Virtual Instance for SAP solutions resource.

### Example 6: Register an existing SAP system as a Virtual Instance for SAP solutions resource (VIS) with a custom Managed Resource Group and Managed Storage Account Name, and Managed Storage Account Network Access Type setting.
```powershell
New-AzWorkloadsSapVirtualInstance -ResourceGroupName 'TestRG' -Name L46 -Location eastus -Environment 'NonProd' -SapProduct 'S4HANA' -CentralServerVmId '/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourcegroups/powershell-cli-testrg/providers/microsoft.compute/virtualmachines/l46ascsvm' -Tag @{k1 = "v1"; k2 = "v2"} -ManagedResourceGroupName "L46-rg" -ManagedRgStorageAccountName 'acssstoragel46' -ManagedResourcesNetworkAccessType 'Private' -IdentityType 'UserAssigned' -UserAssignedIdentity @{'/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourcegroups/SAP-E2ETest-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/E2E-RBAC-MSI'= @{}}
```

```output
Name ResourceGroupName Health Environment ProvisioningState SapProduct State Status Location
---- ----------------- ------ ----------- ----------------- ---------- ----- ------ --------
L46 PowerShell-CLI-TestRG NonProd Succeeded S4HANA RegistrationComplete eastus
```

Use the New-AzWorkloadsSapVirtualInstance cmdlet with the suggested input parameters to register an existing SAP system as a Virtual Instance for SAP solutions resource with a custom Managed Resource Group and Managed Storage Account Name, and specify the Managed Storage Account Network Access Type setting as per your security requirements. Learn More: https://go.microsoft.com/fwlink/?linkid=2256933

### Example 7: Deploy infrastructure for a three-tier distributed Highly Available (HA) SAP system with Azure Compute Gallary Image
```powershell
New-AzWorkloadsSapVirtualInstance -ResourceGroupName 'PowerShell-CLI-TestRG' -Name SK1 -Location eastus -Environment 'NonProd' -SapProduct 'S4HANA' -Configuration .\CreatePayloadHACustomNames.json -IdentityType 'UserAssigned' -ManagedResourceGroupName "acss-mrg1" -UserAssignedIdentity @{'/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourcegroups/SAP-E2ETest-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/E2E-RBAC-MSI'= @{}}
```

```output
Name ResourceGroupName Health Environment ProvisioningState SapProduct State Status Location
---- ----------------- ------ ----------- ----------------- ---------- ----- ------ --------
SK1 PowerShell-CLI-TestRG NonProd Succeeded S4HANA SoftwareInstallationPending eastus
```

In this example, you Deploy infrastructure for a three-tier distributed Highly Available (HA) SAP system with Azure Compute Gallary Image. See sample json payload here: https://go.microsoft.com/fwlink/?linkid=2263420
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,26 @@ Target :

Start-AzWorkloadsSapApplicationInstance cmdlet starts the App server instance of the SAP system represented by the VIS. Currently, start action is supported for ABAP stack. In this example, you can see that instance can be started by passing the App server instance Azure resource ID as InputObject to the cmdlet.

### Example 3: Start Application server instance of the SAP system and its underlying Virtual Machine
```powershell
Start-AzWorkloadsSapApplicationInstance -Name app0 -ResourceGroupName db0-vis-rg -SapVirtualInstanceName DB0 -StartVM
```

```output
AdditionalInfo :
Code :
Detail :
EndTime : 15-03-2023 08:21:31
Id : /subscriptions/49d64d54-e966-4c46-a868-1999802b762c/providers/Microsoft.Workloads/locations/CENTRALUSEUAP/operationStatuses/58527855-a695-48a5-ac11-fbc
74b836859*DF20ACAC495F17B1D0D9182C3A4C44BC6EDFF718387348FAE17F19BCB5DE687C
Message :
Name : 58527855-a695-48a5-ac11-fbc74b836859*DF20ACAC495F17B1D0D9182C3A4C44BC6EDFF718387348FAE17F19BCB5DE687C
Operation :
PercentComplete :
ResourceGroupName :
StartTime : 15-03-2023 08:18:22
Status : Succeeded
Target :
```

Start-AzWorkloadsSapApplicationInstance cmdlet starts the App server instance of the SAP system and its underlying Virtual Machines represented by the VIS. Currently, start action is supported for ABAP stack. In this example, you can see that the VMs and instance can be started by passing the App server instance resource name, Resource Group name, VIS name and StartVM parameter as inputs.
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,26 @@ Target :

Start-AzWorkloadsSapCentralInstance cmdlet starts the Central services instance of the SAP system represented by the VIS. Currently, start action is supported for ABAP central services stack. In this example, you can see that instance can be started by passing the Central services instance Azure resource ID as InputObject to the cmdlet.

### Example 3: Start Central services instance of the SAP system and its underlying Virtual Machine
```powershell
Start-AzWorkloadsSapCentralInstance -Name cs0 -ResourceGroupName db0-vis-rg -SapVirtualInstanceName DB0 -StartVM
```

```output
AdditionalInfo :
Code :
Detail :
EndTime : 15-03-2023 09:11:00
Id : /subscriptions/49d64d54-e966-4c46-a868-1999802b762c/providers/Microsoft.Workloads/locations/CENTRALUSEUAP/operationStatuses/651c6f1b-db7
b-46b2-ba9a-fb5ee67ec372*D9A8F8EF15D6E75CE64E8F442A39F1D7AF307793D262CE855530D335419055E3
Message :
Name : 651c6f1b-db7b-46b2-ba9a-fb5ee67ec372*D9A8F8EF15D6E75CE64E8F442A39F1D7AF307793D262CE855530D335419055E3
Operation :
PercentComplete :
ResourceGroupName :
StartTime : 15-03-2023 09:08:45
Status : Succeeded
Target :
```

Start-AzWorkloadsSapCentralInstance cmdlet starts the Central services instance of the SAP system and its underlying Virtual Machines represented by the VIS. Currently, start action is supported for ABAP central services stack. In this example, you can see that the VMs and instance can be started by passing the Central services instance resource name, Resource Group name, VIS name and StartVM parameter as inputs.
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,26 @@ Target :

Start-AzWorkloadsSapDatabaseInstance cmdlet starts the Database instance of the SAP system represented by the VIS. Currently start action is supported for SAP HANA Database only. In this example, you can see that database can be started by providing the DB instance Azure resource ID as InputObject to the cmdlet.

### Example 3: Start Database instance of the SAP system and its underlying Virtual Machine
```powershell
Start-AzWorkloadsSapDatabaseInstance -Name db0 -ResourceGroupName db0-vis-rg -SapVirtualInstanceName DB0 -StartVM
```

```output
AdditionalInfo :
Code :
Detail :
EndTime : 15-03-2023 09:11:00
Id : /subscriptions/49d64d54-e966-4c46-a868-1999802b762c/providers/Microsoft.Workloads/locations/CENTRALUSEUAP/operationStatuses/651c6f1b-db7
b-46b2-ba9a-fb5ee67ec372*D9A8F8EF15D6E75CE64E8F442A39F1D7AF307793D262CE855530D335419055E3
Message :
Name : 651c6f1b-db7b-46b2-ba9a-fb5ee67ec372*D9A8F8EF15D6E75CE64E8F442A39F1D7AF307793D262CE855530D335419055E3
Operation :
PercentComplete :
ResourceGroupName :
StartTime : 15-03-2023 09:08:45
Status : Succeeded
Target :
```

Start-AzWorkloadsSapDatabaseInstance cmdlet starts the Database instance of the SAP system and its underlying Virtual Machine represented by the VIS. Currently start action is supported for SAP HANA Database only. In this example, you can see that the VMs and database can be started by passing the DB instance resource name, ResourceGroupName, VIS name and StartVM parameter as inputs.
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,26 @@ Target :

Start-AzWorkloadsSapVirtualInstance cmdlet starts the SAP application tier, that is ASCS instance and App servers of the system. In this example, you can see that system can be started by providing the VIS Azure resource ID as InputObject to the cmdlet.

### Example 3: Start an SAP system and its underlying Virtual Machine(s)
```powershell
Start-AzWorkloadsSapVirtualInstance -Name DB0 -ResourceGroupName db0-vis-rg -StartVM
```

```output
AdditionalInfo :
Code :
Detail :
EndTime : 15-03-2023 09:11:00
Id : /subscriptions/49d64d54-e966-4c46-a868-1999802b762c/providers/Microsoft.Workloads/locations/CENTRALUSEUAP/operationStatuses/651c6f1b-db7
b-46b2-ba9a-fb5ee67ec372*D9A8F8EF15D6E75CE64E8F442A39F1D7AF307793D262CE855530D335419055E3
Message :
Name : 651c6f1b-db7b-46b2-ba9a-fb5ee67ec372*D9A8F8EF15D6E75CE64E8F442A39F1D7AF307793D262CE855530D335419055E3
Operation :
PercentComplete :
ResourceGroupName :
StartTime : 15-03-2023 09:08:45
Status : Succeeded
Target :
```

Start-AzWorkloadsSapVirtualInstance cmdlet starts the SAP application tier and its underlying Virtual Machines, that is ASCS instance and App servers of the system. In this example, you can see that VMs and SAP can be started by passing the VIS name, ResourceGroupName and StartVM parameter as inputs.
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,51 @@ Target :
```

Stop-AzWorkloadsSapApplicationInstance cmdlet stops the App server instance of the SAP system represented by the VIS. Currently, stop action is supported for ABAP stack. In this example, you can see that instance can be stopped by passing the App server instance Azure resource ID as InputObject to the cmdlet.

### Example 3: Stop Application server instance of the SAP system and its underlying Virtual Machine
```powershell
Stop-AzWorkloadsSapApplicationInstance -Name app0 -ResourceGroupName db0-vis-rg -SapVirtualInstanceName DB0 -DeallocateVM
```

```output
AdditionalInfo :
Code :
Detail :
EndTime : 15-03-2023 08:45:40
Id : /subscriptions/49d64d54-e966-4c46-a868-1999802b762c/providers/Microsoft.Workloads/locations/CENTRALUSEUAP/operationStatuses/881d4ff9-1d38-4596-b215-28e
77dbfe176*DF20ACAC495F17B1D0D9182C3A4C44BC6EDFF718387348FAE17F19BCB5DE687C
Message :
Name : 881d4ff9-1d38-4596-b215-28e77dbfe176*DF20ACAC495F17B1D0D9182C3A4C44BC6EDFF718387348FAE17F19BCB5DE687C
Operation :
PercentComplete :
ResourceGroupName :
StartTime : 15-03-2023 08:43:32
Status : Succeeded
Target :
```

Stop-AzWorkloadsSapApplicationInstance cmdlet stops the App server instance of the SAP system and its underlying Virtual Machine represented by the VIS. Currently, stop action is supported for ABAP stack. In this example, you can see that instance and its VMs can be stopped by passing the App server instance resource name, Resource Group name, VIS name and DeallocateVM parameter as inputs.

### Example 4: Soft Stop Application server instance of the SAP system
```powershell
Stop-AzWorkloadsSapApplicationInstance -Name app0 -ResourceGroupName db0-vis-rg -SapVirtualInstanceName DB0 -SoftStopTimeoutSecond 300
```

```output
AdditionalInfo :
Code :
Detail :
EndTime : 15-03-2023 08:45:40
Id : /subscriptions/49d64d54-e966-4c46-a868-1999802b762c/providers/Microsoft.Workloads/locations/CENTRALUSEUAP/operationStatuses/881d4ff9-1d38-4596-b215-28e
77dbfe176*DF20ACAC495F17B1D0D9182C3A4C44BC6EDFF718387348FAE17F19BCB5DE687C
Message :
Name : 881d4ff9-1d38-4596-b215-28e77dbfe176*DF20ACAC495F17B1D0D9182C3A4C44BC6EDFF718387348FAE17F19BCB5DE687C
Operation :
PercentComplete :
ResourceGroupName :
StartTime : 15-03-2023 08:43:32
Status : Succeeded
Target :
```

Stop-AzWorkloadsSapApplicationInstance cmdlet soft stops the App server instance of the SAP system represented by the VIS. Currently, stop action is supported for ABAP stack. In this example, you can see that instance can be stopped by passing the App server instance resource name, Resource Group name, VIS name and soft stop timeout seconds as inputs.
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,26 @@ Target :

Stop-AzWorkloadsSapCentralInstance cmdlet stops the Central services instance of the SAP system represented by the VIS. Currently, stop action is supported for ABAP central services stack. In this example, you can see that instance can be stopped by passing the Central services instance Azure resource ID as InputObject to the cmdlet.

### Example 3: Stop Central services instance of the SAP system and its underlying Virtual Machine
```powershell
Stop-AzWorkloadsSapCentralInstance -Name cs0 -ResourceGroupName db0-vis-rg -SapVirtualInstanceName DB0 -DeallocateVM
```

```output
AdditionalInfo :
Code :
Detail :
EndTime : 15-03-2023 08:45:40
Id : /subscriptions/49d64d54-e966-4c46-a868-1999802b762c/providers/Microsoft.Workloads/locations/CENTRALUSEUAP/operationStatuses/881d4ff9-1d38-4596-b215-28e
77dbfe176*DF20ACAC495F17B1D0D9182C3A4C44BC6EDFF718387348FAE17F19BCB5DE687C
Message :
Name : 881d4ff9-1d38-4596-b215-28e77dbfe176*DF20ACAC495F17B1D0D9182C3A4C44BC6EDFF718387348FAE17F19BCB5DE687C
Operation :
PercentComplete :
ResourceGroupName :
StartTime : 15-03-2023 08:43:32
Status : Succeeded
Target :
```

Stop-AzWorkloadsSapCentralInstance cmdlet stops the Central services instance of the SAP system represented by the VIS. Currently, stop action is supported for ABAP central services stack. In this example, you can see that instance and its VMs can be stopped by passing the Central services instance resource name, Resource Group name, VIS name and DeallocateVM parameter as inputs.
Loading