Issue when create App service plan using power shell CLI

Sarathi J 0 Reputation points
2024-11-20T06:43:51.0966667+00:00

Hi ,

I am facing issue in Creating Azure App service plan using power shell command in both Portal and Powershell App

Error :New-AzAppServicePlan: Operation returned an invalid status code 'Unauthorized'

Power Shell Command :New-AzAppServicePlan -Name 'aspfreeplan' -ResourceGroupName 'rg-ase-test' -Location 'CanadaCentral' -Tier 'Free'

Note : I am using free trial subscription

Please help to resolve the issue

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,022 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 1,035 Reputation points Microsoft Vendor
    2024-11-21T14:37:28.49+00:00

    Hi @Sarathi J
    Verify the Azure Subscription Type

    Free Trial Subscription Restrictions: Free trial subscriptions often come with specific restrictions (e.g., limited resources, certain features disabled). Make sure you're not hitting these limits. For example, free tier services may be restricted for creating new App Service Plans.

    Upgrade to Pay-As-You-Go: If you're using a free trial, you may need to upgrade to a Pay-As-You-Go subscription or another type that allows more flexibility for resource creation. Check your subscription type by navigating to Subscriptions in the Azure portal.

    Create the App Service Plan in a Different Region

    If you're still encountering issues, try creating the App Service Plan in a different region. Sometimes, certain regions might have specific restrictions or resource availability problems, especially on free or low-tier subscriptions.

    When creating the App Service Plan, try selecting a different region (such as East US, West Europe, etc.) and see if that resolves the issue.

    Check Subscription and Resource Group Compliance

    Ensure that the resource group you’re trying to use is correctly configured and isn’t restricted by any policies.

    Verify that the resource group and subscription are in good standing, and there are no policies or locks preventing the creation of resources.

    More information about App service Plans:

    https://learn.microsoft.com/en-us/azure/app-service/overview-hosting-plans

    Azure CLI: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
    I hope this information is helpful.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it.


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.