Skip to content

Commit b8935ca

Browse files
authored
Merge pull request #225008 from MSSedusch/aem-191
SAP: manual install with PS and CLI
2 parents 29a3075 + dcd1438 commit b8935ca

File tree

1 file changed

+150
-19
lines changed

1 file changed

+150
-19
lines changed

articles/virtual-machines/workloads/sap/vm-extension-for-sap-new.md

Lines changed: 150 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,159 @@ The new VM Extension for SAP uses a managed identity that is assigned to the VM
136136

137137
## <a name="ba74712c-4b1f-44c2-9412-de101dbb1ccc"></a>Manually configure the Azure VM extension for SAP solutions
138138

139-
If you want to use Azure Resource Manager, Terraform or other tools to deploy the VM Extension for SAP, please use the following publisher and extension type:
139+
If you want to use Azure Resource Manager, Terraform or other tools to deploy the VM Extension for SAP, you can also deploy the VM Extension for SAP manually i.e. without using the dedicated PowerShell or Azure CLI commands.
140140

141-
For Linux:
142-
* **Publisher**: Microsoft.AzureCAT.AzureEnhancedMonitoring
143-
* **Extension Type**: MonitorX64Linux
144-
* **Version**: 1.*
141+
Before deploying the VM Extension for SAP, please make sure to assign a user or system assigned managed identity to the virtual machine. For more information, read the following guides:
145142

146-
For Windows:
147-
* **Publisher**: Microsoft.AzureCAT.AzureEnhancedMonitoring
148-
* **Extension Type**: MonitorX64Windows
149-
* **Version**: 1.*
143+
* [Configure managed identities for Azure resources on a VM using the Azure portal](/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm)
144+
* [Configure managed identities for Azure resources on an Azure VM using Azure CLI](/azure/active-directory/managed-identities-azure-resources/qs-configure-cli-windows-vm)
145+
* [Configure managed identities for Azure resources on an Azure VM using PowerShell](/azure/active-directory/managed-identities-azure-resources/qs-configure-powershell-windows-vm)
146+
* [Configure managed identities for Azure resources on an Azure VM using templates](/azure/active-directory/managed-identities-azure-resources/qs-configure-template-windows-vm)
147+
* [Terraform VM Identity](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine#identity)
150148

151-
If you want to disable automatic updates for the VM extension or want to deploy a spefici version of the extension, you can retrieve the available versions with Azure CLI or Azure PowerShell.
149+
After assigning an identity to the virtual machine, give the VM read access to either the resource group or the individual resources associated to the virtual machine (VM, Network Interfaces, OS Disks and Data Disks). It is recommended to use the built-in Reader role to grant the access to these resources. You can also grant this access by adding the VM identity to an Azure Active Directory group that already has read access to the required resources. It is then no longer needed to have Owner privileges when deploying the VM Extension for SAP if you use a user assigned identity that already has the required permissions.
150+
151+
There are different ways how to deploy the VM Extension for SAP manually. Please find a few examples in the next chapters.
152+
153+
The extension currently supports the following configuration keys. In the example below, the msi_res_id is shown.
154+
155+
* msi_res_id: ID of the user assigned identity the extension should use to get the required information about the VM and its resources
156+
* proxy: URL of the proxy the extension should use to connect to the internet, for example to retrieve information about the virtual machine and its resources.
157+
158+
### Deploy manually with Azure PowerShell
159+
160+
The following code contains four examples. It shows how to deploy the extension on Windows and Linux, using a system or user assigned identity. Make sure to replace the name of the resource group, the location and VM name in the example.
161+
162+
``` powershell
163+
# Windows VM - user assigned identity
164+
Set-AzVMExtension -Publisher "Microsoft.AzureCAT.AzureEnhancedMonitoring" -ExtensionType "MonitorX64Windows" -ResourceGroupName "<rg name>" -VMName "<vm name>" `
165+
-Name "MonitorX64Windows" -TypeHandlerVersion "1.0" -Location "<location>" -SettingString '{"cfg":[{"key":"msi_res_id","value":"<user assigned resource id>"}]}'
166+
167+
# Windows VM - system assigned identity
168+
Set-AzVMExtension -Publisher "Microsoft.AzureCAT.AzureEnhancedMonitoring" -ExtensionType "MonitorX64Windows" -ResourceGroupName "<rg name>" -VMName "<vm name>" `
169+
-Name "MonitorX64Windows" -TypeHandlerVersion "1.0" -Location "<location>" -SettingString '{"cfg":[]}'
170+
171+
# Linux VM - user assigned identity
172+
Set-AzVMExtension -Publisher "Microsoft.AzureCAT.AzureEnhancedMonitoring" -ExtensionType "MonitorX64Linux" -ResourceGroupName "<rg name>" -VMName "<vm name>" `
173+
-Name "MonitorX64Linux" -TypeHandlerVersion "1.0" -Location "<location>" -SettingString '{"cfg":[{"key":"msi_res_id","value":"<user assigned resource id>"}]}'
174+
175+
# Linux VM - system assigned identity
176+
Set-AzVMExtension -Publisher "Microsoft.AzureCAT.AzureEnhancedMonitoring" -ExtensionType "MonitorX64Linux" -ResourceGroupName "<rg name>" -VMName "<vm name>" `
177+
-Name "MonitorX64Linux" -TypeHandlerVersion "1.0" -Location "<location>" -SettingString '{"cfg":[]}'
178+
```
179+
180+
### Deploy manually with Azure CLI
181+
182+
The following code contains four examples. It shows how to deploy the extension on Windows and Linux, using a system or user assigned identity. Make sure to replace the name of the resource group, the location and VM name in the example.
183+
184+
``` bash
185+
# Windows VM - user assigned identity
186+
az vm extension set --publisher "Microsoft.AzureCAT.AzureEnhancedMonitoring" --name "MonitorX64Windows" --resource-group "<rg name>" --vm-name "<vm name>" \
187+
--extension-instance-name "MonitorX64Windows" --settings '{"cfg":[{"key":"msi_res_id","value":"<user assigned resource id>"}]}'
188+
189+
# Windows VM - system assigned identity
190+
az vm extension set --publisher "Microsoft.AzureCAT.AzureEnhancedMonitoring" --name "MonitorX64Windows" --resource-group "<rg name>" --vm-name "<vm name>" \
191+
--extension-instance-name "MonitorX64Windows" --settings '{"cfg":[]}'
192+
193+
# Linux VM - user assigned identity
194+
az vm extension set --publisher "Microsoft.AzureCAT.AzureEnhancedMonitoring" --name "MonitorX64Linux" --resource-group "<rg name>" --vm-name "<vm name>" \
195+
--extension-instance-name "MonitorX64Linux" --settings '{"cfg":[{"key":"msi_res_id","value":"<user assigned resource id>"}]}'
196+
197+
# Linux VM - system assigned identity
198+
az vm extension set --publisher "Microsoft.AzureCAT.AzureEnhancedMonitoring" --name "MonitorX64Linux" --resource-group "<rg name>" --vm-name "<vm name>" \
199+
--extension-instance-name "MonitorX64Linux" --settings '{"cfg":[]}'
200+
```
201+
202+
### Deploy manually with Terraform
203+
204+
The following manifest contains four examples. It shows how to deploy the extension on Windows and Linux, using a system or user assigned identity. Make sure to replace the ID of the VM and ID of the user assigned identity in the example.
205+
206+
```terraform
207+
208+
# Windows VM - user assigned identity
209+
210+
resource "azurerm_virtual_machine_extension" "example" {
211+
name = "MonitorX64Windows"
212+
virtual_machine_id = "<vm id>"
213+
publisher = "Microsoft.AzureCAT.AzureEnhancedMonitoring"
214+
type = "MonitorX64Windows"
215+
type_handler_version = "1.0"
216+
auto_upgrade_minor_version = true
217+
218+
settings = <<SETTINGS
219+
{
220+
"cfg":[
221+
{
222+
"key":"msi_res_id",
223+
"value":"<user assigned resource id>"
224+
}
225+
]
226+
}
227+
SETTINGS
228+
}
229+
230+
# Windows VM - system assigned identity
231+
232+
resource "azurerm_virtual_machine_extension" "example" {
233+
name = "MonitorX64Windows"
234+
virtual_machine_id = "<vm id>"
235+
publisher = "Microsoft.AzureCAT.AzureEnhancedMonitoring"
236+
type = "MonitorX64Windows"
237+
type_handler_version = "1.0"
238+
auto_upgrade_minor_version = true
239+
240+
settings = <<SETTINGS
241+
{
242+
"cfg":[
243+
]
244+
}
245+
SETTINGS
246+
}
247+
248+
# Linux VM - user assigned identity
249+
250+
resource "azurerm_virtual_machine_extension" "example" {
251+
name = "MonitorX64Linux"
252+
virtual_machine_id = "<vm id>"
253+
publisher = "Microsoft.AzureCAT.AzureEnhancedMonitoring"
254+
type = "MonitorX64Linux"
255+
type_handler_version = "1.0"
256+
auto_upgrade_minor_version = true
257+
258+
settings = <<SETTINGS
259+
{
260+
"cfg":[
261+
{
262+
"key":"msi_res_id",
263+
"value":"<user assigned resource id>"
264+
}
265+
]
266+
}
267+
SETTINGS
268+
}
269+
270+
# Linux VM - system assigned identity
271+
272+
resource "azurerm_virtual_machine_extension" "example" {
273+
name = "MonitorX64Linux"
274+
virtual_machine_id = "<vm id>"
275+
publisher = "Microsoft.AzureCAT.AzureEnhancedMonitoring"
276+
type = "MonitorX64Linux"
277+
type_handler_version = "1.0"
278+
auto_upgrade_minor_version = true
279+
280+
settings = <<SETTINGS
281+
{
282+
"cfg":[
283+
]
284+
}
285+
SETTINGS
286+
}
287+
```
288+
289+
### Versions of the VM Extension for SAP
290+
291+
If you want to disable automatic updates for the VM extension or want to deploy a specific version of the extension, you can retrieve the available versions with Azure CLI or Azure PowerShell.
152292

153293
**Azure PowerShell**
154294
```powershell
@@ -186,15 +326,6 @@ This check makes sure that all performance metrics that appear inside your SAP a
186326
curl http://127.0.0.1:11812/azure4sap/metrics
187327
```
188328
**Expected result**: Returns an XML document that contains the monitoring information of the virtual machine, its disks and network interfaces.
189-
1. Connect to the Azure Virtual Machine by using SSH.
190-
191-
1. Check the output of the following command
192-
193-
```console
194-
curl http://127.0.0.1:11812/azure4sap/metrics
195-
```
196-
197-
**Expected result**: Returns an XML document that contains the monitoring information of the virtual machine, its disks and network interfaces.
198329

199330
If the preceding check was not successful, run these additional checks:
200331

0 commit comments

Comments
 (0)