Azure / Azure-Functions

1.11k stars 194 forks source link

[Premium]Setting PreWarmed Instance count of azure function app in premium plan using ARM template #1366

Open mijo89joseph opened 4 years ago

mijo89joseph commented 4 years ago

I am trying to create an azure function app using deployed under premium plan using ARM template. In the template used I have added the property "preWarmedInstanceCount" under Microsoft.Web/sites/config/web. I am using the latest apiVersion 2018-11-01 for the Microsoft.Web/sites resource. When I deploy the template I am getting the error "siteConfig.PreWarmedInstanceCount is invalid. It is only supported for 2019-03-01 api-version or newer."

To fix the error I tried changing the API version to "2019-03-01" then I started getting the error saying "NoRegisteredProviderFound : No registered resource provider found for location 'westus' and API version '2018-12-01-alpha' for type 'sites'. The supported api-versions are '2018-11-01, 2018-02-01, 2016-08-01, 2015-08-01-preview, 2016-03-01, 2015-08-01, 2015-07-01, 2015-06-01, 2015-05-01, 2015-04-01, 2015-02-01, 2014-11-01, 2014-06-01, 2014-04-01, 2014-04-01-preview, 2015-01-01, 2015-11-01, 2016-09-01, 2017-08-01, 2018-12-01-alpha'. The supported locations are 'centralus, northeurope, westeurope, southeastasia, westus, eastus, japaneast, eastasia, eastus2, northcentralus, southcentralus, brazilsouth, australiaeast, australiasoutheast, southindia, canadacentral, canadaeast, ukwest, uksouth, westus2, msftwestus, msfteastus, msfteastasia, msftnortheurope, eastus2stage, centralusstage, northcentralusstage, francecentral, southafricanorth, japanwest, centralindia, koreacentral, westindia, australiacentral, germanywestcentral, koreasouth, westcentralus, eastasiastage'".

Can someone help me to set the pre warmed instance count using ARM template?

ra-hulk commented 4 years ago

Hi @mijo89joseph, I had the same error initially (siteConfig.PreWarmedInstanceCount is invalid). As the error message suggested, I updated the API version to "2019-03-01", but end up the same error as you did after you changed the API version as well. However, I noticed that the second time the error message had listed some API version it does support -

##[error]NoRegisteredProviderFound : No registered resource provider found for location 'australiasoutheast' and API version '2019-03-01' for type 'sites/slots'. The supported api-versions are '2019-08-01, 2018-11-01, 2018-02-01, 2016-08-01, 2016-03-01, 2015-08-01, 2015-07-01, 2015-06-01, 2015-05-01, 2015-04-01, 2015-02-01, 2014-11-01, 2014-06-01, 2014-04-01, 2014-04-01-preview, 2015-01-01, 2015-11-01, 2016-09-01, 2017-08-01, 2018-12-01-alpha, 2015-08-01-preview'. The supported locations are 'centralus, northeurope, westeurope, southeastasia, westus, eastus, japaneast, eastasia, eastus2, northcentralus, southcentralus, brazilsouth, australiaeast, southindia, canadacentral, canadaeast, ukwest, uksouth, westus2, msftwestus, msfteastus, msfteastasia, msftnortheurope, eastus2stage, centralusstage, northcentralusstage, francecentral, southafricanorth, japanwest, centralindia, koreacentral, westindia, australiacentral, koreasouth, westcentralus, eastasiastage, australiasoutheast'.

Notice the first version listed in the error message it does support (2019-08-01). I changed my API version to that one and it worked.

Hopefully this fixes your problem.