azure-powershell
azure-powershell copied to clipboard
[Cdn] Parameter OptimizationType for New-AzCdnEndpoint mandatory
Description
Thanks @jack-cloud-platform catching this bug, parameter OptimizationType for New-AzCdnEndpoint is actually mandatory, please plan to fix this in next major release. @ChenglongLiu
Issue script & Debug output
N/A
Environment data
N/A
Module versions
N/A
Error output
No response
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @cdnfdsuppgithub.
Issue Details
Description
Thanks @jack-cloud-platform catching this bug, parameter OptimizationType for New-AzCdnEndpoint is actually mandatory, please plan to fix this in next major release. @ChenglongLiu
Issue script & Debug output
N/A
Environment data
N/A
Module versions
N/A
Error output
No response
| Author: | VeryEarly |
|---|---|
| Assignees: | ChenglongLiu |
| Labels: |
|
| Milestone: | - |
If it's a bug, we don't have to wait until next major release to fix it, we can do it in any release. @ChenglongLiu Hi Chenglong, can you prioritize this? Thanks
Hi, @VeryEarly, parameter OptimizationType cannot be set as mandatory. Because for some providers, it is not accepted. Like you could see, the ProviderType of classicCDNtest is AzureFrontdoorStandard, SKU is Standard_Microsoft. If we use the parameter OptimizationType, it will throw exception.
PS C:\Users> New-AzCdnEndpoint -Name cdntestcert01 -ProfileName classicCDNtest -ResourceGroupName yaoshitest -Location Global -Origin $origin -OptimizationType LargeFileDownload
New-AzCdnEndpoint : Optimization Type is not applicable for this profile.
At line:1 char:1
+ New-AzCdnEndpoint -Name cdntestcert01 -ProfileName classicCDNtest -Re ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ ResourceGroup... ]
}
} }:<>f__AnonymousType29`5) [New-AzCdnEndpoint_CreateExpanded1], Exception
+ FullyQualifiedErrorId : BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Cdn.Cmdlets.NewAzCdnEndpoint_CreateExpanded1
If you do not use this parameter, then the default value will be used when create a new endpoint.
For some providers, like EdgeCastCdn, it allows to use this parameter. But if you don't use it, then the default value will be used.
PS C:\Users\> New-AzCdnEndpoint -Name endpointTest01 -ProfileName certtest01 -ResourceGroupName yaoshitest -Location Global -Origin $origin -OptimizationType DynamicSiteAcceleration -ProbePath /path/test.txt
Location Name ResourceGroupName
-------- ---- -----------------
Global endpointTest01 yaoshitest