Deploy Microsoft Node.js bot using Visual Studio - botframework

I have created Azure Bot service for nodeJS LUIS bot.
Downloaded the zip file to for local development.
Now I want to publish the changes back to Azure Bot from Visual studio 2017.
Which different environment variables I need to set to publish from desktop without using Visual studio services.

You can setup continuous deployment by following the guidelines in this article.
Download your source code via .zip file from the Azure Bot Service interface.
Upload your code to one of the following source control providers:
Visual Studio Team Services
OneDrive
Local Azure Git Repository
GitHub (recommended)
Bitbucket
Dropbox
External Repository
In Azure Bot Service, select "Settings", then go to the section "Continuous deployment" and click the "Configure" button under the section "Step 3: Configure continuous deployment"
In the "Deployments" blade, click the "Setup" link by the gears icon.
In the "Deployment option" blade to the right, click "Choose Source"
Select the source control service your selected in step 2 above, for example GitHub
Configure your repository-specific settings in the "Deployment option" blade, including project and branch, then click "OK"
You should see a popup notification that says "Setting up deployment source"
In the "Deployments" blade of your Bot Service, you should see a log of your current deployment.
Done!
Now when you push changes to your code repository, it will trigger an automatic redeployment of your bot's code, which you can monitor using the "Deployments" blade.
For more information, check out the complete article on Azure Continuous Deployment here:
https://learn.microsoft.com/en-us/azure/app-service/app-service-continuous-deployment

You can also open the Advanced settings in Azure:
And download the publish profile:
Then, create a new Visual Studio Node.js project using the "From Existing Node.js code" TypeScript template (selecting the folder that contains the files downloaded):
Visual Studio Node Project Wizard 1:
Visual Studio Node Project Wizard 2:
Finally, import the publish profile downloaded earlier:
You should now be able to publish directly from Visual Studio.

Related

Visual Studio 22 was unable to set secret '(Azure App Service name)_FFFF' because you may not have collaborator access to the repository '_git/(name)'

In short, taking action
Visual Studio 2022 > Publish > Deployment type > CI/CD using GitHub Actions workflows (generates yml file)
Throws error
Visual Studio 22 was unable to set secret '(Azure App Service name)_FFFF' because you may not have collaborator access to the repository '_git/(name)'
More detailed steps
Install Visual Studio 2022
Sign in with
Scaffold project
Adapt scaffolded code to requirements
Publish
Publish steps
Right click publish
Add a publish profile
Target > Azure
Azure App Service (Windows)
Set subscription name VS professional, view correct resource group, able to select correct App Service instance
Select deploy as .zip package to true
Choose CI/CD using GitHub Actions workflows (generates yml file)
I was able to fix this by recreating the repo. BE VERY CAREFUL WHILE DOING THIS.
Delete the repo from github (optional step and dangerous)
In the root directory of your local repo, show hidden files and delete the .git folder.
Restart visual studio.
Recreate the repo from visual studio.
This is probably NOT the best answer, it worked for me. But there was some bug in my git repo not allowing it see me as the owner of the repo.

Push to Azure DevOps from Visual Studio with Agile Process as Default

I connected Azure DevOps to Visual Studio and when I press "Publish Git Repo" everything is working fine.
But it always creates a Scrum process Dashboard.
I made Agile as default and disabled all of the others in my organisation.
Now Visual Studio throws this error
VS403119: You cannot add a team project with process Scrum as it is disabled. Either choose a different process, or enable process Scrum and try again.
So it means the setting is somewhere in Visual Studio.
The only thing I found about it is this two years old question.
Do you know the setting or some config file to change the default process board when publishing to the Azure DevOps from Visual Studio?
Visual Studio always specifies Scrum process when creating Azure Devops project via its Team Explorer, as I know there's no VS settings available to manage this behavior.
As a workaround you can create the project with Agile process in web portal first, add local project/solution into source control and choose Target Project(Click Advanced) before publishing the repo:
Actually this behavior is VS-specific cause Azure Devops itself supports specifying process template even by Rest API. So I decide to post a feature request related to your requirements in User Voice forum with VS tag instead of Azure Devops tag. The product team would provide the updates if they view it.

Bot works in Bot Framework Emulator on local computer, but not after it's deployed to Microsoft Azure - HTTP status code NotFound

Right now, I'm testing the steps required when it comes to starting a bot project in Virtual Studio Community 2019, testing a bot in Bot Framework Emulator (V4), and then deploying that bot to Microsoft Azure.
Right now, I'm testing a simple Echo Bot template available in Virtual Studio Community 2019. When I run it in Virtual Studio Community 2019, open the bot in Bot Framework Emulator using a provided "localhost" URL, and test it in the emulator's "Live Chat" window, it works perfectly fine.
However, after I go through the process of deploying this bot using Azure CLI (command-line tool), I find that the bot doesn't respond when I go to "Test in Web Chat" for the Bot Channels Registration resource, which is named after the BotID. When I look at the channels page, I see the following error: "There was an error sending this message to your bot: HTTP status code NotFound."
I already tried turning on "Always On" for the bot, enabling Application Insights (ASP.NET, ASP.NET Core), and integrating an application insights service with the bot.
I attached an image of the bot's files at https://"botname".scm.azurewebsites.net/dev/wwwroot/ as requested by "mdrichardson - MSFT" in the comment section of the question.
Bot File Directory
How should I resolve this issue?
It looks like you're missing this step:
az bot prepare-deploy --lang Csharp --code-dir "." --proj-file-path "MyBot.csproj"
This creates a .deployment file that gets uploaded when you deploy. Once uploaded, it tells Kudu/Azure to build the bot. It should result in your directory containing a bunch of .dll files, looking more like this:
It's possible that you didn't miss that step, in which case you just need to include the .deployment file in your code.zip and then re-run:
az webapp deployment source config-zip --resource-group "<yourGroup>" --name "<yourBot>" --src "code.zip"
Alternatively...
Since you're using the Visual Studio Template, you can:
Right-click on your project in Visual Studio, go to Publish
Stay on the App Service tab, click Publish, and go through the steps to deploy.

Deploying VirtoCommerce.Manager to Azure from Visual Studio

I am working with Virto Commerce server 2.4.561 and I'm having a great deal of difficulty successfully publishing to Azure from Visual Studio. Based on the documentation provided, it's not clear to me what the appropriate method is. Most guidance related to Azure assumes that I am using Git deployment. But in this case I am not. I am coding locally on my dev machine and I would like to be able to use web deployment to deploy directly to Azure from Visual Studio. However, the guidance found here seems to suggest that if you want to do your own deployment, you need to use deploy.cmd. I'm not exactly sure why that is. I can only guess that it has something to do with how the modules need to be packaged up.
I am able to run deploy.cmd and it appears to succeed, but I end up with an artifacts folder with 2,000+ files and folders in it and I am left to use old-school FTP to sync all those files up with the Azure website. Is this how it is meant to be done? I have tried to deploy directly from Visual Studio to Azure, and it appears to succeed, but the site does not behave correctly. Specifically, the custom modules I've built don't load correctly.
What is the right way to do this?
There is a way to publish your custom module directly from Visual Studio, but you still need a working Virto Commerce in Azure beforehand, and the easiest way to set it up is to use the Deploy to Azure button in GitHub.
In the Azure portal create a new virtual application /MyModule with
physical path site\wwwroot\admin\Modules\MyModule. It will be used
for publishing a custom module.
Download the source code from GitHub with the same version as you have published to Azure, add your custom module to the solution and build it.
In Visual Studio right-click on your module project and select Publish.
On the Profile screen select Microsoft Azure Web Apps as a publish target and select your Azure Web App.
On the Connection screen select Web Deploy as a publish method and add /Module to the site name. So your site name should look like this: myvc/MyModule.
On the Preview screen click the Start Preview button and make sure the file list contains only files related to your module and the action is Add for each of them.
When you click the Publish button, Visual Studio will upload all module files to the physical directory configured for the virtual application myvc/MyModule. For subsequent publishing it will upload only modified files.
Update: You should restart the Web App via the Azure portal after publishing in order to load the new version of your code into the application. Thanks to N1njaB0b for reminding.

Azure - Publishing from VStudio

Using VStudio 2010 wizard to set up basic 'Hello World' asp.net web role, works under emulator but when importing publish file from azure management portal get error
'publishsettings does not contain valid publish settings for Windows Azure'.
Have set up web site, storage and cloud service in Azure latest management portal (preview version) so unclear what problem is.
If you are using Windows Azure Websites (Preview) and using Visual Studio Publish wizard for your application you would need to download the publish file from your website located as shows below:
After that you can just use this .publishsettings file in VS Publish wizard and there not even a single click needed and your website will be published.
Please see my latest blog: Deploying Windows Azure Website using Visual Studio Web Publish wizard
I had the same issue.
Seems like the publishsettings files related to specific sites/services/apps are always rejected.
The solution seems to be to get a publishsettings file for your entire Azure account instead, and after that you're able to access your sites/services/apps or create new ones and publish to them.
This is performed using the following steps:
. Right click the project in VS10 and open 'Publish...' (the Azure
publish settings)
. Go to the Summary tab. Here you are able to download a publish settings file related to your Azure account. This file is named something like 'three month free evaluation period 1-1-2013-credentials.publishsettings' rather than the publish settings file for a particular site, which would be named somethiung like 'mysite.azurewebsites.net.publishsettings'. Import that file - it will work!
3. Now go to the settings tab. Here you can select a cloud service (select existing or you can create a new one) and assign some settings.
. When the configuration is complete and you've clicked the Next button, VS10 will start deploying your project to the selected service. This is displayed in the 'Windows Azure Activity Log' output window in VS10.

Resources