azure-functions

Working with Python Files in Azure Function - Read Only File System

心不动则不痛 提交于 2021-01-28 14:50:32
问题 New to Azure functions, but looking to utilize a Function in an ADF pipeline to call out to a third party and write the json back for ingestion. However, I receive Result: Failure Exception: OSError: [Errno 30] Read-only file system: ... "/home/site/wwwroot/AzureFunctionFileTest/ init .py", line 10, in main with open('test.json', 'w') as file. My script is below: logging.info('Python HTTP trigger function processed a request.') logging.info('opening file') with open('test.json', 'rb') as file

Working with Python Files in Azure Function - Read Only File System

别说谁变了你拦得住时间么 提交于 2021-01-28 14:49:50
问题 New to Azure functions, but looking to utilize a Function in an ADF pipeline to call out to a third party and write the json back for ingestion. However, I receive Result: Failure Exception: OSError: [Errno 30] Read-only file system: ... "/home/site/wwwroot/AzureFunctionFileTest/ init .py", line 10, in main with open('test.json', 'w') as file. My script is below: logging.info('Python HTTP trigger function processed a request.') logging.info('opening file') with open('test.json', 'rb') as file

How can I retrieve through an API *Live Metrics* of Microsoft Application Insights

夙愿已清 提交于 2021-01-28 08:21:07
问题 I monitor the execution of an Azure function using the Live Metrics Stream management UI as seen below: Some of these metrics can be retrieved through the Application Insights REST API. However, metrics concerning overall health data, or Servers data, return a null value. For example,the performanceCounters/processCpuPercentage endpoint produces the following output when probed: HTTP/1.1 200 content-type: application/json; charset=utf-8 { "value": { "start": "2018-10-16T11:20:37.366Z", "end":

How to upload a large string in an Azure Blob?

梦想的初衷 提交于 2021-01-28 08:16:37
问题 Right now I'm trying to figure out how to work with Azure, and now I'm stuck in a problem while storing my data in the storage account. I have three strings and want to store each of them in a separate blob. With the first two, my code works fine, but the third one causes some retries and ends with a timeout. My code is running within an Azure function. Here is a minimal example: from azure.storage.blob import BlobClient blob_client = BlobClient.from_connection_string( conn_str. = '<STORAGE

Retreive the host key from within my azure function

醉酒当歌 提交于 2021-01-28 07:02:09
问题 To read an Application setting in Azure function I can do Environment.GetEnvironmentVariable("MyVariable", EnvironmentVariableTarget.Process); Is it possible to get a Host key in a similar way? I like to identify the caller of my azure function based on the key they are using but hate to have a copy of this key in Application settings 回答1: You could install Microsoft.Azure.Management.ResourceManager.Fluent and Microsoft.Azure.Management.Fluent to do that easily. The following is the demo that

Azure Functions (Durable) - Type is an interface or abstract class and cannot be instantiated

你。 提交于 2021-01-28 05:39:28
问题 Problem I have a C# Durable Azure Functions app (v2) containing an orchestration and activity function. The orchestration calls the activity as follows: propBag.CE = await context.CallActivityAsync<CEData>(nameof(GetCEByExternalIdActivity), propBag); The call works ok and the Activity function executes, builds up the content for propBag.CE and returns. The CE object contains a few other objects, including: public List<IParty> Individuals { get; set; } public List<IParty> Organisations { get;

Function with return type of 'string' returns a nullable string (ie 'string?')

与世无争的帅哥 提交于 2021-01-28 05:20:31
问题 For an Azure Functions project I am using C# 8 with enabled nullable reference types. Since with AzureFunctions AppSettings are exposed via environment variables, which can be a string or null (i.e. they return string? ) I tried to encapsulate the logic of getting environment variables - and throwing an error if they're not set - into a separate method GetEnvVariable . As you can see, GetEnvVariable is implemented in three short lines. If the environment variable is not set (i.e it is null )

How to debug EventHubTrigger locally?

喜夏-厌秋 提交于 2021-01-28 04:06:06
问题 I'm trying to debug an Azure Function locally. It's an EventHubTrigger. The problem is that I need to debug the code locally because I still don't have the "real" settings. My code currently looks like this: public static class Notificator { [FunctionName("Notificator")] public static async Task Run([EventHubTrigger("achievements")]UserAchivementNofication notification, ILogger log) { } } But when I try to debug it, I'm getting this error: Microsoft.Azure.WebJobs.Host: Error indexing method

Azure Function: Old code still running after a deployment

為{幸葍}努か 提交于 2021-01-28 03:09:14
问题 Right now I again faced the issue that old code is used on an Azure Function App even after the zip deployment through KUDU returns success. Of course, that is after some 30 mins that I expect the new code to get loaded, not immediately. The issue is marked as closed. What is considered to be the best practice in this case: Programmatically force the Function App to restart, say, through Azure CLI or Powershell Az modules? Or there is another way to mitigate the issue? 回答1: While restarting

Process Azure Datalake store file using Azure function

前提是你 提交于 2021-01-28 01:40:22
问题 I am getting files in a particular folder on my Azure Datalake store at regular interval. As soon as file come, I want to process it further using an Azure function. Is that possible? 回答1: UPDATE: With Multi-Protocol Access for Azure Data Lake Storage, the storage extension should indeed work and some basic tests do confirm that. There are open issues [1, 2] for official confirmation of support. Though Azure Data Lake Storage (ADLS) Gen2 is built upon Azure Blob Storage, there are a couple of