尝试在本地调试Azure功能.NET STANDARD 2.0.使用Visual Studio 2017 CE.昨天工作的东西想知道出了什么问题.卸载所有NET CORE SDK并放回2.1.201.找到关于Core 1.1的其他解决方案,但没有运气.调试时,控制台立即关闭,只留下此错误消息
The program '[1684] dotnet.exe' has exited with code -2147450750 (0x80008082).
Run Code Online (Sandbox Code Playgroud) 我无法发布(WebDeploy)我的Azure Function应用程序(这是一个耐用的功能,我知道这无关紧要,但是以防万一)。今天开始发生这种情况。
我的Visual Studio的输出窗口中出现“发布失败”弹出窗口和以下错误消息。
错误信息
<ProjectName> -> C:\search\source\<Solution Folder>\obj\Release\netstandard2.0\PubTmp\Out\
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Web deployment task failed. (Could not connect to the remote computer ("<functionappname>.scm.azurewebsites.net"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.) [<projectname>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : The requested resource does not exist, or the requested URL is incorrect. [<projectname>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Error details: [<projectname>.csproj]
C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Could …
Run Code Online (Sandbox Code Playgroud) 我使用静态网站功能在 Azure 存储中托管了一个简单的网站。该网站的网址现已公开。(任何拥有 url 的人都可以访问该网站)。但我的目的是只为我想要的用户提供访问权限。有没有办法限制对 Azure 存储中托管的静态网站的公共访问?
我通过visual studio发布了Azure Function.现在,我想删除已发布的Azure功能,并禁用要删除的按钮.有没有办法删除从VS发布的azure函数?
当我的 Azure 函数被触发时,它会记录“Executing”和“Executed”消息。这在测试期间很好,但由于此函数被多次触发,它会创建大量不需要的日志消息。我自己添加的日志对我很重要,但我想禁用函数自己的“正在执行”和“已执行”消息。澄清一下,我不想记录以下消息:
Executing ‘MyFunctionName’ (Reason='New ServiceBus message detected……etc’)
Executed ‘MyFunctionName’ (Succeeded, Id=a99c6932-788f-439e-a7db-aad7f607d5ea)
Run Code Online (Sandbox Code Playgroud) Azure 函数的 local.settings.json 文件是在将 IsEncrypted 属性设置为 false 的情况下创建的。
{
"IsEncrypted":false,
"Values" : {
}
}
Run Code Online (Sandbox Code Playgroud)
这个设置是什么意思,它是如何使用的?
将使用设置文件的应用程序移植到Azure函数时,是否有必要消除对文件的依赖?
我想编写一个功能应用程序,以将数据从Xero导入到Azure sql数据库中。我正在使用的Xero SDK需要一个appsettings.json文件。
因此,当函数运行时,我得到了错误
System.Private.CoreLib: Exception while executing function:
FunctionXeroSync. Xero.Api: The type initializer for
'Xero.Api.Infrastructure.Applications.Private.Core' threw an exception.
Microsoft.Extensions.Configuration.FileExtensions: The configuration file
'appsettings.json' was not found and is not optional. The physical path is
'C:\Users\kirst\AppData\Local\AzureFunctionsTools\Releases\2.6.0\cli\appsettings.json'.
Run Code Online (Sandbox Code Playgroud)
我尝试通过VS2017 Project Publish选项卡上的Manage Application Settings链接将相关设置放入。显然,这失败了。我还有其他方法可以使用吗?
这是api中的相关代码。我希望不必修改它,以便可以使用官方的nuget包。
namespace Xero.Api
{
public class XeroApiSettings : IXeroApiSettings
{
public IConfigurationSection ApiSettings { get; set; }
public XeroApiSettings(string settingspath)
{
var builder = new ConfigurationBuilder()
.AddJsonFile(settingspath)
.Build();
ApiSettings = builder.GetSection("XeroApi");
}
public XeroApiSettings() : this("appsettings.json")
{
} …
Run Code Online (Sandbox Code Playgroud) 根据Azure文档,Functions V2使用.NET Core日志记录筛选器层次结构进行配置。
在下面的示例中,将ILogger的实例注入到该函数的Run方法中。
[FunctionName("MyFunction")]
public static void Run([TimerTrigger("0 */1 * * * *")]TimerInfo myTimer, ILogger logger, ExecutionContext executionContext)
{
logger.LogInformation("I don't want to see this in production!"));
}
Run Code Online (Sandbox Code Playgroud)
检查ILogger对象时,每个LoggerInformation元素的MinLevel为null,这似乎记录了所有级别。
在生产中,我只想以错误级别登录。我希望能够使用环境变量进行配置,但是找不到任何说明如何实现此目的的文档。我尝试添加以下环境变量无效:
"logging__logLevel__Default: "Error"
Run Code Online (Sandbox Code Playgroud)