Not able to connect Azure Cloud shell from VS code - azure

I have install VS code and Node js. In VS code I have add extension for Azure Account. But when I am trying to open Azure Cloud Shell for PowerShell it is showing the below error.
FYI, I am able to access azure cloud shell from azure portal without any problem.

when I am trying to open Azure Cloud Shell for PowerShell it is showing the below error.
I installed Azure tools extension in visual studio code.
Fired this command in terminalAz login, I have already logged-in previously.
For the first time login we need to click on the link and give the code.
Then, I installed node.js extension in the editor and given the npm -v command in the terminal.
It given the latest version of node.

Related

How to run AWS API gateway developer portal in local machine and change the UI

I need to make some UI changes in AWS developer portal. So I followed this steps to install developer portal in my windows machine. its installed without any errors.
the problem is when I run the application using node run start I'm getting this screen
The UI components is not loaded correctly and throwing some errors. same UI code working correctly in my AWS account.
How to run this in local machine?

Getting error "Request to a downlevel service failed" when deploying to Azure

As of today I have begun getting the following error when I try to deploy our ASP.NET web services to our Azure web hosting from Team Foundation Services 2015.
Getting down to the details of the error message we have the following.
It generates warnings when executing the Get-AzureWebsite script then generates an error when executing the New-AzureWebsite script.
This has been working for several years without a problem but as of today it is now generating an error. I am unable to deploy our latest code changes because of this error.
UPDATE
After some investigation it appears as if the Azure scripts that are used to underpin the TFS tasks have all been deprecated. Which therefore begs the question, what is the migration path for those deploying to Azure using TFS 2015? Is there a new TFS task which will use the new scripts instead? How do I update my TFS deployment so that it doesn't generate this error?
UPDATE2
I have installed the latest PowerShell and installed the Azure RM Automation cmdlets. I have updated the script Publish-AzureWebDeployment.ps1 to use Get-AzureRmWebApp instead of Get-AzureWebSite and New-AzureRmWebApp instead of New-AzureWebSite but I'm still getting errors.
Have Microsoft provided any updates to TFS or the underlying Azure deployment scripts since deprecating the old Azure scripts? Surely Microsoft aren't expecting the developers to re-write these scripts ourselves?
My solution to the my problem was a workaround. Instead of deploying my application to our Azure hosting using an Azure Web App Deployment task, I have created an FTP script that does this. I am using WinSCP as this can be run from the command line and has the ability to easily synchronise your local and remote directories without to write any complex FTP commands. It does this
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=ftpDeployServices.ftp
And here's the FTP script ftpDeployServices.ftp.
option batch abort
option confirm off
option transfer binary
open ftp://myusername:mydomain.ftp.azurewebsites.windows.net/site/wwwroot
cd /site/wwwroot
synchronize remote -delete "C:\DEV" /site/wwwroot
close
exit

How to deploy Microsoft botbuilder nodejs app to azure using CLI?

I am trying to deploy the basic-bot Microsoft Botbuilder sample application to azure.
I started by creating a new botbuilder node.js sample application through the Azure dashboard, and I was able to successfully follow the instructions here to download and redeploy the application.
I then attempted to copy over the deploy scripts and .env file from the downloaded sample application into the basic-bot application, and attempted to publish using the az bot publish command from the link above. This successfully deployed the basic-bot application, but the deployed application now returns 500 errors. Initially, the 500 errors were caused by the "botbuilder-ai" nodejs package not being installed. I installed this package manually through the Azure console, and this error went away. But the application continues throw 500 errors, without producing a stack trace, and I have not been able to determine why.
The only official documentation I have found that explains how to deploy the bot is specifically for C# and Visual Studio. Is there a way to deploy a bot to azure for a Node.js app using the azure CLI?
Thank you.
Is there a way to deploy a bot to azure for a Node.js app using the
azure CLI?
Yes there is. You can type az bot publish -h for all the options available to you when publishing a bot. Here are some tips about getting it to work:
You will need to log in to Azure with az login
Make sure you've set an active subscription. Type az account set -h for help. Use az account list to see your choices of subscriptions and az account show to see the current active subscription
Publishing can be easier if you set the resource group you're publishing to as your default. Unlike your active subscription, configured defaults don't reset when you log out. Use az configure to see your current defaults and az configure -h to see how to set a default resource group
If you publish and it says Not a valid azure publish directory. missing post deploy scripts then you'll need a PostDeployScripts folder in your bot folder
There are some instructions in the deploymentScripts folder that you might find helpful. Note that as an alternative to the Azure CLI, you can also publish from Visual Studio Code using the Azure App Service extension.
If you publish successfully and you're getting errors when you try to test in Web Chat, sometimes Azure needs a little nudging. When I checked my Channels blade it said Web Chat was encountering errors regarding missing files. I tried some troubleshooting steps and eventually got it to work without any real changes.
Try logging out of your Azure account in the online portal and then logging back in
Try running your code in the online code editor in the Build blade
Try publishing again
Regarding your specific situation of trying to repurpose the downloaded source code to deploy the basic-bot sample, there are a few things you need to know. The .bot file is very important as it contains information about all the services the bot uses, but basic-bot.bot contains none of the needed information. In addition to the deployment scripts and the .env file you will also need to copy over your .bot file. However, basic-bot's bot.js expects the .bot file to contain a LUIS service named "basic-bot-LUIS" so you need to go into the bot.js code and change the value of LUIS_CONFIGURATION to the name of the LUIS service in your .bot file ("BasicBotLuisApplication" if you downloaded the V4 Basic Bot NodeJS code and kept it the same). Make sure you can get the basic-bot sample to run locally before you try to publish it.

Azure Bot Service set node.js version not working

Specifying a Node.js version in Azure Bot Service doesn't seem to work.
In Azure portal, navigate to the bot service instance, then in application settings set the environment variable WEBSITE_NODE_DEFAULT_VERSION to 7.7.4, which is the highest version available as of 22/05/2017. However it turns out the node.js runtime is still v6.5.0!
In Kudu -> Environment it shows:
WEBSITE_NODE_DEFAULT_VERSION = 7.7.4
and
Path = D:\home\site\deployments\tools;... D:\Program Files (x86)\nodejs\7.7.4;...
Couldn't find where this v6.5.0 node.js version was set. Maybe in IIS settings? It would be good if azure bot service allows to use customized node.js version rather than the system provided lag version. So is there a fix or work-around? Thanks.
Currently Azure Bot Service (Preview) only supports Node.js v6.5 LTS and does not provide any advanced version configuration options as you described.
Keep in mind that when you create a bot with Azure Bot Service (Preview), you are creating an Azure Functions app (in the background). Azure Functions has their Node.js version locked at v6.5 as described in their documentation.
The node version is currently locked at 6.5.0. We're investigating adding support for more versions and making it configurable.
If you would like to install and run a specific version of Node.js, you will need to setup a VM and configure it to your specifications.
Alternatively, you can deploy your SDK Bot (aka not using Azure Functions) to Azure App Service on Linux (Preview), which will allow you to select a Node.js version in the v6.x LTS range, for example v6.10.2 + npm v3.10.10. In this scenario, you must specify the specific Node.js and npm version in your package.json "engines" section. You can read more about this option in my blog article: Deploying Bot Framework To Azure On Linux
For other people who want to customize their node.js version for their bots, I've found a way: use Azure App Service instead of Azure Bot Service. Here is how:
Create your Azure app from the Azure portal, and choose the node.js template
(optional) Configure Continuous Delivery
Register your app in Bot Framework portal
start Kudu Cmd console
cd D:\home\site\wwwroot
md bin
cd bin
then download the node.js version you like, e.g.
curl -O http://nodejs.org/dist/latest/win-x64/node.exe
Using Kudu, modify D:\home\site\wwwroot\web.config to point to your entry .js file (default is server.js) and add the following line:
<iisnode watchedFiles="web.config;*.js"
nodeProcessCommandLine=""D:\home\site\wwwroot\bin\node.exe""
/>
Following the steps above, you are no longer restricted by the locked node v6.5, and use the latest node.js feature as you wish.

Can't figure out how to generate & view logs for nodeJs bot on Bot Service

I deployed my nodeJs bot to Bot Service recently, and i can't seems to figure out how to generate and view it's logs.
when i try to enable logging, i constantly getting an unknown error
Looking at the log files on the server, there is no file who logs the node application
Tried to log to Application insights, without success.
help?
Assuming your bot is hosted through Azure via an App Service, you should be able to see logging from your NodeJS application by performing the following steps:
Enabling Logging
Click on the App Service box on your Azure dashboard, or navigate to the resource via the top search bar.
In the side menu, under Monitoring, navigate to Diagnostic logs.
Make sure that Application Logging (Filesystem) is turned on.
Now, in the root directory of your NodeJS application \site\wwwroot, you want to create a file named IISNode.yml and inside of it write the line loggingEnabled: true. This will enable your application to write stderr and stdout to the log stream.
From here, you just need to access the log stream of your application, and there are 3 ways.
Accessing the Log Stream
Personally, I prefer using the Azure Command-Line Interface, which you can easily install using the node package manager or npm.
To install the Azure CLI, issue the following command on your terminal:
npm install -g azure-cli
or sudo npm install -g azure-cli if you need root permission.
If you need more information on how to install the Azure CLI look here.
Now you have to log into your Azure account through the Azure CLI so that it can access your subscription. This is done via azure login.
Once you have finished logging in through the command line, you need to switch to service management mode with the command azure config mode asm.
Then you can use azure site list to get a list of your current Azure sites.
In the list, find the site that you want the logs for, and find its name in the Name column. Then use the command azure site log tail <sitename> and the terminal will start to output live logs straight from your application!
Other Options
The above method is only 1 of the 3 methods you can use to access these logs. If you want more information on the other 2 methods then follow this link.
That above link also contains a lot of the information I outlined in my post.
I hope this helped!

Resources