小编Gar*_*SFT的帖子

拉图像Azure容器注册表 - Kubernetes

有没有人有任何建议如何在Azure容器服务(kubernetes)中运行时从Azure容器注册表中提取

我尝试过像下面这样的示例部署,但图像拉动失败了:

kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: jenkins-master
spec:
  replicas: 1
  template:
    metadata:
      name: jenkins-master
      labels:
        name: jenkins-master
    spec:
      containers:
      - name: jenkins-master
        image: myregistry.azurecr.io/infrastructure/jenkins-master:1.0.0
        imagePullPolicy: Always
        readinessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 20
          timeoutSeconds: 5
        ports:
        - name: jenkins-web
          containerPort: 8080
        - name: jenkins-agent
          containerPort: 50000
Run Code Online (Sandbox Code Playgroud)

azure docker kubernetes azure-container-service azure-container-registry

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

如何使用nodejs在azure blob存储上设置contenttype

我有一个nodejs服务器,我正在使用azure-storage模块,我正在尝试将wav文件上传到azure blob存储.

我正在尝试将blob上的contentType设置为'audio/wav',但它在存储中显示为'application/octet-stream'.代码是:

 upload: function (id, buffer, mimeType, callback) {
    self = this;
    var size = buffer.length;
    var stream = streamifier.createReadStream(buffer);
    var options = { contentType: 'audio/wav' };
    self.blobService.createBlockBlobFromStream(self.containerName, id, stream, size, options,  function (error, result, response) {
        if (error) {
            callback(error);
        }
        callback(null);
    });
}
Run Code Online (Sandbox Code Playgroud)

关于我做错了什么的任何想法?

azure azure-storage node.js contenttype

7
推荐指数
2
解决办法
1406
查看次数

如何在JavaScript Azure Functions中共享代码?

如何在Azure功能应用程序中的文件之间共享代码(例如,Mongo架构定义)?

我需要这样做,因为我的函数需要访问共享的mongo架构和模型,例如这个基本示例:

var blogPostSchema = new mongoose.Schema({
  id: 'number',
  title: 'string',
  date: 'date',
  content: 'string'
});

var BlogPost = mongoose.model('BlogPost', blogPostSchema);
Run Code Online (Sandbox Code Playgroud)

我试图在"watchDirectories": [ "Shared" ]我的host.json文件夹中添加一行,添加了一个index.js包含上述变量定义的行,但这似乎不适用于其他函数.

我只是得到一个Exception while executing function: Functions.GetBlogPosts. mscorlib: ReferenceError: BlogPost is not defined.

我也尝试过挖掘require.js文件,但似乎没有找到.可能是我错了路径.

有没有人有关于如何.js在天蓝色功能之间共享代码的示例或提示?

javascript azure mongoose node.js azure-functions

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

如何在Azure AD中使用passport.js和OpenID Connect策略

我希望使用OpenID Connect,Node.js,Passport.js对Azure AD进行身份验证.能否请您指出任何资源/文档和/或示例代码?

我遇到了护照 - openidconnect.这还是活动模块吗?你知道我可以使用的任何其他模块吗?如果是这样,如果你能指出一些很棒的示例代码!

azure node.js azure-active-directory openid-connect passport.js

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

Azure函数:NodeJS - HTTP响应呈现为XML而不是HTTP响应

我有一个用NodeJS编写的Azure函数,我试图使用302进行HTTP重定向.文档在响应中的有效条目上非常稀疏.结果我创建了一个对象,我觉得应该是生成重定向的正确条目,但我得到的只是一个XML响应.甚至像状态代码这样的项目也会显示在XML中,而不是更改实际状态代码.

我究竟做错了什么?

我的代码:

module.exports = function(context, req){
    var url = "https://www.google.com";
    context.res =  {
        status: 302,
        headers: {
            Location: url
        }
    }
    context.done();
}
Run Code Online (Sandbox Code Playgroud)

这是我在浏览器中得到的响应:

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 1164
Content-Type: application/xml; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 18 Jan 2017 00:54:20 GMT
Connection: close

<ArrayOfKeyValueOfstringanyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><KeyValueOfstringanyType><Key>status</Key><Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:int">302</Value></KeyValueOfstringanyType><KeyValueOfstringanyType><Key>headers</Key><Value i:type="ArrayOfKeyValueOfstringanyType"><KeyValueOfstringanyType><Key>Location</Key><Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">https://www.google.com</Value></KeyValueOfstringanyType></Value></KeyValueOfstringanyType></ArrayOfKeyValueOfstringanyType>
Run Code Online (Sandbox Code Playgroud)

xml response azure node.js azure-functions

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

Azure AppendBlob 块/写入数

AppendBlob在 Azure 中使用日志记录。一段时间后,我经历了409 Conflict Error。我的猜测是达到了最大块/写入量 (50.000)。

有没有办法获得 blob 中的块数/写入数?

c# azure azure-storage-blobs

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

成功将base64图像保存到Azure Blob存储,但blob图像始终打破/小白框

我有一个图像转换为base64我试图使用createBlockBlobFromText上传到我的azure blob存储.

self.blobServer.createBlockBlobFromText(containerName, fileName, baseStrChars, { contentSettings: { contentType: 'image/jpeg' } }, function(error, result, response) {
     if (error) {
         console.log(error);
     }
     console.log("result", result);
     console.log("response", response);
});
Run Code Online (Sandbox Code Playgroud)

我的新jpeg图像出现在blob存储容器中,但是当我转到blob图像URL时,我总是得到这个.

我的容器的访问策略设置为容器,我将base64字符串粘贴到base64到图像转换器,并显示正确的图像.问题似乎是我创建blob而不是base64字符串的方式.

我很疑惑为什么整个流程似乎都有效,但是当我转到URL时,图像仍然被破坏了.有任何想法吗 ?

blob azure azure-storage-blobs node.js azure-web-sites

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

Azure 存储服务 REST API 的授权

我第一次调用 Azure 存储 REST API 时,一整天都被困住了。Postman 的回复显示是 Azure 身份验证出错,但我不知道是什么问题。

这是发送 Azure 存储 REST API 的浏览器脚本:

function azureListContainers() {

var key = "key-copied-from-azure-storage-account";
var strTime = (new Date()).toUTCString();
var strToSign = 'GET\n\n\n\nx-ms-date:' + strTime + '\nx-ms-version:2015-12-11\n/myaccount/?comp=list';

var hash = CryptoJS.HmacSHA256(strToSign, key);
var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
var auth = "SharedKeyLite myaccount:"+hashInBase64;

console.log(strToSign);
console.log(auth);
console.log(strTime);

$.ajax({
    type: "GET",
    beforeSend: function (request)
    {
        request.setRequestHeader("Authorization", auth);
        request.setRequestHeader("x-ms-date", strTime);
        request.setRequestHeader("x-ms-version", "2015-12-11");
    },
    url: "https://myaccount.blob.core.windows.net/?comp=list",
    processData: false,
    success: function(msg) {
        console.log(msg);
    }
});
}
Run Code Online (Sandbox Code Playgroud)

Chrome 开发人员工具刚刚返回 No …

javascript azure-storage

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

阻止在Azure中查看网站代码

我刚刚开始使用Azure,我遇到了一个问题.我已经部署了一个Azure网站,它只是HTML,javascript和css文件.如果用户输入了URL地址并附加了文件的目录和特定名称,则他们可以看到内容.例如,他们输入http://mysite.azurewebsites.net/js/utility.js.按下输入后,他们可以看到该文件的所有源代码.我该怎样阻止他们这样做?

javascript security azure web

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