-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-cli
More file actions
72 lines (59 loc) · 2.36 KB
/
azure-cli
File metadata and controls
72 lines (59 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
az login
az logout
az account show
az account list-locations
az account set --subscription <SUBSCRIPTION_ID>
az configure --defaults group=${RESOURCE_GROUP_NAME}
az configure --defaults spring=${SPRING_CLOUD_NAME}
az connection create mysql-flexible \
--resource-group <RESOURCE_GROUP> \
--connection mysql_conn \
--target-resource-group <TARGET_RESOURCE_GROUP> \
--server <RESOURCE_NAME> \
--database <DATABASE_NAME> \
--user-account mysql-identity-id=/subscriptions/<SUBSCRIPTION_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<USER_ASSIGNED_MANAGED_IDENTITY_NAME> \
--query authInfo.userName \
--output tsv
az extension add -n spring -y
az group create --name $AZ_RESOURCE_GROUP \
--location $AZ_LOCATION | jq
az mysql server create \
--resource-group $AZ_RESOURCE_GROUP \
--name $AZ_DATABASE_NAME \
--location $AZ_LOCATION \
--sku-name B_Gen5_1 \
--storage-size 5120 \
--admin-user $AZ_MYSQL_USERNAME \
--admin-password $AZ_MYSQL_PASSWORD \
| jq
az mysql server firewall-rule create \
--resource-group $AZ_RESOURCE_GROUP \
--name $AZ_DATABASE_NAME-database-allow-local-ip \
--server-name $AZ_DATABASE_NAME \
--start-ip-address $AZ_LOCAL_IP_ADDRESS \
--end-ip-address $AZ_LOCAL_IP_ADDRESS \
| jq
az mysql server firewall-rule create \
--resource-group $AZ_RESOURCE_GROUP \
--name allAzureIPs \
--server-name $AZ_DATABASE_NAME \
--start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0 \
| jq
az mysql db create \
--name "todos" \
--server-name ${SPRING_CLOUD_NAME}-mysql
az spring create \
-g "$RESOURCE_GROUP_NAME" \
-n "$SPRING_CLOUD_NAME" \
--sku standard
az spring app create --name todo-service \
--resource-group "$RESOURCE_GROUP_NAME" \
--service "$SPRING_CLOUD_NAME" \
--runtime-version Java_11
az spring app deploy --name todo-service \
--service "$SPRING_CLOUD_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--artifact-path target/demo-0.0.1-SNAPSHOT.jar
az spring app logs --name todo-service \
--service "$SPRING_CLOUD_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" -f