gpt4 book ai didi

azure-devops - Azure DevOps 在 Cypress 测试管道中获得 403(禁止)

转载 作者:行者123 更新时间:2023-12-04 08:54:18 25 4
gpt4 key购买 nike

我有一个 Azure DevOps 管道,它针对应用服务运行一系列测试( Cypress )。此应用服务访问受限,因此每次请求都会收到 403(禁止),并且我一直在寻找 IP 以将其列入白名单。看了很多时间后,我在几个地方读到它们经常改变。
我错过了什么?
谢谢,

最佳答案

如果您正在寻找 Azure 资源的 IP 范围,您会发现它们 here .它们每周更改一次,但这并不意味着所有这些都更改。它只是意味着文件每周更新一次。
在此文件中,您必须找到您选择的资源和区域:

    {
"name": "AppService",
"id": "AppService",
"properties": {
"changeNumber": 10,
"region": "",
"regionId": 0,
"platform": "Azure",
"systemService": "AzureAppService",
"addressPrefixes": [
"13.64.73.110/32",
"13.65.30.245/32",
"13.65.37.122/32",
"13.65.39.165/32",
"13.65.42.35/32",
"13.65.42.183/32",
"13.65.45.30/32",
"13.65.85.146/32",

因此,如果您想将其中一些 IP 添加到您的限制中,您可以在 powershell 中解析 json,然后在 for 循环中使用此命令
Add-AzWebAppAccessRestrictionRule -ResourceGroupName "ResourceGroup" -WebAppName "AppName"
-Name "Ip example rule" -Priority 100 -Action Allow -IpAddress 122.133.144.0/24

关于azure-devops - Azure DevOps 在 Cypress 测试管道中获得 403(禁止),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63919138/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com