Monday, 22 July 2019

Azure Functions | Microsoft.Azure.WebJobs.Script.WebHost: Repository has more than 10 non-decryptable secrets backups


Microsoft.Azure.WebJobs.Script.WebHost: Repository has more than 10 non-decryptable secrets backups


Issue:
·       The function runtime is unable to start. Microsoft.Azure.WebJobs.Script.WebHost: Repository has more than 10 non-decryptable secrets backups.
·       Internal Server Error.

Solution:

Sometimes you may see this issue in your Azure functions. You check this error message again then it indicates something about secrets backups and secret keys and folder for any function app is stored in the following location of KUDU site,

D:\home\data\Functions\secrets

If you go to this location then you can see some snapshots file there.





Please note, Limit of these backup is 10 and if you have more backup then you will see this exception.

To solve this issue, you need to take the backup of this folder and delete “*.shapshot.*.json” files or secret folder itself to regenerate secret files.

If runtime can’t decrypt secrets then they will be regenerated and non-decryptable secrets will be stored in “*.snapshot.*.json” files.
Exception bellow start firing if number of snapshots > 10.

This can happen:
  1. If you delete the app and recreate it with the same name.
  2.  If some functions app uses the same storage account.


You may have to restart the Azure function after deleting the secret backups.

I believe this helps. Please share your query/feedback.



Other useful references,

Issue: Azure Functions: The Consumption pricing tier is not allowed in this resource group


Issue: Azure function is throwing one of the following exceptions
·       Unable to retrieve Functions Keys
·       We are not able to retrieve the keys for function
·       The function runtime is unable to start.
·       Function host is not running.
·       Internal Server error.
·       Service Unavailable.


Issue: Disable Azure functions





Excel in Azure App Service or web app | The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine


Excel in Azure App Service or web app

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine


Issue:
·       How can I use Excel in Azure app service?
·       The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine
·       Error while uploading excel through Application?
·       I am getting error when using excel in Azure app service.

Solution:

Using excel in web application is very common but many users reported that it is not working in Azure app service while working fine in local.

Sometimes they see below error message,

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

Please note,

'Microsoft.Ace.OLEDB.12.0' provider is not available in Azure App Services. As the App Services environment is a PaaS offering of azure, there is no way you can install drivers.

This feedback has already been shared but Azure could not implement this due to some technical restriction.

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine


You should be aware about Azure web app Sandbox where all azure web app runs.
This will clear the concept why it is not supported and why can’t you install it in web app



I found one solution to use excel in azure app service.
You can implement this through OpenXML SDK.  

You just need to download it and write your code.

I have used it web app and now I am able to perform all excel operation successfully.

I hope this helps. Please share your query/feedback



Other useful references,


Issue: Azure Functions: The Consumption pricing tier is not allowed in this resource group




Issue: Azure function is throwing one of the following exception
·       Unable to retrieve Functions Keys

·       We are not able to retrieve the keys for function

·       The function runtime is unable to start.

·       Function host is not running.

·       Internal Server error.

·       Service Unavailable.




Issue: Disable Azure functions



Sunday, 21 July 2019

Azure app Service with entity framework System.NotSupportedException


Azure app Service with entity framework System.NotSupportedException


Issue:

·       System.NotSupportedException: Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config?


Solution:

If you are facing this exception, then chances are you are using function app V2(.Net core) with Entity Framework 6.
This happened in my case and I observed that Function App V2(.Net core) is not supported with Entity Framework 6.

If you create a function in V1 with Entity Framework 6 then you will not face this issue. I Created a sample function app (http trigger) with V1 and EF6 which worked fine.

You can get more information in below URL,

Please use Entity Framework core with your function app V2.

I believe this helps. Please share your query/feedback.


Azure App Service | Add/Modify/Update application settings using PowerShell


Issue:

·       How can I update Azure app service application settings through PowerShell?

·       Add/Modify/Update application settings for azure app service using PowerShell.


Solution:



$resourceGroupName ="Your resource group name"

$appServiceName = "Your web app name"

$webAppOutput = Get-AzureRmWebApp -ResourceGroupName $resourceGroupName -Name $ appServiceName

$ webAppOutput.SiteConfig.AppSettings

$newAppSettings = @{}

$newAppSettings.Add("new setting"  ,   "new Value")


Set-AzureRmWebApp -AppSettings $newAppSettings -Name $ appServiceName -ResourceGroupName $resourceGroupName



I hope this helps. Please share you query/feedback.




Other references,


Issue
: Azure Functions: The Consumption pricing tier is not allowed in this resource group




Issue:

1.     Unable to retrieve Functions Keys

2.     We are not able to retrieve the keys for function

3.     The function runtime is unable to start.

4.     Function host is not running.

5.     Internal Server error.

6.     Service Unavailable.





Issue: Disable Azure functions


Thursday, 18 July 2019

Azure Functions Runtime is unreachable. Click here for details on storage configuration.


Azure Functions Runtime is unreachable. Click here for details on storage configuration.


Issue:

·       Azure Functions Runtime is unreachable.

·       Not able to do anything with this function.
·       Functions are not visible

Solution:

A very common issue which we face in Azure functions is,

Azure Functions Runtime is unreachable



Azure Functions Runtime is unreachable. Click here for details on storage configuration.


This exception is mostly related to Storage account. Either your storage account is not accessible, or credential are invalid, or storage account deleted.

When You see these types of issue, Your first troubleshooting step should be collecting the network trace immediately.
Please follow below steps to collect the network traces,
       Hit F12 on your browser
       Refresh browser (F5) - This will clear session caches
       Reproduce the issue.
       Export network trace as HAR file (Save all as HAR on Chrome/Edge/IE)

Once you have network trace then you can open it through Fiddler which will definitely give some information about some of the API failure.





While investigating this API failure I observed lot of messages related to Network.
You can click on any of the API failure (red color)  and click on preview (right side.)



As the message says something about Network, I quickly verified the network setting but I was getting this issue in other networks also that means this issue is not pertaining to the network.
  
I then checked Storage Account for this function. You can get the information about storage account from your application setting and refer either AzureWebJobsStorageor WEBSITE_CONTENTAZUREFILECONNECTIONSTRING




I further checked and confirmed unavailability of storage account. 

 Somehow my storage account was deleted by someone which was causing that issue. I created a new function app and was able to add a new function successfully.
So whenever you face this issue please check the network trace and storage account availability.

There might be other reason also. If your storage account is not deleted then you can check,
  • Are you able to tcpping your storage account form function app KUDU?
  • Do you have any firewall setting at storage account side which is preventing your function to connect with storage account.
  • Please check storage account connection string properly in your function app Application Setting section. And if possible get the storage account connection setting again and replace.

I believe this helps. Please share your feedback.


Tuesday, 16 July 2019

Azure Functions: The Consumption pricing tier is not allowed in this resource group


Azure Functions: The Consumption pricing tier is not allowed in this resource group


Issue:

·       The Consumption pricing tier is not allowed in this resource group

·       Dynamic pricing tier is not allowed in this resource group


Solution:

You may face this exception while creating the Azure functions in an existing resource group.


The Consumption pricing tier is not allowed in this resource group


The most important reason of this issue is “Scale Unit”.
Scale units are the underlying hardware and software that Microsoft manages, that Azure web apps runs on top off.

The fact that it doesn't always work in an existing Resource Group is a known limitation since Functions are not enabled in all scale units.
Eventually, all scale units will support Dynamic aka Consumption, and this condition will no longer be there.

Until then you can,
·       Create a new Resource Group.
·       Move your resource to other resource group where Consumption plan is supported.
·       Wait for consumption plan to be available in all scale units.



References:


I hope this helps.  Please share your feedback






Azure Functions | Unable to retrieve Functions keys | The function runtime is unable to start |Function host is not running | We are not able to retrieve the keys for function


Azure Functions | Unable to retrieve Functions keys |  The function runtime is unable to start | Function host is not running


Issue:
You might face one of the following exceptions while working with Azure functions.

·       Unable to retrieve Functions Keys

·       We are not able to retrieve the keys for function

·       The function runtime is unable to start. 

·       Function host is not running.

·       Internal Server error.

·       Service Unavailable.


Analysis:

When you create an Azure functions then few keys are created with it.
You can check those keys in “Function app Settings” section. 
Same keys can also be checked in the managed section.

We are not able to retrieve the keys for function


These keys are known as authorization keys. Refer below URL for more info


The most probable root cause of these exception is, “MISSING HOST KEYS”.

You can check below screen shot where I deleted the host keys and I started getting these exception messages.



These messages indicate REST API failure which retrieve host keys.


Solution:

The quickest way to resolve this issue is to RESET/CREATE these keys.
·       Go to KUDU https://<yourapp>.scm.AzureWebsites.net
·       Debug Console-> CMD.
·       Go to the secret keys path d:\home\data\functions\secrets
·       Download host.json file for backup and delete host.json file
·       Go to Process Explorer from top menu
·       Right click on the w3wp.exe process -> Kill

We are not able to retrieve the keys for function

·       RESTART your function app.
·       This action will create host.json and will create new keys.

Now, when you will open your function app again, you will observe that those keys are created, and exception message is disappeared.

We are not able to retrieve the keys for function

   Hope this helps. Please share your feedback.



Azure Functions | Microsoft.Azure.WebJobs.Script.WebHost: Repository has more than 10 non-decryptable secrets backups

Microsoft.Azure.WebJobs.Script.WebHost: Repository has more than 10 non-decryptable secrets backups Issue : ·        The function runtime is...