Docker container cannot connect to azure via MSI - azure

I have an azure function which has this code:
run = Run.get_context()
ws = Workspace.from_config('config.json',auth=MsiAuthentication()) if not hasattr(run, 'experiment') else run.experiment.workspace
This works when I test the function locally using func start
but when I build docker image for the azure function and run the docker, it gives following error:
Message: Failed to connect to MSI. Please make sure MSI is configured correctly.
Get Token request returned http error: 400, reason: Bad Request
InnerException None
ErrorResponse
{
"error": {
"message": "Failed to connect to MSI. Please make sure MSI is configured correctly.\nGet Token request returned http error: 400, reason: Bad Request"
}
}
The identity configuration for azure function has the required roles:
Or, is there any other authentication method that I should use?

Related

EC2 - IIS and .NET Core - add application I get error Authorization - Cannot verify access to path, HTTP Error 500.19

I want to add application in IIS. I have EC2 instance on AWS Amazon - Windows 2019 Server Base. I want to add application to my folder created in wwwroot folder. When I press test I get error:
Authorization Cannot verify access to path (C:\inetpub\wwwroot\myapp)
Authentication is ok
I was looking in the Internet and I've installed everything in IIS.
And when I go to my website http://localhost/myapp/ I have error:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x8007000d
Config Error
Config File \\?\C:\inetpub\wwwroot\myapp\web.config
Requested URL http://localhost:80/myapp/
Physical Path C:\inetpub\wwwroot\myapp\
Logon Method Not yet determined
Logon User Not yet determined
I've resolved the error. It was the problem with certificate for Identity server. I had to add certificate and configuration for that in appsettings.json:
"IdentityServer": {
"Key": {
"Type": "File",
"FilePath": "Certificates\\certificatefile.pfx",
"Password": "mypsw"
},
"Clients": {
"FtblrApp": {
"Profile": "IdentityServerSPA"
}
}
},
Now it works

not able to get Archive link using getArchiveLink() method in azure app service

I am trying to get the archive link from my node js application.This is working fine in my local machine but i am getting error in azure private app service.
octokit.repos.getArchiveLink({owner:owner,repo:sourceRepoName,archive_format:'zipball',ref:branch})
on executing this command in azure private app service I am getting the following error:
{ Error: Command failed: wmic os get Caption
Access is denied.
at makeError (D:\home\site\wwwroot\node_modules\execa\index.js:172:9)
at Function.module.exports.sync (D:\home\site\wwwroot\node_modules\execa\index.js:341:15)
at module.exports.release (D:\home\site\wwwroot\node_modules\windows-release\index.js:34:24)
at module.exports (D:\home\site\wwwroot\node_modules\os-name\index.js:39:18)
at getUserAgentNode (D:\home\site\wwwroot\node_modules\universal-user-agent\index.js:6:51)
at restEndpoint (D:\home\site\wwwroot\node_modules#octokit\rest\lib\endpoint\index.js:27:48)
at restRequest (D:\home\site\wwwroot\node_modules#octokit\rest\lib\request\index.js:7:26)
code: 1,
stdout: '',
stderr: 'Access is denied.\r\n',
failed: true,
signal: null,
cmd: 'wmic os get Caption',
timedOut: false }
According to your error information, the issue was caused by calling the command wmic os get Caption which be prevented by the Win32k.sys (User32/GDI32) Restrictions of Azure Web App sandbox. If try to call the command via Kudu console of your WebApp, the error Access is denied will be shown as same as I got as the figure below.
So if you have to use the current node package for Windows, the only way is using Azure Windows VM instead of Azure WebApps. if not, you can try to deploy your app on Azure WebApps for Linux.
Hope it helps. Any concern, please feel free to let me know.

Openwhisk and Node-red issue

I am trying to use node-red and openwhisk together so I can invoke openwhisk actions from node-red. I am using node-red-node-openwhisk (https://www.npmjs.com/package/node-red-node-openwhisk) for that.
I am using openwhisk outside of the bluemix locally with vagrant. I am trying to make this work according to this tutorial:
https://github.com/kpavel/openwhisk-light
but it seems impossible since I am ok until this comand
wsk action --apihost http://localhost:3000 invoke owl-test -r -p mykey myval
that I get this:
{
"error": {
"code": 4767018,
"error": "The supplied authentication is invalid"
},
"message": "GET https://openwhisk.ng.bluemix.net/api/v1/namespaces/_/actions/owl-test Returned HTTP 401 (Unauthorized) --> \"The supplied authentication is invalid\"",
"name": "OpenWhiskError",
"statusCode": 401
}
Also I cannot set the openwhisk node to work on my node-red environment because whatever apihost I am using I am getting errors.
Any suggestions?
There might be, or have been, a bug with setting the API host via a CLI parameter. It may also be necessary to run this before running your wsk action command:
wsk property set --apihost http://localhost:3000
https://github.com/apache/incubator-openwhisk-cli/issues/131

ReactJS deployment failed on Google App Engine

I'm trying to deploy my simple ReactJS project on Google App Engine. But I don't know why deployment is failed on Google App Engine regarding following documentation of Google. https://cloud.google.com/nodejs/getting-started/hello-world
Error logs when I encountered.
The push refers to a repository [us.gcr.io/react-ppshein/appengine/default.20160905t090720] (len: 1)
ec870881572a: Preparing
Post https://us.gcr.io/v2/react-ppshein/appengine/default.20160905t090720/blobs/uploads/: token auth attempt for registry: https://us.gcr.io/v2/token?account=_token&scope=repository%3Areact-ppshein%2Fappengine%2Fdefault.20160905t090720%3Apush%2Cpull&service=us.gcr.io request failed with status: 403 Forbidden
ERROR
ERROR: error pushing image "us.gcr.io/react-ppshein/appengine/default.20160905t090720:latest": exit status 1
ERROR: (gcloud.app.deploy) Error Response: [2] Build failed; check build logs for details

grunt grunt-s3 upload error ECONNREFUSED issue

I am using grunt to do a build and one plugin I am using is grunt-s3 to push files (if tests successful) to the cloud.
However, I am getting:
Running "s3" task
>> Error: Upload error: /header/dist/js/lib/json2.min.js.gz (Error: connect ECONNREFUSED)
>> Error: Upload error: /header/dist/js/lib/modernizr.custom.js.gz (Error: connect ECONNREFUSED)
>> Error: Upload error: /header/dist/js/master.menu.min.js.gz (Error: connect ECONNREFUSED)
Anyone have any idea what I can check/change? My Amazon credentials are ok as I can log in using my key/secret to my bucket via cloudberry explorer on the same machine/connection so must be something node/grunt related?
EDIT
Reading npm docs says this:
"I get ECONNREFUSED a lot. What's up?
... or node's DNS isn't able to reach out."
This sounds intriguing, but I have no idea what to check or how to resolve as I am new to node.js

Resources