Skip to content

Commit aa606f9

Browse files
authored
Merge pull request #108445 from TimShererWithAquent/us1669724q
Azure CLI syntax blocks.
2 parents 032c9c7 + 8a683a2 commit aa606f9

13 files changed

+101
-80
lines changed

articles/virtual-machines/windows/image-builder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ You should see these two directories created during image customization:
205205
When you are done, delete the resources.
206206

207207
### Delete the image builder template
208+
208209
```azurecli-interactive
209210
az resource delete \
210211
--resource-group $imageResourceGroup \
@@ -213,6 +214,7 @@ az resource delete \
213214
```
214215

215216
### Delete the image resource group
217+
216218
```azurecli-interactive
217219
az group delete -n $imageResourceGroup
218220
```

articles/virtual-machines/windows/quick-create-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ az vm create \
5656

5757
It takes a few minutes to create the VM and supporting resources. The following example output shows the VM create operation was successful.
5858

59-
```azurecli-interactive
59+
```output
6060
{
6161
"fqdns": "",
6262
"id": "/subscriptions/<guid>/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",

articles/virtual-machines/windows/template-description.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ This example shows a typical resource section of a template for creating a speci
153153

154154
When you deploy resources using a template, you have to specify a version of the API to use. The example shows the virtual machine resource using this apiVersion element:
155155

156-
```
156+
```json
157157
"apiVersion": "2016-04-30-preview",
158158
```
159159

@@ -170,7 +170,7 @@ Use these opportunities for getting the latest API versions:
170170

171171
[Parameters](../../resource-group-authoring-templates.md) make it easy for you to specify values for the template when you run it. This parameters section is used in the example:
172172

173-
```
173+
```json
174174
"parameters": {
175175
"adminUsername": { "type": "string" },
176176
"adminPassword": { "type": "securestring" },
@@ -182,7 +182,7 @@ When you deploy the example template, you enter values for the name and password
182182

183183
[Variables](../../resource-group-authoring-templates.md) make it easy for you to set up values in the template that are used repeatedly throughout it or that can change over time. This variables section is used in the example:
184184

185-
```
185+
```json
186186
"variables": {
187187
"storageName": "mystore1",
188188
"accountid": "[concat('/subscriptions/', subscription().subscriptionId,
@@ -219,7 +219,7 @@ When you deploy the example template, variable values are used for the name and
219219

220220
When you need more than one virtual machine for your application, you can use a copy element in a template. This optional element loops through creating the number of VMs that you specified as a parameter:
221221

222-
```
222+
```json
223223
"copy": {
224224
"name": "virtualMachineLoop",
225225
"count": "[parameters('numberOfInstances')]"
@@ -228,7 +228,7 @@ When you need more than one virtual machine for your application, you can use a
228228

229229
Also, notice in the example that the loop index is used when specifying some of the values for the resource. For example, if you entered an instance count of three, the names of the operating system disks are myOSDisk1, myOSDisk2, and myOSDisk3:
230230

231-
```
231+
```json
232232
"osDisk": {
233233
"name": "[concat('myOSDisk', copyindex())]",
234234
"caching": "ReadWrite",
@@ -243,7 +243,7 @@ Also, notice in the example that the loop index is used when specifying some of
243243
244244
Keep in mind that creating a loop for one resource in the template may require you to use the loop when creating or accessing other resources. For example, multiple VMs can’t use the same network interface, so if your template loops through creating three VMs it must also loop through creating three network interfaces. When assigning a network interface to a VM, the loop index is used to identify it:
245245

246-
```
246+
```json
247247
"networkInterfaces": [ {
248248
"id": "[resourceId('Microsoft.Network/networkInterfaces',
249249
concat('myNIC', copyindex()))]"
@@ -254,7 +254,7 @@ Keep in mind that creating a loop for one resource in the template may require y
254254

255255
Most resources depend on other resources to work correctly. Virtual machines must be associated with a virtual network and to do that it needs a network interface. The [dependsOn](../../resource-group-define-dependencies.md) element is used to make sure that the network interface is ready to be used before the VMs are created:
256256

257-
```
257+
```json
258258
"dependsOn": [
259259
"[concat('Microsoft.Network/networkInterfaces/', 'myNIC', copyindex())]"
260260
],
@@ -264,7 +264,7 @@ Resource Manager deploys in parallel any resources that aren't dependent on anot
264264

265265
How do you know if a dependency is required? Look at the values you set in the template. If an element in the virtual machine resource definition points to another resource that is deployed in the same template, you need a dependency. For example, your example virtual machine defines a network profile:
266266

267-
```
267+
```json
268268
"networkProfile": {
269269
"networkInterfaces": [ {
270270
"id": "[resourceId('Microsoft.Network/networkInterfaces',
@@ -293,7 +293,7 @@ In Azure, vhd files can represent [disks or images](managed-disks-overview.md?to
293293

294294
When you create a VM, you must decide what operating system to use. The imageReference element is used to define the operating system of a new VM. The example shows a definition for a Windows Server operating system:
295295

296-
```
296+
```json
297297
"imageReference": {
298298
"publisher": "MicrosoftWindowsServer",
299299
"offer": "WindowsServer",
@@ -304,7 +304,7 @@ When you create a VM, you must decide what operating system to use. The imageRef
304304

305305
If you want to create a Linux operating system, you might use this definition:
306306

307-
```
307+
```json
308308
"imageReference": {
309309
"publisher": "Canonical",
310310
"offer": "UbuntuServer",
@@ -315,7 +315,7 @@ If you want to create a Linux operating system, you might use this definition:
315315

316316
Configuration settings for the operating system disk are assigned with the osDisk element. The example defines a new managed disk with the caching mode set to **ReadWrite** and that the disk is being created from a [platform image](cli-ps-findimage.md):
317317

318-
```
318+
```json
319319
"osDisk": {
320320
"name": "[concat('myOSDisk', copyindex())]",
321321
"caching": "ReadWrite",
@@ -327,7 +327,7 @@ Configuration settings for the operating system disk are assigned with the osDis
327327

328328
If you want to create virtual machines from existing disks, remove the imageReference and the osProfile elements and define these disk settings:
329329

330-
```
330+
```json
331331
"osDisk": {
332332
"osType": "Windows",
333333
"managedDisk": {
@@ -342,7 +342,7 @@ If you want to create virtual machines from existing disks, remove the imageRefe
342342

343343
If you want to create a virtual machine from a managed image, change the imageReference element and define these disk settings:
344344

345-
```
345+
```json
346346
"storageProfile": {
347347
"imageReference": {
348348
"id": "[resourceId('Microsoft.Compute/images', 'myImage')]"
@@ -360,7 +360,7 @@ If you want to create a virtual machine from a managed image, change the imageRe
360360

361361
You can optionally add data disks to the VMs. The [number of disks](sizes.md) depends on the size of operating system disk that you use. With the size of the VMs set to Standard_DS1_v2, the maximum number of data disks that could be added to the them is two. In the example, one managed data disk is being added to each VM:
362362

363-
```
363+
```json
364364
"dataDisks": [
365365
{
366366
"name": "[concat('myDataDisk', copyindex())]",
@@ -376,7 +376,7 @@ You can optionally add data disks to the VMs. The [number of disks](sizes.md) de
376376

377377
Although [extensions](extensions-features.md) are a separate resource, they're closely tied to VMs. Extensions can be added as a child resource of the VM or as a separate resource. The example shows the [Diagnostics Extension](extensions-diagnostics-template.md) being added to the VMs:
378378

379-
```
379+
```json
380380
{
381381
"name": "Microsoft.Insights.VMDiagnosticsSettings",
382382
"type": "extensions",
@@ -411,7 +411,7 @@ This extension resource uses the storageName variable and the diagnostic variabl
411411

412412
There are many extensions that you can install on a VM, but the most useful is probably the [Custom Script Extension](extensions-customscript.md). In the example, a PowerShell script named start.ps1 runs on each VM when it first starts:
413413

414-
```
414+
```json
415415
{
416416
"name": "MyCustomScriptExtension",
417417
"type": "extensions",

articles/virtual-machines/workloads/sap/deployment-guide.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -784,9 +784,11 @@ This section has detailed steps for doing specific tasks in the configuration an
784784
Check frequently for updates to the PowerShell cmdlets, which usually are updated monthly. The easiest way to check for updates is to do the preceding installation steps, up to the installation page shown in step 5. The release date and release number of the cmdlets are included on the page shown in step 5. Unless stated otherwise in SAP Note [1928533] or SAP Note [2015553], we recommend that you work with the latest version of Azure PowerShell cmdlets.
785785

786786
To check the version of the Azure PowerShell cmdlets that are installed on your computer, run this PowerShell command:
787+
787788
```powershell
788789
(Get-Module Az.Compute).Version
789790
```
791+
790792
The result looks like this:
791793

792794
![Result of Azure PowerShell cmdlet version check][deployment-guide-figure-600]
@@ -813,7 +815,8 @@ If the Azure cmdlet version installed on your computer is the current version, t
813815
Check frequently for updates to Azure CLI, which usually is updated monthly. The easiest way to check for updates is to do the preceding installation steps, up to the installation page shown in step 5.
814816

815817
To check the version of Azure CLI that is installed on your computer, run this command:
816-
```
818+
819+
```console
817820
azure --version
818821
```
819822

@@ -854,13 +857,13 @@ Use the following commands to install the VM Agent for Linux:
854857

855858
* **SUSE Linux Enterprise Server (SLES)**
856859

857-
```
860+
```console
858861
sudo zypper install WALinuxAgent
859862
```
860863

861864
* **Red Hat Enterprise Linux (RHEL) or Oracle Linux**
862865

863-
```
866+
```console
864867
sudo yum install WALinuxAgent
865868
```
866869

@@ -890,18 +893,22 @@ Configure the correct proxy in the configuration file of the Microsoft Azure Gue
890893
Set the following parameters:
891894

892895
1. **HTTP proxy host**. For example, set it to **proxy.corp.local**.
893-
```
896+
897+
```console
894898
HttpProxy.Host=<proxy host>
895899

896900
```
901+
897902
1. **HTTP proxy port**. For example, set it to **80**.
898-
```
903+
904+
```console
899905
HttpProxy.Port=<port of the proxy host>
900906

901907
```
908+
902909
1. Restart the agent.
903910

904-
```
911+
```console
905912
sudo service waagent restart
906913
```
907914

@@ -970,19 +977,19 @@ To install the Azure Extension for SAP by using Azure CLI:
970977
1. Install Azure classic CLI, as described in [Install the Azure classic CLI][azure-cli].
971978
1. Sign in with your Azure account:
972979
973-
```
980+
```console
974981
azure login
975982
```
976983
977984
1. Switch to Azure Resource Manager mode:
978985
979-
```
986+
```console
980987
azure config mode arm
981988
```
982989
983990
1. Enable Azure Extension for SAP:
984991
985-
```
992+
```console
986993
azure vm enable-aem <resource-group-name> <vm-name>
987994
```
988995
@@ -991,30 +998,31 @@ To install the Azure Extension for SAP by using Azure CLI:
991998
1. Install Azure CLI 2.0, as described in [Install Azure CLI 2.0][azure-cli-2].
992999
1. Sign in with your Azure account:
9931000
994-
```
1001+
```azurecli
9951002
az login
9961003
```
9971004
9981005
1. Install Azure CLI AEM Extension
9991006
1000-
```
1007+
```azurecli
10011008
az extension add --name aem
10021009
```
10031010
10041011
1. Install the extension with
10051012
1006-
```
1013+
```azurecli
10071014
az vm aem set -g <resource-group-name> -n <vm name>
10081015
```
10091016
10101017
1. Verify that the Azure Extension for SAP is active on the Azure Linux VM. Check whether the file \\var\\lib\\AzureEnhancedMonitor\\PerfCounters exists. If it exists, at a command prompt, run this command to display information collected by the Azure Extension for SAP:
10111018
1012-
```
1019+
```console
10131020
cat /var/lib/AzureEnhancedMonitor/PerfCounters
10141021
```
10151022

10161023
The output looks like this:
1017-
```
1024+
1025+
```output
10181026
...
10191027
2;cpu;Current Hw Frequency;;0;2194.659;MHz;60;1444036656;saplnxmon;
10201028
2;cpu;Max Hw Frequency;;0;2194.659;MHz;0;1444036656;saplnxmon;
@@ -1133,6 +1141,7 @@ If some of the infrastructure data is not delivered correctly as indicated by th
11331141

11341142
1. Make sure that you have installed the latest version of the Azure PowerShell cmdlet, as described in [Deploying Azure PowerShell cmdlets][deployment-guide-4.1].
11351143
1. Run the following PowerShell cmdlet. For a list of available environments, run the cmdlet `Get-AzEnvironment`. To use global Azure, select the **AzureCloud** environment. For Azure in China, select **AzureChinaCloud**.
1144+
11361145
```powershell
11371146
$env = Get-AzEnvironment -Name <name of the environment>
11381147
Connect-AzAccount -Environment $env

articles/virtual-machines/workloads/sap/high-availability-guide-standard-load-balancer-outbound-connections.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The configuration would look like:
9999
1. Select the VMs and their IP addresses and add them to the backend pool
100100
3. [Create outbound rules](https://docs.microsoft.com/azure/load-balancer/configure-load-balancer-outbound-cli#create-outbound-rule). Currently it is not possible to create outbound rules from the Azure portal. You can create outbound rules with [Azure CLI](https://docs.microsoft.com/azure/cloud-shell/overview?view=azure-cli-latest).
101101

102-
```
102+
```azurecli
103103
az network lb outbound-rule create --address-pool MyBackendPoolOfPublicILB --frontend-ip-configs MyPublicILBFrondEndIP --idle-timeout 30 --lb-name MyPublicILB --name MyOutBoundRules --outbound-ports 10000 --enable-tcp-reset true --protocol All --resource-group MyResourceGroup
104104
```
105105

@@ -186,17 +186,19 @@ You could use proxy to allow Pacemaker calls to the Azure management API public
186186
There are many different Proxy options available in the industry. Step-by-step instructions for the proxy deployment are outside of the scope of this document. In the example below, we assume that your proxy is responding to **MyProxyService** and listening to port **MyProxyPort**.
187187
To allow pacemaker to communicate with the Azure management API, perform the following steps on all cluster nodes:
188188

189-
1. Edit the pacemaker configuration file /etc/sysconfig/pacemaker and add the following lines (all cluster nodes):
190-
```
189+
1. Edit the pacemaker configuration file /etc/sysconfig/pacemaker and add the following lines (all cluster nodes):
190+
191+
```console
191192
sudo vi /etc/sysconfig/pacemaker
192193
# Add the following lines
193194
http_proxy=http://MyProxyService:MyProxyPort
194195
https_proxy=http://MyProxyService:MyProxyPort
195196
```
196197

197198
2. Restart the pacemaker service on **all** cluster nodes.
198-
- SUSE
199-
```
199+
- SUSE
200+
201+
```console
200202
# Place the cluster in maintenance mode
201203
sudo crm configure property maintenance-mode=true
202204
#Restart on all nodes
@@ -206,7 +208,8 @@ To allow pacemaker to communicate with the Azure management API, perform the fol
206208
```
207209

208210
- Red Hat
209-
```
211+
212+
```console
210213
# Place the cluster in maintenance mode
211214
sudo pcs property set maintenance-mode=true
212215
#Restart on all nodes

0 commit comments

Comments
 (0)