【Azure 应用服务】App Service - 在修改应用服务计划的页面中,为什么无法查看到同一个资源组下面的其他应用服务计划(App Service Plan)呢?

简介: 【Azure 应用服务】App Service - 在修改应用服务计划的页面中,为什么无法查看到同一个资源组下面的其他应用服务计划(App Service Plan)呢?

问题描述

在App Service的门户上,可以通过“Change App Service Plan”来改变当前App Service所属的应用服务计划(App Service Plan),在页面中,它会自动列举出来当前订阅下,同一个Resource Group的App Service Plan。

但是,为什么它显示不出来同一个资源组,同一个订阅号下面的,需要的appplantest001这一个App Service Plan呢?

 

问题分析

因为Azure门户上的所有内容都是调用REST API来获取的,所以只需要通过浏览器F12(开发者模式)下,找到在页面Change App Service Plan中获取有效的App Service Plan的API就可以进行下一步分析,查看为什么资源组里面显示的App Service Plan无法在页面中列举出来。

第一步:进入App Service 页面,点击F12,选择 Network Tab页。

第二步:进入Change App Service Plan页面,点开App Serivce Plan的下拉列表。

第三步:筛查所有的返回结果,在其中通过页面中的关键字进行过滤。如本次实验中使用的“ASP-apprg-8ff0”

第四步:通过返回结果,反向查看请求所发送的Payload。找出其中主要的过滤条件。如本实验中找出的条件如下:

where type == 'microsoft.web/serverfarms'
        | extend webspace = extract('.*', 0, tostring(properties.webSpace))
        | where webspace == 'app-rg-ChinaNorth2webspace'
        | project id, name, type, kind, properties, webspace, sku

以上四步的操作动画如下:

当拿到第四步的过滤条件后,这里非常明显是一个 Azure Resource Graph的查询语句,可以通过Azure Resource Graph Explorer页面来进行验证:Azure Resource Graph Explorer - Microsoft Azure 由世纪互联运营

把webspace 放入到显示窗口中,发现确实看不见 appplantest001 这个App Service Plan。

放宽以上语句的Where条件,指过滤当前订阅号下的App Service Plan,对比看一看webspace是否相同:

where type == 'microsoft.web/serverfarms'
        | extend webspace = extract('.*', 0, tostring(properties.webSpace))
        | where subscriptionId =='your subscription id'
        //| where webspace == 'app-rg-ChinaNorth2webspace'
        | project id, name, type, kind, webspace, sku

执行结果:发现Webspace值不同,所以它无法被Change App Service Plan页面显示出来。

为什么同一个资源组下面的 WebSpace 会不一样呢? 这是因为App Service Plan是可以在资源组间相互移动的,但是webspace的值确不会跟随移动的操作而改变。它是在最开始创建的时候就已经确定,无法继续修改。 的确,应用服务计划(appplantest001)是创建的时候选择了错误的资源组,然后把移动到正确的资源组的。这的确就是真相。

在发现问题根源后,并且无法移动到不同的webspace下,最后删除错误的App Service Plan,重新创建新的App Service Plan(appplantest001), 修改应用服务计划成功。达成目标!

 

参考资料

Azure Resource Graph Explorer:https://portal.azure.cn/#blade/HubsExtension/ArgQueryBlade

将应用移到另一个应用服务计划:https://docs.azure.cn/zh-cn/app-service/app-service-plan-manage#move-an-app-to-another-app-service-plan

相关文章
|
10天前
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub的解决之法
An exception occurred while retrieving properties for Event Hub: logicapp. Error Message: 'ClientSecretCredential authentication failed: AADSTS90002: Tenant 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Che
|
16天前
|
安全
【Azure App Service】App service无法使用的情况分析
App Service集成子网后,如果子网网段中的剩余IP地址非常少的情况下,会在App Service实例升级时( 先加入新实例,然后在移除老实例 )。新加入的实例不能被分配到正确的内网IP地址,无法成功的访问内网资源。 解决方法就是为App Service增加子网地址, 最少需要/26 子网网段地址。
|
25天前
|
开发框架 .NET Windows
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
|
25天前
|
C++
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub
|
25天前
【Azure Logic App】在逻辑应用中开启或关闭一个工作流是否会对其它工作流产生影响呢?
【Azure Logic App】在逻辑应用中开启或关闭一个工作流是否会对其它工作流产生影响呢?
|
25天前
|
安全 前端开发 网络安全
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER

热门文章

最新文章