Azure Function: How to create dynamic app service plan

Viewed 132

I have an azure function that switches between its dynamic app service plan and elastic plan based on the hours of the day. The issue is, the dynamic app service plan was accidentally deleted.

Is there a way to create a new standalone dynamic app service plan? I looked at az functionapp plan create, it creates every kind of plan except dynamic plan.

I am thinking I have to create a new azure function which will generate a new dynamic plan, then drop the function, which will allow me to use the plan for the original function.

1 Answers

Using the Davidebbo's syntax given in the GitHub Azure PowerShell docs, I have created the Consumption (dynamic) hosting plan using PowerShell:

$resourceGroupName = "HariTestRG"
$SkuName = "Y1"
$SkuTier = "Dynamic"
$WebAppApiVersion = "2021-02-01"
$location = "centralus"

$fullObject = @{
        location = $location
        sku = @{
            name = $SkuName
            tier = $SkuTier
        }
    }
    
$appServicePlanName = "KrishDynamicAsp01"



New-AzureRmResource -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Web/serverfarms -Name $appServicePlanName -IsFullObject -PropertyObject $fullObject -ApiVersion $WebAppApiVersion -Force

Result:

enter image description here

Related