我创建了一个azure函数,该函数连接到exchange服务器,并由blob存储触发器触发。在visual studio中测试这一点,一切都很好;上传blob将触发该函数,并尝试连接。
然而,当我将该函数发布到Azure时,它不再由上传文件时的blob存储触发。
应用程序和函数在azure portal上都是可见的,并且应用程序正在运行。但是调用日志声明该函数从未被调用。由于该函数是在Visual Studio中开发的,因此也将其列为只读函数。
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Exchange.WebServices.Data;
using System;
using Microsoft.WindowsAzure.Storage.Blob;
using System.Security;
using System.Net;
namespace ExchangeSimplifiedTestFunction
{
public static class SimplifiedFunction
{
[FunctionName("SimplifiedFunction")]
public static void Run([BlobTrigger("exchangestorage/{name}", Connection = "StorageConnection")]CloudBlockBlob myBlob, string name, TraceWriter log)
{
log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: Bytes");
log.Info(myBlob.ToString());
ExchangeService service = new ExchangeService();
String customer = myBlob.DownloadText();
string emailAddress = "email@email-test.local";
//yuck yuck yuck yuck yuck
var password = new SecureString(); foreach (char c in "password") password.AppendChar(c);
NetworkCredential userCredentials = new NetworkCredential(emailAddress, password);
service.Credentials = userCredentials;
bool success;
try
{
service.AutodiscoverUrl(emailAddress, RedirectionUrlValidationCallback);
success = true;
}
catch (Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException e)
{
log.Info($"loginFailed - expected during testing");
success = false;
}
if (success) { log.Info($"Successfully connected to exchange server"); }
}
private static bool RedirectionUrlValidationCallback(string redirectionUrl)
{
bool result = false;
Uri redirectionUri = new Uri(redirectionUrl);
if (redirectionUri.Scheme == "https")
{
result = true;
}
return result;
}
}
}
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=exchangclientestorage;AccountKey=[accountKey];EndpointSuffix=core.windows.net",
"AzureWebJobsDashboard": "",
"StorageConnection": "DefaultEndpointsProtocol=https;AccountName=exchangclientestorage;AccountKey=[accountKey];EndpointSuffix=core.windows.net"
}
}
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
[14/11/2017 11:46:05] Reading host configuration file 'C:\Users\davel\source\repos\ExchangeSimplifiedTestFunction\ExchangeSimplifiedTestFunction\bin\Debug\net461\host.json'
[14/11/2017 11:46:05] Host configuration file read:
[14/11/2017 11:46:05] {
}
Listening on http://localhost:7071/
Hit CTRL-C to exit...
[14/11/2017 11:46:05] Generating 1 job function(s)
[14/11/2017 11:46:05] Starting Host (HostId=dlopcdi101-792492740, Version=1.0.11075.0, ProcessId=14848, Debug=False, Attempt=0)
[14/11/2017 11:46:06] Found the following functions:
[14/11/2017 11:46:06] ExchangeSimplifiedTestFunction.SimplifiedFunction.Run
[14/11/2017 11:46:06]
[14/11/2017 11:46:06] Host lock lease acquired by instance ID '000000000000000000000000860DF48B'.
[14/11/2017 11:46:06] Job host started
[14/11/2017 11:46:06] Executing HTTP request: {
[14/11/2017 11:46:06] "requestId": "ae39ae2c-8e64-4b22-bbd9-26215f558b4a",
[14/11/2017 11:46:06] "method": "GET",
[14/11/2017 11:46:06] "uri": "/"
[14/11/2017 11:46:06] }
[14/11/2017 11:46:06] Executed HTTP request: {
[14/11/2017 11:46:06] "requestId": "ae39ae2c-8e64-4b22-bbd9-26215f558b4a",
[14/11/2017 11:46:06] "method": "GET",
[14/11/2017 11:46:06] "uri": "/",
[14/11/2017 11:46:06] "authorizationLevel": "Anonymous"
[14/11/2017 11:46:06] }
[14/11/2017 11:46:06] Response details: {
[14/11/2017 11:46:06] "requestId": "ae39ae2c-8e64-4b22-bbd9-26215f558b4a",
[14/11/2017 11:46:06] "status": "OK"
[14/11/2017 11:46:06] }
[14/11/2017 11:46:06] Function started (Id=85129700-5403-42b3-9368-3f185503e73a)
[14/11/2017 11:46:06] Executing 'SimplifiedFunction' (Reason='New blob detected: exchangestorage/customer3.txt', Id=85129700-5403-42b3-9368-3f185503e73a)
[14/11/2017 11:46:07] C# Blob trigger function Processed blob
Name:customer3.txt
Size: Bytes
[14/11/2017 11:46:07] Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
Debugger listening on [::]:5858
[14/11/2017 11:46:09] loginFailed - expected during testing
[14/11/2017 11:46:09] Function completed (Success, Id=85129700-5403-42b3-9368-3f185503e73a, Duration=3135ms)
[14/11/2017 11:46:09] Executed 'SimplifiedFunction' (Succeeded, Id=85129700-5403-42b3-9368-3f185503e73a)
最后生成function.json
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
"bindings": [
{
"type": "blobTrigger",
"connection": "StorageConnection",
"path": "exchangestorage/{name}",
"name": "myBlob"
}
],
"disabled": false,
"scriptFile": "..\\bin\\ExchangeSimplifiedTestFunction.dll",
"entryPoint": "ExchangeSimplifiedTestFunction.SimplifiedFunction.Run"
}
我创建了Azure blob触发函数,每当在Azure存储中发布任何文件时都会运行。当我从Visual Studio运行Azure函数时,它可以正常工作,但当我停止Visual Studio时它没有触发。从Visual Studio部署它时是否有任何特定设置?请帮助
在Azure中,我开发了一个函数(应用服务),当新的csv文件放入特定存储帐户时会触发该函数。该函数是在Azure中开发的,每次上传新的csv文件时都不会出现问题。但是考虑到CI/CD,我决定将我的开发过程从Azure迁移到Visual Studio(2017)。 代码在本地运行没有任何问题,但一旦我将代码发布到Azure(通过VSTS),挑战就开始了。当新的csv文件上传到存储帐户时,触发器似乎
当我在.NET Core 2.0中使用VS2017创建Azure函数并在本地运行时,我的blob触发器工作正常。但当我发布到Azure时,触发器不会触发,也不会将日志写入Azure门户控制台。 发布后,我转到Azure门户并看到此错误:“未注册绑定类型'bbloTrigger'。 然后我尝试安装Microsoft.Azure.WebJobs.Extensions。但它失败了。(我是通过尝试在门户上
我有两个azure函数的设置: < li >在CosmosDbCollection和lease上触发Nodejs函数,其中lease前缀对此函数唯一。这个很好用。我可以看到它在日志流中触发,我可以看到它正在运行(我可以从函数中看到我自己的日志,我还可以看到它对cosmos项目进行输出更改 < li>Java函数(称为parseProduct)也有一个Cosmos触发器和另一个lease前缀。这个可
我通过Visual Studio发布了一个Azure Function。现在我想删除已发布的Azure函数,并且要删除的按钮已禁用。有没有办法删除从VS发布的azure函数?
我正在使用这段代码,但在iOS10上,它并没有设置动画,只是在增加和减少mySubview1的高度。为什么? 同样的代码在iOS9中工作正常
我在Visual Studio中创建了一个简单的blob触发器,init.py如下 function.json如下 local.settings。json如下所示 此代码在本地计算机上的visual studio中运行良好。但在azure portal上发布时,它无法从函数中读取blob路径。json并给出错误为 我已经使用命令发布了local.settings.json的contains。 .有
我有一个对soap Web服务的请求,该服务在SoapUi中运行良好。我想在python脚本中调用此Web服务。 我尝试了一些模块:zeep,泡沫,...但是我总是有一个SSL错误。 以下是信息: https://37.71XXXXXXACONYX?wsdl 基本认证:用户名密码 身份验证类型:抢占式 我在SoapUi中提供了xml。 有人有什么想法吗? 谢谢!! 我试过: