-
Notifications
You must be signed in to change notification settings - Fork 27
/
az-eg.sh
47 lines (40 loc) · 1.34 KB
/
az-eg.sh
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
source az.env
res_id="/subscriptions/$sub_id/resourceGroups/$rg/providers/Microsoft.EventGrid/namespaces/$name"
az account set -s $sub_id
az resource create --id $res_id --is-full-object --properties '{
"properties": {
"topicsConfiguration": {
"inputSchema": "CloudEventSchemaV1_0"
},
"topicSpacesConfiguration": {
"state": "Enabled"
}
},
"location": "eastus2euap"
}'
capem=`cat ~/.step/certs/intermediate_ca.crt | tr -d "\n"`
az resource create --id "$res_id/caCertificates/Intermediate01" --properties "{\"encodedCertificate\" : \"$capem\"}"
az resource create --id "$res_id/clients/vehicle01" --properties '{
"state": "Enabled",
"clientCertificateAuthentication": {
"certificateSubject": {
"commonName": "vehicle01"
}
},
"attributes": {},
"description": "This is a test publisher client"
}'
az resource create --id "$res_id/topicSpaces/sample" --properties '{
"topicTemplates": ["sample/#"],
"subscriptionSupport": "LowFanout"
}'
az resource create --id "$res_id/permissionBindings/samplesPub" --properties '{
"clientGroupName":"$all",
"topicSpaceName":"sample",
"permission":"Publisher"
}'
az resource create --id "$res_id/permissionBindings/samplesSub" --properties '{
"clientGroupName":"$all",
"topicSpaceName":"sample",
"permission":"Subscriber"
}'