@@ -159,7 +159,7 @@ function Test-CustomDomainGetRemoveWithStoppedEndpoint
159
159
. SYNOPSIS
160
160
Enable Https for custom domain with running endpoint
161
161
#>
162
- function Test-CustomDomainEnableHttpsWithRunningEndpoint
162
+ function Test-VerizonCustomDomainEnableHttpsWithRunningEndpoint
163
163
{
164
164
# Hard-coding host and endpoint names due to requirement for DNS CNAME
165
165
$endpointName = " testVerizonEP"
@@ -203,5 +203,85 @@ function Test-CustomDomainEnableHttpsWithRunningEndpoint
203
203
204
204
Assert-ThrowsContains { $customDomain | Disable-AzCdnCustomDomainHttps } " BadRequest"
205
205
206
+ Remove-AzureRmResourceGroup - Name $resourceGroup.ResourceGroupName - Force
207
+ }
208
+
209
+ <#
210
+ . SYNOPSIS
211
+ Enable Https for custom domain with running endpoint
212
+ #>
213
+ function Test-AkamaiCustomDomainEnableHttpsWithRunningEndpoint
214
+ {
215
+ # Hard-coding host and endpoint names due to requirement for DNS CNAME
216
+ $endpointName = " testAkamaiEP"
217
+ $hostName = " testAkamai.dustydog.us"
218
+
219
+ $customDomainName = getAssetName
220
+
221
+ $profileName = getAssetName
222
+ $resourceGroup = TestSetup- CreateResourceGroup
223
+ $resourceLocation = " EastUS"
224
+ $profileSku = " Standard_Akamai"
225
+ $tags = @ {" tag1" = " value1" ; " tag2" = " value2" }
226
+ $profile = New-AzCdnProfile - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName - Location $resourceLocation - Sku $profileSku - Tag $tags
227
+
228
+ $originName = getAssetName
229
+ $originHostName = " www.microsoft.com"
230
+ $endpoint = New-AzCdnEndpoint - EndpointName $endpointName - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName - Location $resourceLocation - OriginName $originName - OriginHostName $originHostName
231
+ $validateResult = Test-AzCdnCustomDomain - EndpointName $endpointName - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName - CustomDomainHostName $hostName
232
+ Assert-True {$validateResult.CustomDomainValidated }
233
+
234
+ $customDomain = New-AzCdnCustomDomain - HostName $hostName - CustomDomainName $customDomainName - EndpointName $endpointName - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName
235
+ Assert-AreEqual $customDomainName $customDomain.Name
236
+ Assert-AreEqual $hostName $customDomain.HostName
237
+
238
+ $enabled = $customDomain | Enable-AzCdnCustomDomainHttps - PassThru
239
+ Assert-True {$enabled }
240
+
241
+ $customDomain = Get-AzCdnCustomDomain - CustomDomainName $customDomainName - EndpointName $endpointName - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName
242
+ Assert-AreEqual $customDomain.CustomHttpsProvisioningState " Enabling"
243
+
244
+ Assert-ThrowsContains { $customDomain | Enable-AzCdnCustomDomainHttps } " BadRequest"
245
+
246
+ Remove-AzureRmResourceGroup - Name $resourceGroup.ResourceGroupName - Force
247
+ }
248
+
249
+ <#
250
+ . SYNOPSIS
251
+ Enable Https for custom domain with running endpoint
252
+ #>
253
+ function Test-MicrosoftCustomDomainEnableHttpsWithRunningEndpoint
254
+ {
255
+ # Hard-coding host and endpoint names due to requirement for DNS CNAME
256
+ $endpointName = " testMicrosoftEP"
257
+ $hostName = " testMicrosoft.dustydog.us"
258
+
259
+ $customDomainName = getAssetName
260
+
261
+ $profileName = getAssetName
262
+ $resourceGroup = TestSetup- CreateResourceGroup
263
+ $resourceLocation = " EastUS"
264
+ $profileSku = " Standard_Microsoft"
265
+ $tags = @ {" tag1" = " value1" ; " tag2" = " value2" }
266
+ $profile = New-AzCdnProfile - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName - Location $resourceLocation - Sku $profileSku - Tag $tags
267
+
268
+ $originName = getAssetName
269
+ $originHostName = " www.microsoft.com"
270
+ $endpoint = New-AzCdnEndpoint - EndpointName $endpointName - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName - Location $resourceLocation - OriginName $originName - OriginHostName $originHostName
271
+ $validateResult = Test-AzCdnCustomDomain - EndpointName $endpointName - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName - CustomDomainHostName $hostName
272
+ Assert-True {$validateResult.CustomDomainValidated }
273
+
274
+ $customDomain = New-AzCdnCustomDomain - HostName $hostName - CustomDomainName $customDomainName - EndpointName $endpointName - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName
275
+ Assert-AreEqual $customDomainName $customDomain.Name
276
+ Assert-AreEqual $hostName $customDomain.HostName
277
+
278
+ $enabled = $customDomain | Enable-AzCdnCustomDomainHttps - PassThru
279
+ Assert-True {$enabled }
280
+
281
+ $customDomain = Get-AzCdnCustomDomain - CustomDomainName $customDomainName - EndpointName $endpointName - ProfileName $profileName - ResourceGroupName $resourceGroup.ResourceGroupName
282
+ Assert-AreEqual $customDomain.CustomHttpsProvisioningState " Enabling"
283
+
284
+ Assert-ThrowsContains { $customDomain | Enable-AzCdnCustomDomainHttps } " BadRequest"
285
+
206
286
Remove-AzureRmResourceGroup - Name $resourceGroup.ResourceGroupName - Force
207
287
}
0 commit comments