小编Jer*_*Liu的帖子

在严格模式下使用 const :Azure Web App

Application has thrown an uncaught exception and is terminated: SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:434:25)
    at Object..js (module.js:464:10)
    at Module.load (module.js:353:31)
    at Function._load (module.js:311:12)
    at Module.require (module.js:359:17)
    at require (module.js:375:17)
    at Object.<anonymous> (D:\home\site\wwwroot\node_modules\mongoose\index.js:7:18)
    at Module._compile (module.js:446:26)
    at Object..js (module.js:464:10)
    at Module.load (module.js:353:31)
Run Code Online (Sandbox Code Playgroud)

每次创建 Azure Web App 项目并发布 Express App 时都会引发错误。我尝试使用 Azure Express 以及 Blank nodeJs App 来做到这一点

azure node.js azure-web-app-service

2
推荐指数
1
解决办法
1446
查看次数

如何使用输出参数实现 azure 异步函数

我实现了 Azure 功能。

我有下一个案例:

  1. 当某些内容上传到 blob 时(输入 Blob 是触发器)
  2. 流程逻辑
  3. 将某些内容保存到输出 blob(输出为返回值)
  4. 将其他内容保存到 dynamo db 集合(输出参数)
  5. 将其他内容保存到另一个 dynamo db 集合(输出参数)

    [FunctionName("myFunction")]
    [return: Blob("images-text-out/{name}.txt")]
    public static string Run([BlobTrigger("samples-workitems/{name}", Connection = "StorageConnection")]Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob myBlob,
         string name,
         string blobTrigger,
         [CosmosDB(
            databaseName: "my-db-cosmos",
            collectionName: "CollectionA",
            ConnectionStringSetting = "CosmosDBConnection")] out dynamic processedFirst,
         [CosmosDB(
            databaseName: "my-db-cosmos",
            collectionName: "CollectionB",
            ConnectionStringSetting = "CosmosDBConnection")] out dynamic processedSecond,
         ILogger log,
         ExecutionContext context)
    {
        // . . .
        myBlob.DownloadToStreamAsync(memoryStream).Wait();
        // . . .
    }
    
    Run Code Online (Sandbox Code Playgroud)

这工作正常。问题只是我无法利用异步调用的优势。原因很清楚,因为带有输出参数的方法不能是异步方法。

如何利用异步调用的优势实现具有多个输出的 azure 功能?

谢谢

c# azure azure-blob-storage azure-functions azure-cosmosdb

2
推荐指数
1
解决办法
405
查看次数

访问 Azure 网站上的 nodejs https 应用

我在 Azure 上部署了我的 nodejs https 服务器

https.createServer(options, app).listen(8080, ()=>{console.log("listening on 8080")});

从上面的代码片段可以看出,它正在侦听端口 8080

我应该如何访问 Azure 网站上的服务器?

https://myapp.azurewebsites.net/https://myapp.azurewebsites.net:8080/

https azure node.js azure-web-app-service

1
推荐指数
1
解决办法
1545
查看次数

具有angular 5应用程序的Azure部署选项无法编译并构建为持续集成

我正在使用Angular 5,bit-bucket,azure app服务,我已经设置了与bit-bucket和Azure部署选项的持续集成.

请找到以下详细信息

在此输入图像描述 在此输入图像描述

在此输入图像描述 在此输入图像描述

项目结构

在此输入图像描述

我的package.json

{
  "name": "vaquarkhana-poc-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build –prod ",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "npm run build"
  },
  "engines": {
    "node": ">=10.0.0",
    "npm": ">=6.0.0"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.10",
    "@angular/cdk": "^5.2.5",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/flex-layout": "^5.0.0-beta.14",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^5.2.5",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "rxjs": "^5.5.6", …
Run Code Online (Sandbox Code Playgroud)

azure node.js azure-web-sites angular5

1
推荐指数
1
解决办法
1072
查看次数

Azure Functions PowerShell API的OpenAPI规范配置

怎么能一个配置,直通Visual Studio代码,一个PowerShell API在Azure中运行的功能,使其可以食用从Azure的API管理提供的OpenAPI,规范API类似这样的URL如提到的,教程

目前,如果我尝试在Azure API管理中将以下PowerShell API添加为OpenAPI规范API,则会出错

Unable to parse specified file. Please ensure it is valid OpenAPI specification document.
Run Code Online (Sandbox Code Playgroud)

Azure函数PowerShell API URL:https: //vscpsapi.azurewebsites.net/api/VSCPSapi

azure azure-api-management swagger-2.0 azure-functions

1
推荐指数
1
解决办法
602
查看次数

从azure存储表中检索1000多条记录-js

我有检索一千多条记录的问题。不知何故,只检索了前 1000 个。从我的研究中,我发现我必须使用 getContinuation Token 来获取后续记录。请告知我应该如何将它添加到我的代码中。

tableService.queryEntities(table, tableQuery, null, function(error, results) {
    if (error) {
        alert('List table entities error, please open browser console to view detailed error');
        console.log(error);
    } else {
        //display records

});
Run Code Online (Sandbox Code Playgroud)

azure azure-storage node.js azure-table-storage

1
推荐指数
1
解决办法
1301
查看次数

在Java中生成SAS令牌以下载Azure数据存储容器中的文件

尝试生成SAS令牌以访问存储帐户中的某些文件。我正在使用这里列出的方法:

https://docs.microsoft.com/zh-cn/rest/api/eventhub/generate-sas-token

现在,我的问题是,在我的一生中,我无法使sasToken字符串正常工作。如果我通过门户网站(存储帐户中的共享访问签名)生成令牌,则可以通过带有提供的令牌的URL访问这些文件。

但是,我还不能使用上面链接的方法通过Java以编程方式生成SAS令牌。我认为我的问题是正在加密的StringToSign。在构造要加密的字符串时,我一直遵循以下示例:

https://docs.microsoft.com/zh-cn/rest/api/storageservices/constructing-an-account-sas

我所有的努力导致了以下结果之一:

<AuthenticationErrorDetail>Signature fields not well formed.</AuthenticationErrorDetail>
Run Code Online (Sandbox Code Playgroud)

要么

<AuthenticationErrorDetail>Signature did not match. String to sign used was <insert string details here>
Run Code Online (Sandbox Code Playgroud)

查看门户生成的对我有用的sasToken:

?sv = 2017-11-09&ss = f&srt = o&sp = r&se = 2018-12-06T22:15:20Z&st = 2018-12-06T14:15:20Z&spr = https&sig =%2Bi1TWv5D80U%2BoaIeoBh1wjaO1p4xVFx4nRZtY%2Fzwis

看来我需要这样的字符串:

            String stringToSign = accountName + "\n" +
                "r\n" +
                "f\n" +
                "o\n" +
                URLEncoder.encode(start, "UTF-8") + "\n" +
                URLEncoder.encode(expiry, "UTF-8") + "\n" +
                "\n" +
                "https\n" +
                azureApiVersion;
Run Code Online (Sandbox Code Playgroud)

其中accountName是来自Azure的存储帐户名,而start / expiry是开始和到期字符串(即-2018-12-06T22:15:20Z),而azureApiVersion是“ 2017-11-09”。

然后,我尝试在像这样构造字符串之后返回令牌:

        String signature = getHMAC256(key, …
Run Code Online (Sandbox Code Playgroud)

java rest azure azure-storage

1
推荐指数
1
解决办法
1388
查看次数

消费计划的 Azure 函数超时

我通过在 host.json 文件中指定以下内容,在 http 触发器 azure 函数 (v1) 上指定了超时

{
  "functionTimeout": "00:10:00"
}
Run Code Online (Sandbox Code Playgroud)

我已使用 VS2017 部署到 Azure,并且可以确认此设置现在显示在 Azure 门户中。为了确定起见,我还重新启动了函数应用程序。

当我执行函数时,即使超时已设置为 10 分钟,它总是会在 4 分钟左右超时

我已经排除了其他来源发生的超时,因为当我在本地测试 Azure 函数时,它不会超时。

谁能解释为什么会发生这种情况?

azure azure-functions

1
推荐指数
1
解决办法
2741
查看次数

是否可以使用 Azure Functions V2 输出 Message/BrokeredMessage?

文档中不清楚如何输出结构化消息。在我使用过的旧函数中BrokeredMessage,文档说要Message用于 V2 函数,但是没有关于如何使用它的指导。这样对吗:

[FunctionName(nameof(Job))]
public static async Task<IActionResult> Job(
    // ...
    IAsyncCollector<Microsoft.Azure.ServiceBus.Message> serializedJobCollector
)
Run Code Online (Sandbox Code Playgroud)

目标是能够设置一些元数据属性,如 ID,我之前(使用 V1 和BrokeredMessage)做过重复检测,但我不确定这是否正确,或者我需要序列化为字符串或什么...

c# azure azureservicebus azure-functions

1
推荐指数
1
解决办法
511
查看次数