Skip to content

Commit 1773a14

Browse files
yogeshmoYogesh Mohanraj
andauthored
Adding email test resources to arm template (Azure#27870)
Co-authored-by: Yogesh Mohanraj <ymohanraj@microsoft.com>
1 parent d30daa2 commit 1773a14

File tree

1 file changed

+120
-69
lines changed

1 file changed

+120
-69
lines changed

sdk/communication/test-resources.json

Lines changed: 120 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,134 @@
22
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
33
"contentVersion": "1.0.0.0",
44
"parameters": {
5-
"baseName": {
6-
"type": "string",
7-
"defaultValue": "[resourceGroup().name]",
8-
"metadata": {
9-
"description": "The base resource name."
10-
}
11-
},
12-
"endpointPrefix": {
13-
"defaultValue": "communication",
14-
"type": "string"
15-
},
16-
"testApplicationOid": {
17-
"type": "string",
18-
"metadata": {
19-
"description": "The client OID to grant access to test resources."
20-
}
21-
},
22-
"tenantId": {
23-
"type": "string",
24-
"metadata": {
25-
"description": "The tenant id to which the application and resources belong."
26-
}
27-
},
28-
"testApplicationId": {
29-
"type": "string",
30-
"metadata": {
31-
"description": "The application client id used to run tests."
32-
}
33-
},
34-
"testApplicationSecret": {
35-
"type": "string",
36-
"metadata": {
37-
"description": "The application client secret used to run tests."
38-
}
5+
"baseName": {
6+
"type": "string",
7+
"defaultValue": "[resourceGroup().name]",
8+
"metadata": {
9+
"description": "The base resource name."
10+
}
11+
},
12+
"endpointPrefix": {
13+
"defaultValue": "communication",
14+
"type": "string"
15+
},
16+
"testApplicationOid": {
17+
"type": "string",
18+
"metadata": {
19+
"description": "The client OID to grant access to test resources."
20+
}
21+
},
22+
"tenantId": {
23+
"type": "string",
24+
"metadata": {
25+
"description": "The tenant id to which the application and resources belong."
26+
}
27+
},
28+
"testApplicationId": {
29+
"type": "string",
30+
"metadata": {
31+
"description": "The application client id used to run tests."
3932
}
33+
},
34+
"testApplicationSecret": {
35+
"type": "string",
36+
"metadata": {
37+
"description": "The application client secret used to run tests."
38+
}
39+
}
4040
},
4141
"variables": {
42-
"uniqueSubDomainName": "[format('{0}-{1}', parameters('baseName'), parameters('endpointPrefix'))]",
43-
"contributorRoleId": "b24988ac-6180-42a0-ab88-20f7382dd24c"
42+
"uniqueSubDomainName": "[format('{0}-{1}', parameters('baseName'), parameters('endpointPrefix'))]",
43+
"emailServiceName": "[format('{0}-{1}', variables('uniqueSubDomainName'), 'email-service')]",
44+
"contributorRoleId": "b24988ac-6180-42a0-ab88-20f7382dd24c"
4445
},
4546
"resources": [
46-
{
47-
"type": "Microsoft.Communication/CommunicationServices",
48-
"apiVersion": "2020-08-20-preview",
49-
"name": "[variables('uniqueSubDomainName')]",
50-
"location": "global",
51-
"properties": {
52-
"dataLocation": "UnitedStates"
53-
}
47+
{
48+
"type": "Microsoft.Communication/CommunicationServices",
49+
"apiVersion": "2021-10-01-preview",
50+
"name": "[variables('uniqueSubDomainName')]",
51+
"location": "global",
52+
"properties": {
53+
"dataLocation": "UnitedStates",
54+
"linkedDomains": [
55+
"[resourceId('Microsoft.Communication/EmailServices/Domains', variables('emailServiceName'), 'AzureManagedDomain')]"
56+
]
57+
},
58+
"dependsOn": [
59+
"AzureManagedDomain"
60+
]
61+
},
62+
{
63+
"type": "Microsoft.Authorization/roleAssignments",
64+
"apiVersion": "2019-04-01-preview",
65+
"name": "[guid(resourceGroup().id, deployment().name, parameters('baseName'), variables('contributorRoleId'))]",
66+
"properties": {
67+
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('contributorRoleId'))]",
68+
"principalId": "[parameters('testApplicationOid')]",
69+
"scope": "[resourceGroup().id]"
70+
}
71+
},
72+
{
73+
"type": "Microsoft.Communication/EmailServices",
74+
"apiVersion": "2021-10-01-preview",
75+
"name": "[variables('emailServiceName')]",
76+
"location": "global",
77+
"properties": {
78+
"dataLocation": "UnitedStates"
5479
},
55-
{
56-
"type": "Microsoft.Authorization/roleAssignments",
57-
"apiVersion": "2019-04-01-preview",
58-
"name": "[guid(resourceGroup().id, deployment().name, parameters('baseName'), variables('contributorRoleId'))]",
80+
"resources": [
81+
{
82+
"type": "Domains",
83+
"apiVersion": "2021-10-01-preview",
84+
"name": "AzureManagedDomain",
85+
"location": "global",
86+
"dependsOn": [
87+
"[variables('emailServiceName')]"
88+
],
5989
"properties": {
60-
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('contributorRoleId'))]",
61-
"principalId": "[parameters('testApplicationOid')]",
62-
"scope": "[resourceGroup().id]"
90+
"domainManagement": "AzureManaged"
6391
}
64-
}
92+
}
93+
]
94+
}
6595
],
6696
"outputs": {
67-
"AZURE_TENANT_ID": {
68-
"type": "string",
69-
"value": "[parameters('tenantId')]"
70-
},
71-
"AZURE_CLIENT_ID": {
72-
"type": "string",
73-
"value": "[parameters('testApplicationId')]"
74-
},
75-
"AZURE_CLIENT_SECRET": {
76-
"type": "string",
77-
"value": "[parameters('testApplicationSecret')]"
78-
},
79-
"COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": {
80-
"type": "string",
81-
"value": "[listKeys(resourceId('Microsoft.Communication/CommunicationServices',variables('uniqueSubDomainName')), '2020-08-20-preview').primaryConnectionString]"
82-
}
97+
"AZURE_TENANT_ID": {
98+
"type": "string",
99+
"value": "[parameters('tenantId')]"
100+
},
101+
"AZURE_CLIENT_ID": {
102+
"type": "string",
103+
"value": "[parameters('testApplicationId')]"
104+
},
105+
"AZURE_CLIENT_SECRET": {
106+
"type": "string",
107+
"value": "[parameters('testApplicationSecret')]"
108+
},
109+
"COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": {
110+
"type": "string",
111+
"value": "[listKeys(resourceId('Microsoft.Communication/CommunicationServices',variables('uniqueSubDomainName')), '2021-10-01-preview').primaryConnectionString]"
112+
},
113+
"RESOURCE_GROUP_NAME": {
114+
"type": "string",
115+
"value": "[resourceGroup().Name]"
116+
},
117+
"COMMUNICATION_CONNECTION_STRING_EMAIL": {
118+
"type": "string",
119+
"value": "[listKeys(resourceId('Microsoft.Communication/CommunicationServices',variables('uniqueSubDomainName')), '2021-10-01-preview').primaryConnectionString]"
120+
},
121+
"SENDER_ADDRESS": {
122+
"type": "string",
123+
"value": "[format('{0}@{1}', 'DoNotReply', reference(resourceId('Microsoft.Communication/EmailServices/Domains', variables('emailServiceName'), 'AzureManagedDomain')).mailFromSenderDomain)]"
124+
},
125+
"RECIPIENT_ADDRESS": {
126+
"type": "string",
127+
"value": "acseaastesting@gmail.com"
128+
},
129+
"SECOND_RECIPIENT_ADDRESS": {
130+
"type": "string",
131+
"value": "acseaastesting@gmail.com"
132+
}
83133
}
84-
}
134+
}
135+

0 commit comments

Comments
 (0)