从Azure DevOps删除Azure清除脚本

10
我们正在将Web应用部署到Azure CDN,但每次更新应用程序之前都需要等待相当长的时间。因此,我们发现了一个“清除”按钮,看起来很有效。清除后,我们需要等待大约5分钟。
现在,我们想在每次发布应用程序时运行此操作,因此我们向VSTS添加了一个任务,其中包含以下脚本:
az cdn endpoint purge --resource-group $1 --profile-name $3 --name $4 --content-paths /*

使用参数:$(ResourceGroup) $(StorageAccountName) $(ProfileName) $(EndpointName)

但这并不总是有效,有时它可以立即更新应用程序,但有时我们需要等待长达30分钟。

你使用的是 Verizon、Akamai 还是 Microsoft 标准 CDN? - msrini-MSIT
@msrini-MSIT 标准的微软。 - kosnkov
操作需要30分钟才能完成吗?还是操作已经完成,但是不起作用需要30分钟? - msrini-MSIT
@msrini-MSIT,肯定是第二个选项。发布已完成,清除需要2到6分钟,有时即使过了一个小时,应用程序仍然没有更新,我们还需要手动在Azure上按下清除按钮。 - kosnkov
@kosnkov,你解决了这个问题吗?你使用的CDN版本是哪个? - oatsoda
2个回答

9

0

请在""或''中提供内容路径

az cdn endpoint purge --resource-group $1 --profile-name $3 --name $4 --no-wait --content-paths "/*"

其中,将$1 $3 $4的值提供为-

$1 => name of resource group
$3 => CDN profile name (exclude the suffix **.azureedge.net**)
$4 => name of the endpoint

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接