Default publish vs pick a publish target in Azure - azure

I have two app service application and function apps [different solutions]. Both are developed using .Net core Visual Studio 2019.
I see different type of wizards for publish during publishing app service . This is creating confusion.
I would like to know, why there are different types of Wizards? Why in one solution its showing and other its not?
In general case, I can just click on publish and it will publish. However, in case of "pick a publish target" I need to download the publish profile and do "import profile". Will I need to take any extra care during "import profile" ? What are the difference between two types of publish? Which is the preferable way? Could anyone please help me understand this?
Any link/tutorial that will explain the step by step approach of "Pick a publish Profile" ? Thanks
Below screenshot shows, different wizard:

In the first image, you have already created a publish profile. Hence, it just straight asking you to publish.
In the second case, you don't have a publish profile yet so it is asking you to Import or create a publish profile. You can also create a publish profile by selecting App Service instead of IIS, FTP etc and then once the profile is created it will work like in your first case. And off course, import a profile which again should only happen once and thereafter it should automatically use that profile.

Related

What is the best way to move an online Azure Function to a local git repository?

I have written an Azure Function App by using the User Interface of Azure Portal. The code is written in C#.
Now, I want to:
download all of the relevant code and configuration files of this
function app
Create an IDE project (e.g. IntelliJ, Visual Studio Code, ...)
store it in a git repository
Deploy the code from IDE or command line to Azure and thereby replacing the previously written Azure function.
So far, I have found only documentation on how to initiate Azure function projects with no previous code. Does somebody know how to do above?
Yes, you could go to your function Overview page, click on Download app content as shown below.
And in your situation, you want configuration files, so select the Content and Visual Studio Project and Include app settings in the download. What is app settings? This will include a local.settings.json file which contains your application settings.
Also the third party .dlls are included.
In the VS, select the folder and it will be working.
Update:
Open the function with vs, then just right click the function and choose Publish, it will show you the publish page. Click start, then you will be able to publish it to a existing Function.
Follow this Setting up a CI/CD pipeline for Azure Functions doc which explain each step in detail.

Where can i find the code of an Azure Function?

I'm new to Azure Functions and been thrown into a project without a proper introduction and anybody I could ask is out of office. My simple most likely stupid question is; where can I find the actual code?
In the azure portal, the functions are listed as "read-only" and only contains a function.json. The resource is an App Service and it has a couple of functions. There is no link to any git repository in properties.
Read-only Functions would be compiled and published (e.g. through Visual Studio or a CI/CD pipeline.) The Azure Functions Portal engineers are working on a new, improved experience for this but for now, if your Function app has a deployment source configured, you can view it from the Portal in two ways from your Function app:
Platform Features > Deployment Options.
Platform Features > Resource Explorer. In the file tree on the lefthand side, find your Function app's name, and under that, sourcecontrols. Click to expand in the righthand window.
If your Function app doesn't have a deployment source configured (e.g. your team has been publishing code manually) then things get harder. Depending on how your company has set up their source control and what you already have access to, the function.json you see might help: the entryPoint property in a build-generated function.json will give you the full assembly name of that function (e.g. VSSample.HelloSequence.Run). That or the assembly name of the uploaded DLL in the scriptfile property might help you locate the project.
Good luck! Keep posting if you have further questions; we're here to help.
AFAIK, if we create the azure function in the Visual Studio and publish it to Azure(there may be other ways), it will appear in the situation you described like the screenshot.
Actually, the code is existing in the portal, but the code has been compiled, you could access it in the Platform features -> Advanced tools (Kudu) -> Debug console.
If you want to get the .cs file, I think you should ask it for your coworkers, there will not be in azure.
You said that the Azure function is listed as "read-only". Did you check from the Application Settings menu if you can change the Azure function app edit mode to Read/Write?

Waiting for bot to be ready after deployment

Situation 1
I wrote my own bot framework and deploy to Azure,
the Test in Web Chat shown me "Waiting for bot to be ready after deployment".
Situation 2
I downloaded the source code from Azure bot Services,after that I deploy back to Azure, the Web Chat shown me "Waiting for bot to be ready after deployment".
I also faced this issue and this is how I solved it.
Changed my publish settings to have Remove additional files at destination checked. This is an important step because when you provisioned a new web app bot, it will already have some files in the location. So when you publish your code, it will be placed along with the code files which already exists. You can also test it by navigating to the /api/messages url. If this gives you error, then this is most likely the case.
I also updated all the NuGet dependencies.
The other thing that caused me a bit of issue was the App Password. The app password in your web.config should match the one which is already generated for your BOT. Do not create a new password from the bot management page. If you did that then make sure that you change/update the password in web app bot application settings and also in the web.config file. When you host the bot, by default it will use the Application Id and Application Password which were generated automatically. You can see these values in the Web App Bot service type which is under the section App Service Settings>Application Settings. Scroll down to the bottom and you will see these two settings. Copy the values of Application Id and Application Password and update them in the Web.config file.
Hope this help!
What fixed it for me was changing Destination URL in Publish Settings to https. For some reason default is http.
I had missing node packages that I wasn't aware of. I found the errors in the output logs at https://[bot-name-here].scm.azurewebsites.net/dev/wwwroot/:vs.output
Or you can Navigate to this by going to Build -> Click 'Show output' (or Shift+Command+U) (its the 5th icon in the left hand side menu on the Build window)
Hope that helps!
Some ideas to troubleshoot for people having the same error:
Check that the server hosting your bot is actually running. If https://YOUR_BOT.azurewebsites.net is timing out, then your server is not running, check your config
Check if you have logs in the App Service: Enable everything under App Service > Diagnostic logs, then go to App Service > Log Stream.
Check potential errors under Web App Bot > Channels > Web Chat > Issues
Check that the files on the server look ok by going to App Service > App Service Editor (Preview)
Close all your browsers, especially if they have been running for a long time and/or you have been changing a lot of config/files recently
I fixed the issue by using a combination of those points
I had the window open for a few days, and "Test in Web Chat" would just show "Waiting for bot to be ready" and the juggling progress indicator, forever. I duplicated the tab and it came right up. I think my session may have expired or something, because any new, duplicated tab, I could bring the bot up in just fine.
I solved the problem by, in Visual Studio's Solution Explorer, setting the .bot file's property "Copy to Output Directory" to "Copy always"."
The details: The bot worked fine locally in the emulator. After deploying to Azure (continuous deployment), "Test in Web Chat" hung with "Waiting for bot to be ready". (Would be nice if it detected and reported errors.)
After setting up Azure storage, turning on Azure logging, discovering the FileNotFoundException, inspecting with Resource Explorer, and deploying multiple bot versions, I isolated the cause. This document really helped me troubleshoot:
https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-dotnet-visual-studio#a-nameapptracelogsacreate-and-view-application-trace-logs
I also experienced this problem but the solution I have is totally different from the suggestions above.
I created my Knowledge Base and Web App Bot purely using the portal. The problem lies with the configuration. As of writing, the Bot Template: Node.js > Question and Answer does not work. I needed to create a new Web App Bot and I selected instead C# > Question and Answer.
That fixed my problem and allowed me to use the Test in Web Chat feature.

Package Microsoft.ApplicationInsights.Web not compatible with netcoreapp

Full problem text:
Package Microsoft.ApplicationInsights.Web 2.4.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1)
Package Microsoft.ApplicationInsights.Web 2.4.0 supports:
- net40 (.NETFramework,Version=v4.0)
- net45 (.NETFramework,Version=v4.5)
So when I try to access Live Metrics Stream in Azure I get the message:
Not available: your app is offline or using an older SDK
and the following step-by-step guide to getting it:
Make a copy of ApplicationInsights.config if you customized ApplicationInsights.config.
In Solution Explorer, right-click your project and choose Manage NuGet packages.
Select Browse.
Search for Microsoft.ApplicationInsights.Web, select it and choose Install/Update. You need version 2.2.0 (or later).
Reinstate any customizations you made to ApplicationInsights.config. Most of the changes you'll see when you compare the files are because we removed some modules and made others parameterizable.
Rebuild your solution.
(I haven't customized no ApplicationInsights.config so started at 2, got the error after 4)
So I'm not entirely sure what the problem here is, on thing I guess from the problem text is that ApplicationInsights.Web works with .NETFramework and not with .NETCoreApp. In that case my question would be:
What's the ApplicationInsights.Web alternative for .NETCoreApp? Plus, why does Azure recommend this step-by-step guide to me? Can't they see that I'm running a .NETCoreApp?
In case it's relevant:
I have student access to Visual Studio and Azure through something called Microsoft Imagine.
The guide is for classic MVC, not MVC Core.
For ASP.NET Core, you should be able to add App Insights with the connected service in Visual Studio: https://ppolyzos.com/2017/03/07/add-application-insights-in-a-net-core-app-using-vs-2017-and-connected-services/
To add one of the supported connected services you can right-click on
your Project and select Add Connected Service. Select Application
Insights and, from the next dialog, click on the Start Free button to
start the registration of Application Insights in your app.
Then, connect your Microsoft Azure account, choose your subscription
and resource group and, at the bottom, select whether you want app
insights to continue collecting data beyond 1 GB/month or not, and
click on Register. A popup will appear displaying the progress of App
Insights registration process.
Also, the package that the connected service installs is: https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore/

How to deploy Azure service fabric project on to a remote cluster(Azure)

I have Created a cluster in Azure http://******.######.cloudapp.azure.com:19080
but don't know how to deploy my service fabric project on to it.
Link to application manifest
ApplicationManifest.xml
It's pretty well documented, unless you are getting specific errors, which you then will need to reference to get some worthwhile help
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-publish-app-remote-cluster
Your first option is to use the powershell commands. You can also right-click your application in visual studio and select "Publish". Make sure you are using the correct publish profile.
Within Visual Studio, navigate to your Publish Profiles folder under the application and copy/paste the existing cloud.xml file and then rename appropriately. Ensure that you use the correct public facing I.P for your cluster, which will most likely be the load balancer.
The line should look like the following.
<ClusterConnectionParameters ConnectionEndpoint="<YOUR IP>:19000" />
Example:
<ClusterConnectionParameters ConnectionEndpoint="151.41.35.35:19000" />
However, if the cluster is secured you may need additional information. These options are shown within the commented Cluster Connection Parameters of the cloud.xml file.
Right click on the application, select publish and ensure the new publish profile is selected. Visual studio will attempt to validate the connection. Try to publish and keep an eye on the output window for insight in to the process.

Resources