Friday, 15 March 2019

Azure PowerShell - Request to a downlevel service failed


Azure PowerShell - Request to a downlevel service failed


Issue:
·       Sometime when we run the PowerShell command, we get following error message,
o   Request to a downlevel service failed
·       Example: Switch-AzureWebsiteSlot

Solution:

The reason for error message “Request to a downlevel service failed” is Deprecating Service Management APIs.

Issue was happening because your CmdLets are using the Service Management API which is deprecated for Azure App Service.

You can get more information on below URLs,

To resolve this, You should implement the ARM equivalent.

Your command should have “RM” e.g. Switch-AzureRmWebAppSlot instead of
Switch-AzureWebsiteSlot

I hope this helps.

Azure Functions: Invalid Length for a Base-64 char array or string


Azure Functions: Invalid Length for a Base-64 char array or string


Issue:
·       My function is throwing error - Invalid Length for a Base-64 char array or string
·       My function is using Storage Queue trigger/binding

Solution:

This issue happens when you have storage queue trigger function.
When you send message to storage queue, it expects you to send in base64 encoded string.
Functions expect a base64 encoded string. Any adjustments to the encoding type (in order to prepare data as a base64 encoded string) need to be implemented in the calling service.
This can also be seen on portal when you send message to queue manually.

Invalid Length for a Base-64 char array or string



You should send message in Base64 format.
For example, if you have JavaScript function then you can use btoa module for converting your message to base64 format.


Your function exception will disappear once you send message in base64 format.
I hope this helps.

Tuesday, 12 March 2019

Unable to connect to the Microsoft Visual Studio Remote Debugger(MSVSMON.EXE)

Unable to connect to the Microsoft Visual Studio Remote Debugger (MSVSMON.EXE)



Issue:
System.Runtime.InteropServices.COMException (0x89710023): Unable to connect to the Microsoft Visual Studio Remote Debugger named XYZ.azurewebsites.net'.  The Visual Studio 2015 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging.at Microsoft.VisualStudio.Debugger.Interop.Internal.IDebuggerInternal120.ConnectToServer(String   szServerName, VsDebugRemoteConnectOptions[] pConnectOptions, CONNECT_REASON ConnectReason, Int32 fIncrementUsageCount, IDebugCoreServer3& ppServer)

Solution:

·       This exception is related to MSVSMON.EXE
·       This exe should be running to perform remote debugging.
·       We can verify this exe in kudu site-> Process Explorer
·       Once we enable remote debugging setting,



·       Please verify whether this EXE is running or not before performing remote debugging.
·       If you see this exe and still not able to remote debug then
o   kill that exe.
o   Disable remote debugging setting
o   Enable remote debugging setting
o   Verify that exe is running.
o   Restart web app if needed.

·       The exception message is also indicating about firewall setting.
·       To enable remote debugging for Visual Studio the port number 4020 should be open.



I hope this helps.

Thursday, 7 March 2019

Azure | How to Migrate from Consumption Plan to App Service Plan


Change Function app hosting plan


How to Migrate from Consumption Plan to App Service Plan


Issue:
  • I want to change my consumption plan to app service plan
  • I want to change my app service plan to consumption plan
  • Is there any way to change Azure function hosting plans?


Solution:

You may see lot of articles and blog which suggest you can change function app hosting plan and you will be able to achieve that also but according to Microsoft recommendation, You should never do this. Your function app will be messed up and you will see lot of issue.

This has been mentioned on Microsoft Official documentation.

You must choose the type of hosting plan during the creation of the function app. You can't change it afterward.



The only option is: You should create a new function app in different hosting plan and update/deploy your code.

Please don’t try to change function app hosting plan. This may be possible in future but not now.

Hope this helps.


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...