Skip to content

Commit 1900713

Browse files
Control Azure services with the CLI
1 parent 6f3ba13 commit 1900713

File tree

6 files changed

+116
-0
lines changed

6 files changed

+116
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ Get started with React/unit 4 Hello world/mslearn-react
44
~$ShubhamVermaLearningAzureLearningModule.xlsx
55
Build a web API with Node.js and Express/unit 3 Exercise - Create a new Express web application/node-essentials
66
node_modules/
7+
Build a web API with Node.js and Express/unit 3 Exercise - Create a new Express web application/node-essentials
8+
Creating your first web apps with React/mslearn-react
9+
Get started with React/unit 4 Hello world/mslearn-react
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
```
2+
az vm restart -g MyResourceGroup -n MyVm
3+
```
4+
5+
![alt text](image.png)
6+
7+
```
8+
az find blob
9+
```
10+
11+
```
12+
az find "az vm"
13+
```
14+
15+
```
16+
az find "az vm create"
17+
```
18+
19+
```
20+
az storage blob --help
21+
```
22+
23+
![alt text](image-1.png)
24+
25+
```
26+
az group create --name <name> --location <location>
27+
```
28+
29+
Example
30+
31+
```
32+
az group create --name azurecliegroupdemo --location eastus
33+
```
34+
35+
```
36+
az account set --subscription "Shubham Verma VSEnt–MPN"
37+
```
38+
39+
```Azure Cli
40+
az group list
41+
```
42+
43+
```Azure Cli
44+
az group list --output table
45+
```
46+
47+
```
48+
export RESOURCE_GROUP=learn-e79bceae-3554-4144-9b2b-ae6619c13f7c
49+
export AZURE_REGION=eastus
50+
export AZURE_APP_PLAN=popupappplan-$RANDOM
51+
export AZURE_WEB_APP=popupwebapp-$RANDOM
52+
```
53+
54+
```
55+
az group list --output table
56+
```
57+
58+
```
59+
az group list --query "[?name == '$RESOURCE_GROUP']"
60+
```
61+
62+
```
63+
az appservice plan create --help
64+
```
65+
66+
```
67+
az appservice plan create --name $AZURE_APP_PLAN --resource-group $RESOURCE_GROUP --location $AZURE_REGION --sku FREE
68+
```
69+
70+
## Create a web app
71+
72+
```
73+
az webapp create --name $AZURE_WEB_APP --resource-group $RESOURCE_GROUP --plan $AZURE_APP_PLAN
74+
```
75+
76+
![alt text](image-2.png)
77+
78+
```
79+
az webapp list --output table
80+
```
81+
82+
```
83+
site="http://$AZURE_WEB_APP.azurewebsites.net"
84+
echo $site
85+
```
86+
87+
```
88+
curl $AZURE_WEB_APP.azurewebsites.net
89+
```
90+
91+
output
92+
93+
```
94+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Microsoft Azure App Service - Welcome</title><link rel="shortcut icon" href="https://appservice.azureedge.net/images/app-service/v4/favicon.ico" type="image/x-icon"/><link href="https://appservice.azureedge.net/css/app-service/v4/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"/><style>html, body{height: 100%; background-color: #ffffff; color: #000000; font-size: 13px;}*{border-radius: 0 !important;}</style> ... (continued)
95+
```
96+
97+
## Deploy code from GitHub
98+
99+
```
100+
az webapp deployment source config --name $AZURE_WEB_APP --resource-group $RESOURCE_GROUP --repo-url "https://github.com/Azure-Samples/php-docs-hello-world" --branch master --manual-integration
101+
```
102+
103+
```
104+
curl $AZURE_WEB_APP.azurewebsites.net
105+
```
106+
107+
output
108+
109+
```
110+
Hello World!
111+
```
112+
113+
![alt text](image-3.png)
Loading
Loading
16.1 KB
Loading
44.5 KB
Loading

0 commit comments

Comments
 (0)