Skip to content

Commit 13181d1

Browse files
authored
Merge pull request #106657 from v-thepet/azurecli3
Fix azurecli tags
2 parents c77af3e + e05f47f commit 13181d1

File tree

8 files changed

+62
-44
lines changed

8 files changed

+62
-44
lines changed

articles/app-service/containers/quickstart-python.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The Azure CLI provides you with many convenient commands that you use from a loc
8686

8787
To run Azure commands in the Azure CLI, you must first sign in using the `az login` command. This command opens a browser to gather your credentials.
8888

89-
```terminal
89+
```azurecli
9090
az login
9191
```
9292

@@ -97,11 +97,11 @@ The [`az webapp up`](/cli/azure/webapp#az-webapp-up) command creates the web app
9797
In the *python-docs-hello-world* folder that contains the sample code, run the following `az webapp up` command. Replace `<app-name>` with a globally unique app name (*valid characters are `a-z`, `0-9`, and `-`*). Also replace `<location-name>` with an Azure region such as **centralus**, **eastasia**, **westeurope**, **koreasouth**, **brazilsouth**, **centralindia**, and so on. (You can retrieve a list of allowable regions for your Azure account by running the [`az account list-locations`](/cli/azure/appservice?view=azure-cli-latest.md#az-appservice-list-locations) command.)
9898

9999

100-
```terminal
100+
```azurecli
101101
az webapp up --sku F1 -n <app-name> -l <location-name>
102102
```
103103

104-
This command may take a few minutes complete run. While running, it displays information similar to the following example:
104+
This command may take a few minutes to completely run. While running, it displays information similar to the following example:
105105

106106
```output
107107
The behavior of this command has been altered by the following extension: webapp
@@ -153,7 +153,7 @@ Save your changes and exit the editor.
153153

154154
Redeploy the app using the following `az webapp up` command, using the same command you used to deploy the app the first time, replacing `<app-name>` and `<location-name>` with the same names you used before.
155155

156-
```terminal
156+
```azurecli
157157
az webapp up --sku F1 -n <app-name> -l <location-name>
158158
```
159159

@@ -170,13 +170,13 @@ You can access the console logs generated from inside the app and the container
170170

171171
First, turn on container logging by running the following command in a terminal, replacing `<app-name>` with the name of your app and `<resource-group-name>` with the name of the resource group shown in the output of the `az webapp up` command you used (such as "appsvc_rg_Linux_centralus"):
172172

173-
```terminal
173+
```azurecli
174174
az webapp log config --name <app-name> --resource-group <resource-group-name> --docker-container-logging filesystem
175175
```
176176

177177
Once container logging is turned on, run the following command to show the log stream:
178178

179-
```terminal
179+
```azurecli
180180
az webapp log tail --name <app-name> --resource-group <resource-group-name>
181181
```
182182

@@ -213,7 +213,7 @@ In the preceding steps, you created Azure resources in a resource group. The res
213213

214214
If you don't expect to need these resources in the future, delete the resource group by running the following command, replacing `<resource-group-name>` with the resource group shown in the output of the `az webapp up` command, such as "appsvc_rg_Linux_centralus". The command may take a minute to complete.
215215

216-
```terminal
216+
```azurecli
217217
az group delete -n <resource-group-name>
218218
```
219219

articles/dev-spaces/how-to/ingress-https-nginx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ This article shows you how to configure Azure Dev Spaces to use a custom NGINX i
2424

2525
Connect to your cluster using [kubectl][kubectl], the Kubernetes command-line client. To configure `kubectl` to connect to your Kubernetes cluster, use the [az aks get-credentials][az-aks-get-credentials] command. This command downloads credentials and configures the Kubernetes CLI to use them.
2626

27-
```azurecli-interactive
27+
```azurecli
2828
az aks get-credentials --resource-group myResourceGroup --name myAKS
2929
```
3030

3131
To verify the connection to your cluster, use the [kubectl get][kubectl-get] command to return a list of the cluster nodes.
3232

3333
```console
34-
$ kubectl get nodes
34+
kubectl get nodes
3535
NAME STATUS ROLES AGE VERSION
3636
aks-nodepool1-12345678-vmssfedcba Ready agent 13m v1.14.1
3737
```
@@ -74,7 +74,7 @@ nginx-nginx-ingress-controller LoadBalancer 10.0.19.39 MY_EXTERNAL_
7474

7575
Add an *A* record to your DNS zone with the external IP address of the NGINX service using [az network dns record-set a add-record][az-network-dns-record-set-a-add-record].
7676

77-
```console
77+
```azurecli
7878
az network dns record-set a add-record \
7979
--resource-group myResourceGroup \
8080
--zone-name MY_CUSTOM_DOMAIN \

articles/dev-spaces/how-to/ingress-https-traefik.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ This article shows you how to configure Azure Dev Spaces to use a custom traefik
2424

2525
Connect to your cluster using [kubectl][kubectl], the Kubernetes command-line client. To configure `kubectl` to connect to your Kubernetes cluster, use the [az aks get-credentials][az-aks-get-credentials] command. This command downloads credentials and configures the Kubernetes CLI to use them.
2626

27-
```azurecli-interactive
27+
```azurecli
2828
az aks get-credentials --resource-group myResourceGroup --name myAKS
2929
```
3030

3131
To verify the connection to your cluster, use the [kubectl get][kubectl-get] command to return a list of the cluster nodes.
3232

3333
```console
34-
$ kubectl get nodes
34+
kubectl get nodes
3535
NAME STATUS ROLES AGE VERSION
3636
aks-nodepool1-12345678-vmssfedcba Ready agent 13m v1.14.1
3737
```
@@ -76,7 +76,7 @@ traefik LoadBalancer 10.0.205.78 MY_EXTERNAL_IP 80:32484/TCP,443:30620/T
7676

7777
Add an *A* record to your DNS zone with the external IP address of the traefik service using [az network dns record-set a add-record][az-network-dns-record-set-a-add-record].
7878

79-
```console
79+
```azurecli
8080
az network dns record-set a add-record \
8181
--resource-group myResourceGroup \
8282
--zone-name MY_CUSTOM_DOMAIN \

articles/dev-spaces/troubleshooting.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,15 @@ Azure Dev Spaces couldn't create a controller on your AKS cluster because it cou
7070

7171
To fix this issue, [update your taint configuration](../aks/operator-best-practices-advanced-scheduler.md#provide-dedicated-nodes-using-taints-and-tolerations) on your AKS cluster to ensure at least one Linux node allows for scheduling pods without specifying tolerations. Also, ensure that at least one Linux node that allows scheduling pods without specifying tolerations is in the *Ready* state. If your node is taking a long time to reach the *Ready* state, you can try restarting your node.
7272

73-
### Error "Azure Dev Spaces CLI not installed properly" when running `az aks use-dev-spaces`
73+
### Error "Azure Dev Spaces CLI not installed properly" when running az aks use-dev-spaces
7474

7575
An update to the Azure Dev Spaces CLI changed its installation path. If you're using a version of the Azure CLI earlier than 2.0.63, you may see this error. To display your version of the Azure CLI, use `az --version`.
7676

7777
```azurecli
7878
az --version
79+
```
80+
81+
```output
7982
azure-cli 2.0.60 *
8083
...
8184
```
@@ -120,7 +123,7 @@ This timeout occurs when you attempt to use Dev Spaces to run a service that is
120123
If you run `azds up` with the `--verbose` switch, or enable verbose logging in Visual Studio, you see additional detail:
121124

122125
```cmd
123-
$ azds up --verbose
126+
azds up --verbose
124127
125128
Installed chart in 2s
126129
Waiting for container image build...
@@ -351,10 +354,13 @@ kubectl get pods --all-namespaces --include-uninitialized
351354

352355
This issue can impact pods in *all namespaces* in the cluster including namespaces where Azure Dev Spaces is not enabled.
353356

354-
To fix this issue, [update the Dev Spaces CLI to the latest version](./how-to/upgrade-tools.md#update-the-dev-spaces-cli-extension-and-command-line-tools) and then deleting the *azds InitializerConfiguration* from the Azure Dev Spaces controller:
357+
To fix this issue, [update the Dev Spaces CLI to the latest version](./how-to/upgrade-tools.md#update-the-dev-spaces-cli-extension-and-command-line-tools) and then delete the *azds InitializerConfiguration* from the Azure Dev Spaces controller:
355358

356359
```azurecli
357360
az aks get-credentials --resource-group <resource group name> --name <cluster name>
361+
```
362+
363+
```bash
358364
kubectl delete InitializerConfiguration azds
359365
```
360366

@@ -489,5 +495,8 @@ To fix this issue, ensure your *kubeconfig* has the updated certificates using `
489495

490496
```azurecli
491497
az aks get-credentials -g <resource group name> -n <cluster name>
498+
```
499+
500+
```console
492501
azds controller refresh-credentials -g <resource group name> -n <cluster name>
493502
```

articles/dns/dns-import-export.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ As with the zone import, you first need to sign in, choose your subscription, an
168168

169169
To export the existing Azure DNS zone **contoso.com** in resource group **myresourcegroup** to the file **contoso.com.txt** (in the current folder), run `azure network dns zone export`. This command calls the Azure DNS service to enumerate record sets in the zone and export the results to a BIND-compatible zone file.
170170

171-
```
171+
```azurecli
172172
az network dns zone export -g myresourcegroup -n contoso.com -f contoso.com.txt
173173
```
174174

articles/dns/dns-protect-zones-recordsets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ New-AzResourceLock -LockLevel $lvl -LockName $lnm -ResourceName $rsc -ResourceTy
213213

214214
The equivalent command is also [available via the Azure CLI](https://docs.microsoft.com/cli/azure/lock?view=azure-cli-latest#az-lock-create):
215215

216-
```azurecli-interactive
216+
```azurecli
217217
# Lock a DNS zone
218218
219219
az lock create \

articles/service-fabric/service-fabric-diagnostics-oms-agent.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ The best way to add the Log Analytics agent to your cluster is via the virtual m
2929

3030
3. Click on **Windows Servers** if you are standing up a Windows cluster, and **Linux Servers** if you are creating a Linux cluster. This page will show you your `workspace ID` and `workspace key` (listed as Primary Key in the portal). You will need both for the next step.
3131

32-
4. Run the command to install the Log Analytics agent onto your cluster, using the `vmss extension set` API in your Cloud Shell:
32+
4. Run the command to install the Log Analytics agent onto your cluster, using the `vmss extension set` API:
3333

3434
For a Windows cluster:
3535

36-
```sh
36+
```azurecli
3737
az vmss extension set --name MicrosoftMonitoringAgent --publisher Microsoft.EnterpriseCloud.Monitoring --resource-group <nameOfResourceGroup> --vmss-name <nameOfNodeType> --settings "{'workspaceId':'<Log AnalyticsworkspaceId>'}" --protected-settings "{'workspaceKey':'<Log AnalyticsworkspaceKey>'}"
3838
```
3939
4040
For a Linux cluster:
4141
42-
```sh
42+
```azurecli
4343
az vmss extension set --name OmsAgentForLinux --publisher Microsoft.EnterpriseCloud.Monitoring --resource-group <nameOfResourceGroup> --vmss-name <nameOfNodeType> --settings "{'workspaceId':'<Log AnalyticsworkspaceId>'}" --protected-settings "{'workspaceKey':'<Log AnalyticsworkspaceKey>'}"
4444
```
4545
@@ -49,7 +49,7 @@ The best way to add the Log Analytics agent to your cluster is via the virtual m
4949
5050
5. This should take less than 15 min to successfully add the agent to your nodes. You can verify that the agents have been added by using the `az vmss extension list` API:
5151
52-
```sh
52+
```azurecli
5353
az vmss extension list --resource-group <nameOfResourceGroup> --vmss-name <nameOfNodeType>
5454
```
5555

articles/terraform/terratest-in-terraform-modules.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,17 @@ func TestUT_StorageAccountName(t *testing.T) {
243243

244244
To run the unit tests, complete the following steps on the command line:
245245

246+
```azurecli
247+
az login # Required when no service principal environment variables are present
248+
```
249+
246250
```shell
247-
$ cd [Your GoPath]/src/staticwebpage
248-
GoPath/src/staticwebpage$ dep init # Run only once for this folder
249-
GoPath/src/staticwebpage$ dep ensure # Required to run if you imported new packages in test cases
250-
GoPath/src/staticwebpage$ cd test
251-
GoPath/src/staticwebpage/test$ go fmt
252-
GoPath/src/staticwebpage/test$ az login # Required when no service principal environment variables are present
253-
GoPath/src/staticwebpage/test$ go test -run TestUT_StorageAccountName
251+
cd [Your GoPath]/src/staticwebpage
252+
dep init # Run only once for this folder
253+
dep ensure # Required to run if you imported new packages in test cases
254+
cd test
255+
go fmt
256+
go test -run TestUT_StorageAccountName
254257
```
255258

256259
The traditional Go test result returns in about a minute.
@@ -364,21 +367,24 @@ func TestIT_HelloWorldExample(t *testing.T) {
364367

365368
To run the integration tests, complete the following steps on the command line:
366369

370+
```azurecli
371+
az login # Required when no service principal environment variables are present
372+
```
373+
367374
```shell
368-
$ cd [Your GoPath]/src/staticwebpage
369-
GoPath/src/staticwebpage$ dep init # Run only once for this folder
370-
GoPath/src/staticwebpage$ dep ensure # Required to run if you imported new packages in test cases
371-
GoPath/src/staticwebpage$ cd test
372-
GoPath/src/staticwebpage/test$ go fmt
373-
GoPath/src/staticwebpage/test$ az login # Required when no service principal environment variables are present
374-
GoPath/src/staticwebpage/test$ go test -run TestIT_HelloWorldExample
375+
cd [Your GoPath]/src/staticwebpage
376+
dep init # Run only once for this folder
377+
dep ensure # Required to run if you imported new packages in test cases
378+
cd test
379+
go fmt
380+
go test -run TestIT_HelloWorldExample
375381
```
376382

377383
The traditional Go test result returns in about two minutes. You could also run both unit tests and integration tests by executing these commands:
378384

379385
```shell
380-
GoPath/src/staticwebpage/test$ go fmt
381-
GoPath/src/staticwebpage/test$ go test
386+
go fmt
387+
go test
382388
```
383389

384390
Integration tests take much longer than unit tests (two minutes for one integration case compared to one minute for five unit cases). But it's your decision whether to use unit tests or integration tests in a scenario. Typically, we prefer to use unit tests for complex logic by using Terraform HCL functions. We usually use integration tests for the end-to-end perspective of a user.
@@ -491,13 +497,16 @@ func Clean() error {
491497

492498
You can use the following commands to execute a full test suite. The code is similar to the running steps we used in an earlier section.
493499

500+
```azurecli
501+
az login # Required when no service principal environment variables are present
502+
```
503+
494504
```shell
495-
$ cd [Your GoPath]/src/staticwebpage
496-
GoPath/src/staticwebpage$ dep init # Run only once for this folder
497-
GoPath/src/staticwebpage$ dep ensure # Required to run if you imported new packages in magefile or test cases
498-
GoPath/src/staticwebpage$ go fmt # Only required when you change the magefile
499-
GoPath/src/staticwebpage$ az login # Required when no service principal environment variables are present
500-
GoPath/src/staticwebpage$ mage
505+
cd [Your GoPath]/src/staticwebpage
506+
dep init # Run only once for this folder
507+
dep ensure # Required to run if you imported new packages in magefile or test cases
508+
go fmt # Only required when you change the magefile
509+
mage
501510
```
502511

503512
You can replace the last command line with additional mage steps. For example, you can use `mage unit` or `mage clean`. It's a good idea to embed `dep` commands and `az login` in the magefile. We don't show the code here.

0 commit comments

Comments
 (0)