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.


Monday, 25 February 2019

Azure Resources Created Date /Azure app Service Created Date


Azure app Service Created Date

Azure Resources Created Date


Issue:
·       Get the list of resource with created date
·       Web App Created date
·       How can I know when my web app is created?

Solution:
It is not possible to get the web app created date directly.

You can check relevant details on Activity Logs.

Through activity logs, you can determine:

·       What operations were taken on the resources in your subscription
·       Who started the operation?
·       When the operation occurred
·       The status of the operation
·       The values of other properties that might help you research the operation

I just created one web app and able to see the activity logs. You can also check who created it in “Event Initiated By” columns




But Activity log has limitation as it retained logs only for 90 days. You can query for any range of dates, as long as the starting date is not more than 90 days in the past.

You can get more information in below URL,

I have investigated and observed that there is no REST API exposed for the web app’s created date property hence we have to think about the alternative way to achieve this.
And one of the most important feature which can help us here is the “TAGS
TAGS are used to organize your azure resources.
You apply tags to your Azure resources giving metadata to logically organize them into a taxonomy. Each tag consists of a name and a value pair.
For example, you can apply the name "Environment" and the value "Production" to all the resources in production similarly you can have “CREATED DATE” tag with the date value.
After you apply tags, you can retrieve all the resources in your subscription with that tag name and value. Tags enable you to retrieve related resources from different resource groups. This approach is helpful when you need to organize resources for billing or management.

You can get more details on below URL,


Once you create tags for “created date” than you can get the list of all your web app/App Services along with the created date.

You can go to your subscription -> resources -> Edit Columns
You can see the  filter name “Tags”



Once you select the Tags and move it to right section then then tag column appear in the filter and you can see the list of all web app along with “created tag” value.



I understand that it is not possible to add tag every time when someone create a web app hence you can use Azure Policy to enforce tagging rules and conventions. By creating a policy, you avoid the scenario of resources being deployed to your subscription that don't comply with the expected tags for your organization. Instead of manually applying tags or searching for resources that aren't compliant, you can create a policy that automatically applies the needed tags during deployment. The following section shows example policies for tags.

You can get more details on below URL,

You can simply apply tag and it’s default value.



References: 


Monday, 18 February 2019

Azure web app Multiple FTP Users

Azure web app Multiple FTP Users



I noticed many users wants to have Multiple FTP users for Azure App Services.

Azure web app provide 2 type of deployment credentials,
  • User Level
  • App Level
User level credentials are for entire Azure account which can be used to deploy to any web app for the subscription while App Level credentials are particular web app specific and can't be used with any other web app. 

Get more details on below URL,


It seems, Azure doesn't support multiple FTP users for web app. You can get more details on below URL

You can also share your feedback on that and may be they can consider this request in future.




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

Monday, 21 January 2019

Azure App Service Blank page after Deployment


Azure App Service Blank page after Deployment




Issue:
  • After deployment when you try to access the function app/web app you get blank screen.
  • You can see only blank page.
  • You didn’t do anything for this and was not sure why this message was appearing.














Solution

I observed this message is set in <title> tag of html page which function app is responding when I call the URL.










   





Now to explain this issue in more details I would like to explain the concept of 
app_offline.htm file which is the part of your deployment process.
In an effort to make Kudu deployments avoid file locking issues, Kudu will now create a temporary app_offline.htm in the site's WWWROOT folder before starting the deployment. Kudu then takes care of deleting the file after deployment is complete.
The effect is that while deployment is happening, the app will be kept offline. In addition to avoiding file locking issues, this helps keep the site is a consistent state, by not serving any traffic while the contents of the site is only half-deployed.
Note: the file will only be created if an app_offline.htm file is not already present in the site's folder.
If you'd like to turn this behavior off, please add an SCM_CREATE_APP_OFFLINE App Setting to your app and set the value to 0. For more information about configurable settings, please check this page.

You can get more information on below URL,

To get the final confirmation of this I tried to access this file from app and got the same response.(please check the URL in below screen shot)



That mean App has app_offline.htm file available in WWWROOT folder which was showing when calling the function app.

Ideally this file should have been deleted when your deployment is successful but I observed some unsuccessful deployment and that files was not deleted.

To resolve this,
  • Delete the file and try again “or”
  • Redeploy your application and make sure it is successful.

Feel free to share your 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



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