Tag: azure

从Azure Passport身份validation节点js注销

我有一个节点js应用程序,我们使用了azurelogin和通行证身份validation。 我已经成功login使用azure色和应用程序工作正常。 但是,当我注销并将url提供给页面时,它会检查身份validation并自动转到该页面而不要求login。 一旦我login我的url包含以下查询string1. session_state 2.代码3.状态4.令牌 login代码: app.get('/login', passport.authenticate('azuread-openidconnect', { failureRedirect: '/' }), function (req, res) { res.sendFile(path.join(__dirname+'/index.html')); }); 注销码: app.get('/logout', function (req, res) { req.session.destroy(); req.logout(); res.redirect('/'); }); 当我注销页面redirect到我的索引页面。 然后,当我给'/login'的url,它把我带到页面,而无需login页面 请帮忙摆脱这个…

azure node.js console.log不能login到stdout或stderr文件

我有一个azure(应用程序服务)node.js应用程序。 node.js使用以下模块 "scripts": { "start": "node bin\/www", "test": "mocha" }, "dependencies": { "async": "^1.5.2", "bluebird": "^3.3.4", "express": "^4.13.3", "ioredis": "^1.15.1", "lodash": "^4.6.1", "socket.io": "^1.4.5" }, "devDependencies": { "chai": "^3.5.0", "socket.io-client": "^1.4.5" } 我想启用应用程序的日志logging,所以我设置环境variablesDEBUG = *使用入口 – >configuration – >应用程序设置。 从那时起,应用程序的快速和lockinglogging开始出现在/ LogFiles / Application文件夹中,其名称为xxxxxx-nnnn-stderr-nnnnnnnnnnnnnn.txt 我在我的应用程序的lib文件夹中的一个文件中添加了一个console.log语句 function MessageActions(redis, io) { … } MessageActions.prototype.routeMessage = function(message) { console.log('routeMessage: […]

无法启动在Azure中托pipe的nodejs web api

学习nodejs并开始使用restify创build我自己的restful API。 我创build了一个非常简单的server.js文件,其中包含一个基本上是hello worldtypes的例子,启动如下: server.post('/api/messages', servicemanager.verifyFramework(), servicemanager.listen()); server.get(/.*/, restify.serveStatic({ 'directory': '.', 'default': 'index.html' })); server.listen(process.env.port || 3978, function () { console.log('%s listening to %s', server.name, server.url); }); 在当地工作正常。 我不能打http:// localhost:3978 ,我可以testing我的API调用只需调用http:// localhost:3978 / api / messages 。 我已将代码部署到bitbucket中,现在我想使用App Services在Azure中托pipe这些API。 我的项目结构是这样的: /topfolder -/myproject -/node_modules -/node_modules… server.js package.json index.html 当我在Azure中设置新的应用程序服务时,我可以看到部署从BB接收代码,但该服务从不响应我的请求。 我已经设置了应用程序的主path: /site/wwwroot/topfolder/myproject ,当我导航到http://myproject.azurewebsites.net时,我可以看到index.html ,所以这很好。 我实际上得到一个404错误: The resource […]

对MS Graph API的请求使我“授权请求被拒绝 – 没有足够的权限来完成操作”

我有一个关于“授权请求被拒绝 – 没有足够的权限来完成操作”的消息,我不断从我的请求回到WindowsgraphicsAPI。 具体来说,我正在使用Azure云。 我有一个调用API的iOS移动应用程序。 我在我的Portal中打开了“Active Directory的身份validation”。 然后,在客户端(iOS)上: [self.todoService.client loginWithProvider:@"windowsazureactivedirectory" controller:self animated:YES completion:^(MSUser *user, NSError *error) { if(!error && user) { [self refresh]; } }]; //loginWithProvider 所以返回一个有效的MSUser对象。 我看到networkinglogin控制器出现,我用我的un / pwlogin,然后让我访问我的Easy Table的数据…等等。 现在,我想调用我在Azure中创build的一个名为getUserData的Easy API。 因此,我只需像这样插入invokeAPI代码(iOS): [self.todoService.client loginWithProvider:@"windowsazureactivedirectory" controller:self animated:YES completion:^(MSUser *user, NSError *error) { if(!error && user) { //NSMutableDictionary * dict = [NSMutableDictionary dictionary]; //[dict setObject:@YES […]

Azure WebJob访问被拒绝

所以我有一个问题创build一个服务localy,为我的应用程序作为一个WebJob。 好像我读了所有的谷歌,但我找不到解决scheme。 这个在这里不算我的,因为它是关于authentication的。 所以,我有一个C#控制台应用程序在我的电脑上有许多参考,ddls和大量的计算运行像一个服务。 主要function,如下所示: static void Main(string[] args) { string baseAddress = "http://127.0.0.1:80"; Console.WriteLine(baseAddress); if (args.Count() > 0 && !string.IsNullOrEmpty(args[0])) baseAddress = args[0]; SelfHostServer server = new SelfHostServer(); //using Microsoft.Owin; server.Start(baseAddress); } 然后,我在Azure AppService上发布了一个nodeJs应用程序。 基本上,我需要它来调用C#服务,并得到一个响应结果。 出于这个原因,我试图用我的C#应用​​程序创build一个WebJob。 我发布它,并尝试运行它,但我得到(这个错误是flom天青门户控制台): Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Net.HttpListenerException: Access is […]

如何使用绑定更新Azure函数中的Azure表格行?

我正在使用节点和Azure函数来使用在functions.json中定义的绑定来更新我的azure色表。 我能够使用绑定插入行,但无法find任何文档如何更新它们。 Functions.json { "tableName": "myTable", "connection": "myTableConnectionString", "name": "tableBinding", "type": "table", "direction": "out" } 函数定义 Promise.map(loaders.map(e => e.getData()), (data) => { context.log("pushing to azure table"); context.bindings.tableBinding.push({ PartitionKey: data.key, RowKey: data.key, Value: data.Value }); }) .then(() => { context.log("Completed all data retrieveal tasks"); context.log('JavaScript timer trigger function ran!', timeStamp); context.done(); }); 再次调用上面的函数不起作用。 我明白,我可以使用SDK来手动更新表,但我想使用绑定,并保持尽可能简单的function。

无法使用繁琐的Azure数据库

我有一个连接到SQL Server的节点应用程序。 另外,我使用数据库作为Azure的服务。 代码片段: import { Connection } from 'tedious'; import { Request } from 'tedious'; var config = { userName: 'dbuser', password: 'dbpassword', server: 'mydatabase.database.windows.net', options: { instanceName: 'SQLEXPRESS', // Removed this line while deploying it on server as it has no instance. database: 'dbname' } }; connection = new Connection(config); connection.on('connect', function(err) { […]

404azure色的网站上的错误

我们已经在“F1免费”层中设置了一个基于AppService的Azure网站(使用Node.js)。 当我们浏览网站中的JSON文件时,经常遇到404找不到的错误。 但是,当我们在浏览器中刷新时,就会加载。 为什么会发生这种情况,如何解决这个问题? 这是我们应该意识到的一个更大问题的症状吗?

微软Bot框架,它可以开始对话

我正在Azure中使用微软Bot框架,并有一个工作的机器人。 但是,到现在为止,它处于空白状态,只是作出反应。 我想用类似的方式添加/开始对话:“嗨,我该怎么帮你?” 这是我的代码: "use strict"; var builder = require("botbuilder"); var botbuilder_azure = require("botbuilder-azure"); var path = require('path'); var useEmulator = (process.env.NODE_ENV == 'development'); var connector = useEmulator ? new builder.ChatConnector() : new botbuilder_azure.BotServiceConnector({ appId: process.env['MicrosoftAppId'], appPassword: process.env['MicrosoftAppPassword'], stateEndpoint: process.env['BotStateEndpoint'], openIdMetadata: process.env['BotOpenIdMetadata'] }); var bot = new builder.UniversalBot(connector); bot.localePath(path.join(__dirname, './locale')); // Make sure you add […]

如何让Azure nodejs webapp重新运行npm install?

我正在Azure上运行Node web应用程序。 我使用“local git”方法部署应用程序。 每当我对源代码进行更改,提交,然后使用git push azure master进行部署时,网站上的代码将按预期更新。 但我最近的一个变化包括添加一个新的包到我的package.json文件。 现在,当我部署时,我的文件被更新,但azure似乎并没有重新运行npm install ,并且没有安装新的模块。 这意味着应用程序不会启动:当我的代码调用require('missingModuleName')它会得到一个致命的错误并停止。 上次我有这个问题,我从Azure中删除了应用程序,并从头创build一个新的。 但我希望有一个更简单的解决scheme。 我看到(在https://github.com/projectkudu/kudu/wiki/Deployment )部署“对于节点站点,Kudu在wwwroot文件夹中运行'npm install'”。 我不确定标准的“local git”部署方法是否调用Kudu部署过程。 我是否需要创build一个部署钩子(如https://github.com/projectkudu/kudu/wiki/Deployment-hooks中所述 )? 安装日志显示: 2017-07-29T07:59:51 Updating branch 'master'. 2017-07-29T07:59:52 Updating submodules. 2017-07-29T07:59:52 Preparing deployment for commit id '556a34aab5'. 2017-07-29T07:59:52 Running custom deployment command… 2017-07-29T07:59:52 Running deployment command… 2017-07-29T07:59:52 Command: deploy.cmd 2017-07-29T07:59:53 Handling node.js deployment. 2017-07-29T07:59:53 KuduSync.NET […]