Skip to content

Commit 9d96eaf

Browse files
authored
Merge pull request #104804 from v-thepet/azure-cli
Change code blocks to shell for sfctl
2 parents 6a3745d + 9331487 commit 9d96eaf

5 files changed

+37
-37
lines changed

articles/service-fabric/service-fabric-application-lifecycle-sfctl.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Before you create an application, upload the application package to the Service
4343
For example, if your application package is in the `app_package_dir` directory, use the following commands to upload
4444
the directory:
4545

46-
```azurecli
46+
```shell
4747
sfctl application upload --path ~/app_package_dir
4848
```
4949

@@ -53,7 +53,7 @@ For large application packages, you can specify the `--show-progress` option to
5353

5454
When the upload is finished, provision the application. To provision the application, use the following command:
5555

56-
```azurecli
56+
```shell
5757
sfctl application provision --application-type-build-path app_package_dir
5858
```
5959

@@ -65,7 +65,7 @@ It's recommended that you remove the application package after the application i
6565

6666
To delete the application package from the image store, use the following command:
6767

68-
```azurecli
68+
```shell
6969
sfctl store delete --content-path app_package_dir
7070
```
7171

@@ -75,7 +75,7 @@ sfctl store delete --content-path app_package_dir
7575

7676
After you provision the application, use the following command to name and create your application:
7777

78-
```azurecli
78+
```shell
7979
sfctl application create --app-name fabric:/TestApp --app-type TestAppType --app-version 1.0
8080
```
8181

@@ -90,7 +90,7 @@ After you have created an application, create services from the application. In
9090
stateless service from our application. The services that you can create from an application are defined in a service
9191
manifest in the previously provisioned application package.
9292

93-
```azurecli
93+
```shell
9494
sfctl service create --app-id TestApp --name fabric:/TestApp/TestSvc --service-type TestServiceType \
9595
--stateless --instance-count 1 --singleton-scheme
9696
```
@@ -99,15 +99,15 @@ sfctl service create --app-id TestApp --name fabric:/TestApp/TestSvc --service-t
9999

100100
To verify everything is healthy, use the following health commands:
101101

102-
```azurecli
102+
```shell
103103
sfctl application list
104104
sfctl service list --application-id TestApp
105105
```
106106

107107
To verify that the service is healthy, use similar commands to retrieve the health of both the service and the
108108
application:
109109

110-
```azurecli
110+
```shell
111111
sfctl application health --application-id TestApp
112112
sfctl service health --service-id TestApp/TestSvc
113113
```
@@ -122,7 +122,7 @@ To remove an application, complete the following tasks:
122122

123123
To delete the application, use the following command:
124124

125-
```azurecli
125+
```shell
126126
sfctl application delete --application-id TestEdApp
127127
```
128128

@@ -131,7 +131,7 @@ sfctl application delete --application-id TestEdApp
131131
After you delete the application, you can unprovision the application type if you no longer need it. To unprovision
132132
the application type, use the following command:
133133

134-
```azurecli
134+
```shell
135135
sfctl application unprovision --application-type-name TestAppType --application-type-version 1.0
136136
```
137137

@@ -146,15 +146,15 @@ of the application. For more information, see the documentation on
146146

147147
To perform an upgrade, first provision the next version of the application using the same commands as before:
148148

149-
```azurecli
149+
```shell
150150
sfctl application upload --path ~/app_package_dir_2
151151
sfctl application provision --application-type-build-path app_package_dir_2
152152
sfctl store delete --content-path app_package_dir_2
153153
```
154154

155155
It is recommended then to perform a monitored automatic upgrade, launch the upgrade by running the following command:
156156

157-
```azurecli
157+
```shell
158158
sfctl application upgrade --app-id TestApp --app-version 2.0.0 --parameters "{\"test\":\"value\"}" --mode Monitored
159159
```
160160

articles/service-fabric/service-fabric-cli.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The Service Fabric CLI is meant to support the latest runtime version of the Ser
3636

3737
You can optionally specify a target version of the CLI to install by suffixing the `pip install` command with `==<version>`. For example, for version 1.1.0 the syntax would be:
3838

39-
```
39+
```shell
4040
pip install -I sfctl==1.1.0
4141
```
4242

@@ -62,14 +62,14 @@ For Windows 10, Windows Server 2016, and Windows Server 2012 R2, use the standar
6262

6363
Now you can open a new command window and get the version of both Python and pip.
6464

65-
```bat
65+
```shell
6666
python --version
6767
pip --version
6868
```
6969

7070
Then run the following command to install the Azure Service Fabric CLI (sfctl) and view the CLI help page:
7171

72-
```bat
72+
```shell
7373
pip install sfctl
7474
sfctl -h
7575
```
@@ -98,7 +98,7 @@ Be sure that `~/.local/bin` is accessible from the `$PATH`:
9898

9999
```bash
100100
export PATH=$PATH:~/.local/bin
101-
echo "export PATH=$PATH:~/.local/bin" >> .bashrc
101+
echo "export PATH=$PATH:~/.local/bin" >> .shellrc
102102
```
103103

104104
If the installation on Windows subsystem for Linux fails with incorrect folder permissions, it may be necessary to try again with elevated permissions:
@@ -143,7 +143,7 @@ Commands are always prefixed with `sfctl`. For general information about all the
143143

144144
Commands follow a repeatable structure, with the target of the command preceding the verb or the action.
145145

146-
```azurecli
146+
```shell
147147
sfctl <object> <action>
148148
```
149149

@@ -156,15 +156,15 @@ Before you perform any operations, you must select a cluster to connect to. For
156156
> [!WARNING]
157157
> Do not use unsecured Service Fabric clusters in a production environment.
158158
159-
```azurecli
159+
```shell
160160
sfctl cluster select --endpoint http://testcluster.com:19080
161161
```
162162
163163
The cluster endpoint must be prefixed by `http` or `https`. It must include the port for the HTTP gateway. The port and address are the same as the Service Fabric Explorer URL.
164164
165165
For clusters that are secured with a certificate, you can specify a PEM-encoded certificate. The certificate can be specified as a single file or as a cert and a key pair. If it is a self-signed certificate that is not CA signed, you can pass the `--no-verify` option to bypass CA verification.
166166
167-
```azurecli
167+
```shell
168168
sfctl cluster select --endpoint https://testsecurecluster.com:19080 --pem ./client.pem --no-verify
169169
```
170170
@@ -177,7 +177,7 @@ Cluster connection information persists across multiple Service Fabric CLI sessi
177177
178178
For example, to get the Service Fabric cluster health state, use the following command:
179179
180-
```azurecli
180+
```shell
181181
sfctl cluster health
182182
```
183183
@@ -214,13 +214,13 @@ Here are some suggestions and tips for solving common problems.
214214
215215
The Service Fabric CLI supports client-side certificates as PEM (.pem extension) files. If you use PFX files from Windows, you must convert those certificates to PEM format. To convert a PFX file to a PEM file, use the following command:
216216
217-
```bash
217+
```shell
218218
openssl pkcs12 -in certificate.pfx -out mycert.pem -nodes
219219
```
220220
221221
Similarly, to convert from a PEM file to a PFX file, you can use the following command (no password is being provided here):
222222
223-
```bash
223+
```shell
224224
openssl pkcs12 -export -out Certificates.pfx -inkey Certificates.pem -in Certificates.pem -passout pass:''
225225
```
226226
@@ -242,21 +242,21 @@ Detailed logs often are helpful when you debug or report a problem. The `--debug
242242
243243
For help with a specific command or a group of commands, use the `-h` flag.
244244
245-
```azurecli
245+
```shell
246246
sfctl application -h
247247
```
248248
249249
Here is another example:
250250
251-
```azurecli
251+
```shell
252252
sfctl application create -h
253253
```
254254
255255
## Updating the Service Fabric CLI
256256
257257
To update the Service Fabric CLI, run the following commands (replace `pip` with `pip3` depending on what you chose during your original install):
258258
259-
```bash
259+
```shell
260260
pip uninstall sfctl
261261
pip install sfctl
262262
```

articles/service-fabric/service-fabric-cluster-scale-up-down.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ To keep the nodes of the cluster evenly distributed across upgrade and fault dom
9999
Get-ServiceFabricNode | Sort-Object NodeInstanceId -Descending | Select-Object -First 1
100100
```
101101

102-
```azurecli
102+
```shell
103103
sfctl node list --query "sort_by(items[*], &name)[-1]"
104104
```
105105

@@ -181,7 +181,7 @@ else
181181

182182
In the **sfctl** code below, the following command is used to get the **node-name** value of the last-created node: `sfctl node list --query "sort_by(items[*], &name)[-1].name"`
183183

184-
```azurecli
184+
```shell
185185
# Inform the node that it is going to be removed
186186
sfctl node disable --node-name _nt1vm_5 --deactivation-intent 4 -t 300
187187

articles/service-fabric/service-fabric-connect-to-secure-cluster.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ You can connect to a cluster using the `sfctl cluster select` command.
2222
Client certificates can be specified in two different fashions, either as a cert and key pair, or as a single PFX
2323
file. For password protected PEM files, you will be prompted automatically to enter the password. If you obtained the client certificate as a PFX file, first convert the PFX file to a PEM file using the following command.
2424

25-
```bash
25+
```shell
2626
openssl pkcs12 -in your-cert-file.pfx -out your-cert-file.pem -nodes -passin pass:your-pfx-password
2727
```
2828

2929
If your .pfx file is not password protected, use -passin pass: for the last parameter.
3030

3131
To specify the client certificate as a pem file, specify the file path in the `--pem` argument. For example:
3232

33-
```azurecli
33+
```shell
3434
sfctl cluster select --endpoint https://testsecurecluster.com:19080 --pem ./client.pem
3535
```
3636
@@ -39,7 +39,7 @@ Password protected pem files will prompt for password prior to running any comma
3939
To specify a cert, key pair use the `--cert` and `--key` arguments to specify the file paths to each respective
4040
file.
4141
42-
```azurecli
42+
```shell
4343
sfctl cluster select --endpoint https://testsecurecluster.com:19080 --cert ./client.crt --key ./keyfile.key
4444
```
4545
@@ -49,14 +49,14 @@ verification, specify the `--no-verify` option. For example:
4949
> [!WARNING]
5050
> Do not use the `no-verify` option when connecting to production Service Fabric clusters.
5151
52-
```azurecli
52+
```shell
5353
sfctl cluster select --endpoint https://testsecurecluster.com:19080 --pem ./client.pem --no-verify
5454
```
5555
5656
In addition, you can specify paths to directories of trusted CA certs, or individual certs. To specify these
5757
paths, use the `--ca` argument. For example:
5858
59-
```azurecli
59+
```shell
6060
sfctl cluster select --endpoint https://testsecurecluster.com:19080 --pem ./client.pem --ca ./trusted_ca
6161
```
6262

articles/service-fabric/service-fabric-docker-compose.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,37 +64,37 @@ Get-ServiceFabricComposeDeploymentUpgrade -DeploymentName TestContainerApp
6464

6565
Alternatively, you can use the following Service Fabric CLI command:
6666

67-
```azurecli
67+
```shell
6868
sfctl compose create --deployment-name TestContainerApp --file-path docker-compose.yml [ [ --user --encrypted-pass ] | [ --user --has-pass ] ] [ --timeout ]
6969
```
7070

7171
After you've created the deployment, you can check its status by using the following command:
7272

73-
```azurecli
73+
```shell
7474
sfctl compose status --deployment-name TestContainerApp [ --timeout ]
7575
```
7676

7777
To delete the Compose deployment, use the following command:
7878

79-
```azurecli
79+
```shell
8080
sfctl compose remove --deployment-name TestContainerApp [ --timeout ]
8181
```
8282

8383
To start a Compose deployment upgrade, use the following command:
8484

85-
```azurecli
85+
```shell
8686
sfctl compose upgrade --deployment-name TestContainerApp --file-path docker-compose-v2.yml [ [ --user --encrypted-pass ] | [ --user --has-pass ] ] [--upgrade-mode Monitored] [--failure-action Rollback] [ --timeout ]
8787
```
8888

8989
To rollback the Compose deployment upgrade, use the following command:
9090

91-
```azurecli
91+
```shell
9292
sfctl compose upgrade-rollback --deployment-name TestContainerApp [ --timeout ]
9393
```
9494

9595
After upgrade is accepted, the upgrade progress could be tracked using the following command:
9696

97-
```azurecli
97+
```shell
9898
sfctl compose upgrade-status --deployment-name TestContainerApp
9999
```
100100

0 commit comments

Comments
 (0)