Deploy one function in an Azure function app


Deploy one function in an Azure function app


Issue:

·       Is it possible to deploy just one function in an Azure function app?

·       Can I deploy single function when there are multiple functions?

·       Azure functions deploy single function?


Solution:

There are various ways to deploy your function app e.g.
·       Visual Studio,
·       Visual Source Code,
·       Dev Ops
·       MSDEPLOY
·       Zip Deploy
·       ARM Template
·       GIT

but all these allow us to deploy whole function app as a single unit but not the single or one function while there are multiple functions available in your function app.

Ideally you should be deploying the entire function app as a single unit which is the best practice but sometime if you want to deploy a single function (which is not recommended) then you can use the REST API which support deploying individual functions in a limited way.

You need to send a PUT request to update your function. Please note, in this case your function app should have been created already.

PUT

/subscriptions/{subscription ID}/resourceGroups/{resource group name}/providers/Microsoft.Web/sites/{function app name}/functions/MyFunction?api-version=2015-08-01


Again, the use of this API is highly not recommended. You should instead deploy your entire Function App as a single unit

References,





The pricing tier PremiumV2 is not available for this resource group


The pricing tier PremiumV2 is not available for this resource group.

Issue:

·       The pricing tier PremiumV2 is not available for this resource group. Please redeploy or clone your app into a new app service plan in a new resource group.

  • The scale operation is not allowed for this subscription in this region. Try selecting different region or scale option



Solution:
This is very commonly known issue which we face in azure app service either at the time of creating a new one or during deployment through ARM template.

All apps in a resource group and in a region land on one scale unit. This error (Requested feature is not available in resource group <RGName>. Please try using a different resource group or create a new one) happens when we are requesting workers that are not supported by that scale unit (e.g. if we’re requesting P1V2 on an older scale unit that does not support it).
Using a different Resource Group would land this request on a different scale unit which supports the requested features. In this case, the call will succeed.
More information about this can be found in our documentation here: https://docs.microsoft.com/en-us/azure/app-service/app-service-configure-premium-tier

Azure deploys each new App Service plan into a deployment unit, internally called a scale unit. Each region can have many scale units. You can’t specify the scale unit you want when creating a plan. However, all plans created with the same resource group and region combination are deployed into the same scale unit. For example, if you created a plan in resource group A and region B, then any plan you subsequently create in resource group A and region B is deployed into the same scale unit.

Having said that, if you are creating a new App Service Plan now within an existing same resource group that once already had a non-premiumV2 App Service Plan deployed in it, then this scale unit will not support PremiumV2 tier creation since it belongs to an older deployment. Therefore, the support for P1v2 App Service Plan is not available for you. However, creation of an App Service Plan in your region  should still be possible if you create the App Service Plan in a new Resource Group.

As suggested in the link https://docs.microsoft.com/en-us/azure/app-service/app-service-configure-premium-tier#scale-up-from-an-unsupported-resource-group-and-region-combination, for pre-existing apps that are in scale units that can’t support Pv2, relocation by way of cloning is the right approach.

As per my understanding, creating a new resource group and try to create and a fresh App Service Plan in P1v2 should work in your scenario, as the resource group you now create would be pinned to a scale unit which supports P1v2.