How to set/change app service plan on an app service through azure cli (using az webapp update --set)

Zhanelya Subebayeva 0 Reputation points
2023-10-13T13:35:23.95+00:00

Hi,

I've been trying to set/change app service plan via az cli on an app service.

I've tried the following attempts, but neither of them worked, is there a way to change app service plan on an app service via az commands?

Thank you

   #az webapp update -g $SRA_RESOURCE_GROUP --n $APP --set plan=$PRELIVE_ASP
   #az webapp update -g $SRA_RESOURCE_GROUP --n $APP --set appServicePlanId=$PRELIVE_ASP_ID
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,914 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tushar Kumar 3,371 Reputation points MVP
    2023-10-13T16:24:54.9766667+00:00

    Hi Zhanelya Subebayeva,,

    Unfortunately, we can't change the App Service Plan through CLI, otherwise, it would have shown on documentation: https://learn.microsoft.com/en-us/azure/app-service/app-service-plan-manage#move-an-app-to-another-app-service-plan

    az webapp update supports only following flags:

    az webapp update [--add]
                     [--client-affinity-enabled {false, true}]
                     [--force-dns-registration {false, true}]
                     [--force-string]
                     [--https-only {false, true}]
                     [--ids]
                     [--minimum-elastic-instance-count]
                     [--name]
                     [--prewarmed-instance-count]
                     [--remove]
                     [--resource-group]
                     [--set]
                     [--skip-custom-domain-verification {false, true}]
                     [--skip-dns-registration {false, true}]
                     [--slot]
                     [--subscription]
                     [--ttl-in-seconds {false, true}]
    

    Please Click "Accept as Answer" if this helps

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.