How to set authLevel for azure functions using the portal - azure

This piece of documentation references configuring an azure function by way of a file on D:\home\data and a local json file.
https://azure.microsoft.com/en-us/documentation/articles/functions-triggers-bindings/#apikeys
First of all, where is the file/source code when the function is created through the portal dashboard UI, and how can I change those settings?
I'm assuming that this is the case when the service is created through the git method, but I don't see how to change the settings or view the keys through the dashboard.

We haven't built portal UI yet for managing these secrets/keys. We'll get to that soon.
So for now, they must be modified manually and that was the intent of that documentation, to show you the underlying details so you could do that if you needed to (until the portal UI is done).
I think the bit the doc left out that you might be missing is that to see the underlying files, you can use the Kudu. You can open up Kudu from the Functions portal by selecting "Function app settings", hitting the "Go to App Service Settings" button, hit the "Tools" toolbar button, and launching Kudu from the UI blade.
After you have opened up Kudu on your Function App, you can open the Debug Console on the root of your Function App, allowing you to navigate to the various files the doc mentions. For example data\functions\secrets or site\wwwroot which is where your function scripts are stored.

Related

developer portal in azure management api is not correctly working

Why it is that when clicking on API, it is displaying the popup as shown in the picture, rather then going to the API page?
I have publish the project and reset content but then also no change?
How can I activate the site?
It seems to me that some setting is still remaining
You open the developer portal as administrator:
Follow the steps below to access the managed version of the portal.
In the Azure portal, navigate to your API Management instance.
Select the Developer portal button in the top navigation bar.
A new browser tab with an administrative version of the portal will open.
In this administrative version of the developer portal, you are able to modify the look & feel,...
If you want to use the developer portal as a usual user, you have to open the developer portal in a browser with private mode or with a different browser and sign in.

Does Application Insights work with Azure functions on Linux .NET Core v3.1?

Does Application Insights work with Azure functions on Linux .NET Core v3.1?
It looks like it does not work out of the box.
I have got no logs, no application map, and the Application Insights bar is grayed out. The APPINSIGHTS_INSTRUMENTATIONKEY is set.
For me it is not an option to switch to Windows, functions are running inside ASE with Linux containers plan.
Is it anyhow possible to activate App Insights for Azure function running on Linux ?
Yes, you can.
Please follow the steps below(if the azure function is already created without configuring application insight):
1.In azure portal -> nav to you function app -> in the Functions menu, click your function. Screenshot is as below:
2.Then click the "setup" next to "Application insights" tag. Screenshot is as below:
3.Then click the "Configure" button. Screenshot is as below:
4.In the new page, you can choose to create a new Application Insights instance or link to an existing Application insights. Screenshot is as below:
At last, run the azure function, then nav to the application insights, you can see the logs are shown there.
And another way is that, when create a new azure function for linux in azure portal, you also have the chance to add application insights at that time.

Deleting Azure Function Published by Visual Studio

I have published an Azure Function through visual studio. Now I want to delete the published Azure function and the button to delete is disabled. Is there a way to delete the azure function published from VS?
After we publish code from VS, Azure portal will set functions to be Read Only to prevent us editing pre-compiled assets in portal.
If we use web deploy(didn't check Run from package file),
Here are two choices:
Delete all functions directly in portal. In portal, stop Function app then Platform features> App Service Editor, delete everything except host.json.
Note: I once provided a plausible solution--Platform features> Function app settings, change Function app edit mode to Read/Write, then we are able to click delete button. In this way we can delete specific functions but actually we didn't delete pre-compiled dlls which may accumulate and cause trouble.
Delete all old functions the next time we publish new ones. On publish panel, click Manage Profile Settings and check Remove additional files at destination.
If we have checked Run from package file when publishing, then none of those means could work. In addition to publish again, we can go to Platform features> Application settings, remove WEBSITE_RUN_FROM_PACKAGE under Application settings section and function app will become empty. Refer to announcement of Run from package for more info.
With this approach, file will also accumulate in silence but it won't cause error to new functions. To remove old files, Platform features> Advanced tools (Kudu)> Debug console(CMD) and navigate to d:\home\data\SitePackages to delete zips not in use.
The simplest way is to delete all functions is to do this:
Change WEBSITE_RUN_FROM_PACKAGE to 0 in the portal for the function application you want to deal with
This will allow you to create a scripted function in the portal for the given application
Create one function and this actions will delete all other functions that came from the package.
It seems this issue has been resolved in Azure.
Remove the unwanted functions from code
STOP your Azure function App in Azure portal
Enable "Remove additional files at destination" option in profile settings popup
Republish the solution again and all the removed functions will be deleted from Azure Portal.

Can you update the web.config file for an Azure web app without redeploying?

I would like to update a database connection string in the web.config file for an application that is currently hosted in Azure as a web app.
Seems that you can RDP into an Azure cloud service role but not a web app. If you can't RDP into an Azure web app, is there another way to update the connection string without redeploying?
You can use the portal, there is a tool called "App Service Editor" in preview that lets you edit any of the files you've deployed. I do wonder why you want to do this though, it's not considered good practice to modify source files on the fly like this! Config and app settings are exposed via the portal as well and can be modified without dropping to the app service editor tool. (under Settings/Application Settings in portal). Updating these does not update the web.config but will override web.config settings.
As Russell Young said, on Azure portal, we could use App Service Editor that provides an in-browser editing experience for our App code. And we could specify connection string in App settings section to override existing settings.
Besides, we could also to access and update Web.config file (under D:\home\site\wwwroot folder) via Kudu Debug console.
The best practise would be to use a FTP client such as File Zilla, where you can grab it, edit, save and push it back to the host without the hassle of logging into a portal and editing it directly on the server or portal.
Please note that editing a file without backing it up first, and editing a file directly on the server can cause many many problems.

Azure: Is there a way to view deployed files in Azure?

Is there a file "view" available in Azure?
When I log in to Azure to look at a website I've deployed there is no obvious see exactly what files Azure is hosting.
I can see there's the Visual Studio Online option which allows you to live edit your server code but that is more than I need. I just want to be able to check that certain files are deployed and others are not.
If you're just trying to look around, and see the various directories and files in your deployment, you can enter the site's "Kudu" dashboard, using the url format http://<yoursitename>.scm.azurewebsites.net
This will give you a web-based dashboard, including a debug console (web-based) where you can explore your various directories (and the directories will show up visually as well).
More info can be found in this post from the Azure Websites team.
In Visual Studio, in the window "Server Explorer" you click and connect on "Azure".
=> App Service
=> Your site name
=> Files
Here you see all your files and you can edit them directly in Visual Studio.
##### UPDATE 19/08/2019 #####
For some time now, it hasn't worked anymore.... :(
Here is another way to do it: By FTP !
From the Azure portal, in the "App Service" section of your website, go to "Deployment Center" > FTP > Dashboard
There is the FTPS Endpoint => ftp://.....ftp.azurewebsites.windows.net/site/wwwroot
And username, password information.
Install FileZilla Client! (https://filezilla-project.org/)
Enter Host with "FTPS Endpoint" the "username" and "password" and then login quickly!
You can use App Service Editor (previously known as Visual Studio Online). It can be found under your webapp -> Development Tools section in the Azure Portal.
I know this is old, but I just found it, and got some useful tips from it. If you are using an App Service, there is now a browser option to do this as well:
https://YourAppService.scm.azurewebsites.net/dev/wwwroot/
You can get there from the Azure portal, then go to your App service, then scroll down to Development Tools, and click on "App Service Editor".
In VS2017/2019, there's Cloud Explorer to view files in Azure, but each time open folder to view files will invoke connection to cloud, so you have to wait, that's a bit slow.
To open Cloud Explore, Right click on project > Publish > Manage in Cloud Explore, or Top Menu > View > Cloud Explorer.
Yes, you have many options to see that
By clicking Console option (run "dir" command, will list down all files)
By hitting App Service Editor(Preview) option,
Adding to the accepted answer,
you can open an ssh session by going to http://<yoursitename>.scm.azurewebsites.net/webssh/host.
For a long time, I've looked for a linux-style terminal to view my deployed files and environment variables. With this you can view the files, check and set environment variables, make db migrations directly, and a lot more. Hope this is useful.
That could be relevant: AppService->Console
You can use Visual Studio Code and the Azure extension
Since you are using Azure Websites, Azure wants to "manage" it for you, and as a result, you cannot connect to the VM itself. If you were using a Cloud Service, you can obtain the RDP information from the Azure Console and just remote into the machine.
For your situation, you can use FTP as an option. Here is blog that describes one approach:
http://blogs.msdn.com/b/avkashchauhan/archive/2012/06/19/windows-azure-website-uploading-downloading-files-over-ftp-and-collecting-diagnostics-logs.aspx
Here is another option using WebMatrix:
http://www.microsoft.com/web/post/how-to-edit-a-site-hosted-on-windows-azure-with-webmatrix

Resources