Skip to content

Commit 787e393

Browse files
authored
Merge pull request #104727 from TimShererWithAquent/us1669724b
[Azure CLI code blocks]
2 parents a53a069 + 7e8f75d commit 787e393

13 files changed

+71
-55
lines changed

articles/ansible/ansible-create-configure-mysql.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ms.date: 04/30/2019
1919
> * Create a MySql server
2020
> * Create a MySql database
2121
> * Configure a firewall rule so that an external app can connect to your server
22-
> * Connect to your MySql server from the Azure cloud shell
22+
> * Connect to your MySql server from the Azure Cloud Shell
2323
> * Query your available MySQL servers
2424
> * List all databases in your connected servers
2525
@@ -150,11 +150,15 @@ ansible-playbook mysql_firewall.yml
150150

151151
## Connect to the server
152152

153-
In this section, you use the Azure cloud shell to connect to the server you created previously.
153+
In this section, you use the Azure Cloud Shell to connect to the server you created previously.
154154

155-
1. Select the **Try It** button in the following code:
155+
1. Open shell.azure.com by selecting below.
156156

157-
```azurecli-interactive
157+
[![Embed launch](https://shell.azure.com/images/launchcloudshell.png "Launch Azure Cloud Shell")](https://shell.azure.com)
158+
159+
1. Enter the following code:
160+
161+
```sql
158162
mysql -h mysqlserveransible.mysql.database.azure.com -u mysqladmin@mysqlserveransible -p
159163
```
160164

@@ -166,7 +170,7 @@ In this section, you use the Azure cloud shell to connect to the server you crea
166170

167171
If everything goes well, you see output similar to the following results:
168172

169-
```
173+
```output
170174
demo@Azure:~$ mysql -h mysqlserveransible.mysql.database.azure.com -u mysqladmin@mysqlserveransible -p
171175
Enter password:
172176
Welcome to the MySQL monitor. Commands end with ; or \g.

articles/ansible/ansible-manage-azure-dynamic-inventories.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,25 @@ Ansible provides a Python script named [azure_rm.py](https://github.com/ansible/
8686

8787
1. Use the GNU `wget` command to retrieve the `azure_rm.py` script:
8888

89-
```azurecli-interactive
89+
```python
9090
wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/azure_rm.py
9191
```
9292

9393
1. Use the `chmod` command to change the access permissions to the `azure_rm.py` script. The following command uses the `+x` parameter to allow for execution (running) of the specified file (`azure_rm.py`):
9494

95-
```azurecli-interactive
95+
```python
9696
chmod +x azure_rm.py
9797
```
9898

9999
1. Use the [ansible command](https://docs.ansible.com/ansible/2.4/ansible.html) to connect to your resource group:
100100

101-
```azurecli-interactive
101+
```python
102102
ansible -i azure_rm.py ansible-inventory-test-rg -m ping
103103
```
104104

105105
1. Once connected, you see results similar to the following output:
106106

107-
```Output
107+
```output
108108
ansible-inventory-test-vm1 | SUCCESS => {
109109
"changed": false,
110110
"failed": false,
@@ -142,7 +142,7 @@ Starting with Ansible 2.8, Ansible provides an [Azure dynamic-inventory plug-in]
142142

143143
1. When running the preceding command, you could receive the following error:
144144

145-
```Output
145+
```output
146146
Failed to connect to the host via ssh: Host key verification failed.
147147
```
148148

@@ -154,7 +154,7 @@ Starting with Ansible 2.8, Ansible provides an [Azure dynamic-inventory plug-in]
154154

155155
1. When you run the playbook, you see results similar to the following output:
156156

157-
```Output
157+
```output
158158
ansible-inventory-test-vm1_0324 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
159159
ansible-inventory-test-vm2_8971 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
160160
```
@@ -165,7 +165,7 @@ Starting with Ansible 2.8, Ansible provides an [Azure dynamic-inventory plug-in]
165165

166166
- Once you've set a tag, you need to "enable" that tag. One way to enable a tag is by exporting the tag to an environment variable `AZURE_TAGS` via the `export` command:
167167

168-
```azurecli-interactive
168+
```console
169169
export AZURE_TAGS=nginx
170170
```
171171

@@ -177,7 +177,7 @@ Starting with Ansible 2.8, Ansible provides an [Azure dynamic-inventory plug-in]
177177

178178
You now see only one virtual machine (the one whose tag matches the value exported into the `AZURE_TAGS` environment variable):
179179

180-
```Output
180+
```output
181181
ansible-inventory-test-vm1 | SUCCESS => {
182182
"changed": false,
183183
"failed": false,
@@ -189,7 +189,7 @@ Starting with Ansible 2.8, Ansible provides an [Azure dynamic-inventory plug-in]
189189

190190
- Run the command `ansible-inventory -i myazure_rm.yml --graph` to get the following output:
191191

192-
```Output
192+
```output
193193
@all:
194194
|--@tag_Ansible_nginx:
195195
| |--ansible-inventory-test-vm1_9e2f
@@ -210,7 +210,7 @@ The purpose of tags is to enable the ability to quickly and easily work with sub
210210

211211
1. Create a file named `nginx.yml`:
212212

213-
```azurecli-interactive
213+
```console
214214
code nginx.yml
215215
```
216216

@@ -250,7 +250,7 @@ The purpose of tags is to enable the ability to quickly and easily work with sub
250250

251251
1. After running the playbook, you see output similar to the following results:
252252

253-
```Output
253+
```output
254254
PLAY [Install and start Nginx on an Azure virtual machine]
255255
256256
TASK [Gathering Facts]
@@ -280,13 +280,13 @@ This section illustrates one technique to test that Nginx is installed on your v
280280

281281
1. While connected to the `ansible-inventory-test-vm1` virtual machine, run the [nginx -v](https://nginx.org/en/docs/switches.html) command to determine if Nginx is installed.
282282

283-
```azurecli-interactive
283+
```console
284284
nginx -v
285285
```
286286

287287
1. Once you run the `nginx -v` command, you see the Nginx version (second line) that indicates that Nginx is installed.
288288

289-
```Output
289+
```output
290290
tom@ansible-inventory-test-vm1:~$ nginx -v
291291
292292
nginx version: nginx/1.10.3 (Ubuntu)
@@ -298,7 +298,7 @@ This section illustrates one technique to test that Nginx is installed on your v
298298

299299
1. Doing the preceding steps for the `ansible-inventory-test-vm2` virtual machine yields an informational message indicating where you can get Nginx (which implies that you don't have it installed at this point):
300300

301-
```Output
301+
```output
302302
tom@ansible-inventory-test-vm2:~$ nginx -v
303303
The program 'nginx' can be found in the following packages:
304304
* nginx-core

articles/ansible/ansible-run-playbook-in-cloudshell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.date: 04/30/2019
88

99
# Quickstart: Run Ansible playbooks via Bash in Azure Cloud Shell
1010

11-
Azure Cloud Shell is an interactive, browser-accessible shell for managing Azure resources. Cloud Shell provides enables you to use either a Bash or Powershell command line. In this article, you use Bash within Azure Cloud Shell to run an Ansible playbook.
11+
Azure Cloud Shell is an interactive, browser-accessible shell for managing Azure resources. Cloud Shell provides enables you to use either a Bash or PowerShell command line. In this article, you use Bash within Azure Cloud Shell to run an Ansible playbook.
1212

1313
## Prerequisites
1414

@@ -30,7 +30,7 @@ az account list
3030

3131
Using your Azure subscription ID, set the `AZURE_SUBSCRIPTION_ID` as follows:
3232

33-
```azurecli-interactive
33+
```console
3434
export AZURE_SUBSCRIPTION_ID=<your-subscription-id>
3535
```
3636

articles/app-service/app-service-web-get-started-nodejs.experimental.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'QuickStart: Create a Node.js web app'
2+
title: 'Quickstart: Create a Node.js web app'
33
description: Deploy your first Node.js Hello World to Azure App Service in minutes. You deploy using a ZIP package, which is one of many ways to deploy to App Service.
44
ms.assetid: 582bb3c2-164b-42f5-b081-95bfcb7a502a
55
ms.topic: quickstart
@@ -30,21 +30,21 @@ You can follow the steps here using a Mac, Windows, or Linux machine. It takes a
3030

3131
In the Cloud Shell, create a quickstart directory and then change to it.
3232

33-
```azurecli-interactive
33+
```console
3434
mkdir quickstart
3535

3636
cd $HOME/quickstart
3737
```
3838

3939
Next, run the following command to clone the sample app repository to your quickstart directory.
4040

41-
```azurecli-interactive
41+
```console
4242
git clone https://github.com/Azure-Samples/nodejs-docs-hello-world
4343
```
4444

4545
While running, it displays information similar to the following example:
4646

47-
```bash
47+
```output
4848
Cloning into 'nodejs-docs-hello-world'...
4949
remote: Counting objects: 40, done.
5050
remote: Total 40 (delta 0), reused 0 (delta 0), pack-reused 40
@@ -98,7 +98,7 @@ az webapp config appsettings set --resource-group myResourceGroup --name <app_na
9898

9999
Browse to your newly created web app. Replace `<app_name>` with a unique app name.
100100

101-
```
101+
```http
102102
http://<app_name>.azurewebsites.net
103103
```
104104

@@ -109,7 +109,7 @@ Here is what your new web app should look like:
109109

110110
In the Cloud Shell, navigate to your application's root directory, create a new ZIP file for your sample project.
111111

112-
```azurecli-interactive
112+
```console
113113
cd nodejs-docs-hello-world
114114

115115
zip -r myUpdatedAppFiles.zip *.*
@@ -127,7 +127,7 @@ This command deploys the files and directories from the ZIP file to your default
127127

128128
Browse to the deployed application using your web browser.
129129

130-
```
130+
```http
131131
http://<app_name>.azurewebsites.net
132132
```
133133

articles/app-service/containers/app-service-linux-ssh-support.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,28 @@ az webapp create-remote-connection --subscription <subscription-id> --resource-g
4848
4949
The command output gives you the information you need to open an SSH session.
5050

51-
```
51+
```output
5252
Port 21382 is open
5353
SSH is available { username: root, password: Docker! }
5454
Start your favorite client and connect to port 21382
5555
```
5656

5757
Open an SSH session with your container with the client of your choice, using the local port. The following example uses the default [ssh](https://ss64.com/bash/ssh.html) command:
5858

59-
```azurecli-interactive
59+
```bash
6060
ssh [email protected] -p <port>
6161
```
6262

6363
When being prompted, type `yes` to continue connecting. You are then prompted for the password. Use `Docker!`, which was shown to you earlier.
6464

65-
```
65+
```output
6666
Warning: Permanently added '[127.0.0.1]:21382' (ECDSA) to the list of known hosts.
6767
[email protected]'s password:
6868
```
6969

7070
Once you're authenticated, you should see the session welcome screen.
7171

72-
```
72+
```output
7373
_____
7474
/ _ \ __________ _________ ____
7575
/ /_\ \___ / | \_ __ \_/ __ \
@@ -85,7 +85,7 @@ You are now connected to your connector.
8585

8686
Try running the [top](https://ss64.com/bash/top.html) command. You should be able to see your app's process in the process list. In the example output below, it's the one with `PID 263`.
8787

88-
```
88+
```output
8989
Mem: 1578756K used, 127032K free, 8744K shrd, 201592K buff, 341348K cached
9090
CPU: 3% usr 3% sys 0% nic 92% idle 0% io 0% irq 0% sirq
9191
Load average: 0.07 0.04 0.08 4/765 45738

articles/azure-resource-manager/managed-applications/test-createuidefinition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ For PowerShell, use:
6262

6363
For Azure CLI, use:
6464

65-
```azurecli
65+
```bash
6666
./sideload-createuidef.sh \
6767
-l southcentralus \
6868
-a .\100-Marketplace-Sample
@@ -78,7 +78,7 @@ For PowerShell, use:
7878

7979
For Azure CLI, use:
8080

81-
```azurecli
81+
```bash
8282
./sideload-createuidef.sh
8383
```
8484

articles/container-registry/container-registry-tutorial-base-image-update.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ If you haven't already done so, complete the following tutorials before proceedi
4949

5050
Populate these shell environment variables with values appropriate for your environment. This step isn't strictly required, but makes executing the multiline Azure CLI commands in this tutorial a bit easier. If you don't populate these environment variables, you must manually replace each value wherever it appears in the example commands.
5151

52-
```azurecli-interactive
52+
[![Embed launch](https://shell.azure.com/images/launchcloudshell.png "Launch Azure Cloud Shell")](https://shell.azure.com)
53+
54+
```console
5355
ACR_NAME=<registry-name> # The name of your Azure container registry
5456
GIT_USER=<github-username> # Your GitHub user account name
5557
GIT_PAT=<personal-access-token> # The PAT you generated in the second tutorial

articles/container-registry/container-registry-tutorial-build-task.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ Now that you've completed the steps required to enable ACR Tasks to read commit
3939

4040
First, populate these shell environment variables with values appropriate for your environment. This step isn't strictly required, but makes executing the multiline Azure CLI commands in this tutorial a bit easier. If you don't populate these environment variables, you must manually replace each value wherever it appears in the example commands.
4141

42-
```azurecli-interactive
42+
[![Embed launch](https://shell.azure.com/images/launchcloudshell.png "Launch Azure Cloud Shell")](https://shell.azure.com)
43+
44+
```console
4345
ACR_NAME=<registry-name> # The name of your Azure container registry
4446
GIT_USER=<github-username> # Your GitHub user account name
4547
GIT_PAT=<personal-access-token> # The PAT you generated in the previous section
@@ -205,13 +207,13 @@ Now that you've tested the task by manually running it, trigger it automatically
205207

206208
First, ensure you're in the directory containing your local clone of the [repository][sample-repo]:
207209

208-
```azurecli-interactive
210+
```console
209211
cd acr-build-helloworld-node
210212
```
211213

212214
Next, execute the following commands to create, commit, and push a new file to your fork of the repo on GitHub:
213215

214-
```azurecli-interactive
216+
```console
215217
echo "Hello World!" > hello.txt
216218
git add hello.txt
217219
git commit -m "Testing ACR Tasks"

articles/container-registry/container-registry-tutorial-multistep-task.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ This multi-step task does the following:
6666

6767
First, populate these shell environment variables with values appropriate for your environment. This step isn't strictly required, but makes executing the multiline Azure CLI commands in this tutorial a bit easier. If you don't populate these environment variables, you must manually replace each value wherever it appears in the example commands.
6868

69-
```azurecli-interactive
69+
[![Embed launch](https://shell.azure.com/images/launchcloudshell.png "Launch Azure Cloud Shell")](https://shell.azure.com)
70+
71+
```console
7072
ACR_NAME=<registry-name> # The name of your Azure container registry
7173
GIT_USER=<github-username> # Your GitHub user account name
7274
GIT_PAT=<personal-access-token> # The PAT you generated in the previous section
@@ -214,13 +216,13 @@ Now that you've tested the task by manually running it, trigger it automatically
214216

215217
First, ensure you're in the directory containing your local clone of the [repository][sample-repo]:
216218

217-
```azurecli-interactive
219+
```console
218220
cd acr-build-helloworld-node
219221
```
220222

221223
Next, execute the following commands to create, commit, and push a new file to your fork of the repo on GitHub:
222224

223-
```azurecli-interactive
225+
```console
224226
echo "Hello World!" > hello.txt
225227
git add hello.txt
226228
git commit -m "Testing ACR Tasks"

articles/container-registry/container-registry-tutorial-quick-task.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ Once you've forked the repo, clone your fork and enter the directory containing
5050

5151
Clone the repo with `git`, replace **\<your-github-username\>** with your GitHub username:
5252

53-
```azurecli-interactive
53+
```console
5454
git clone https://github.com/<your-github-username>/acr-build-helloworld-node
5555
```
5656

5757
Enter the directory containing the source code:
5858

59-
```azurecli-interactive
59+
```console
6060
cd acr-build-helloworld-node
6161
```
6262

@@ -70,7 +70,9 @@ Now that you've pulled the source code down to your machine, follow these steps
7070

7171
To make executing the sample commands easier, the tutorials in this series use shell environment variables. Execute the following command to set the `ACR_NAME` variable. Replace **\<registry-name\>** with a unique name for your new container registry. The registry name must be unique within Azure, contain only lower case letters, and contain 5-50 alphanumeric characters. The other resources you create in the tutorial are based on this name, so you should need to modify only this first variable.
7272

73-
```azurecli-interactive
73+
[![Embed launch](https://shell.azure.com/images/launchcloudshell.png "Launch Azure Cloud Shell")](https://shell.azure.com)
74+
75+
```console
7476
ACR_NAME=<registry-name>
7577
```
7678

0 commit comments

Comments
 (0)