azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

[Cdn] Parameter OptimizationType for New-AzCdnEndpoint mandatory

Open VeryEarly opened this issue 3 years ago • 2 comments

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

VeryEarly avatar Jun 27 '22 08:06 VeryEarly

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:

Network - CDN, Service Attention, bug

Milestone: -

msftbot[bot] avatar Jun 27 '22 08:06 msftbot[bot]

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

isra-fel avatar Aug 02 '22 06:08 isra-fel

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.

TracyYaoYao avatar Sep 12 '23 01:09 TracyYaoYao

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

TracyYaoYao avatar Sep 12 '23 01:09 TracyYaoYao