How to setup custom DNS with Azure Websites Preview? - azure

I created a new Azure Website, using Umbraco as the CMS. I got a page up and going, and I already have a .co.nz domain with www.domains4less.com. There's a whole lot of stuff on the internet about pointing URLs to Azure, but that seems to be more of a redirection service than anything (i.e. my URLs still use azurewebsites.net once I land on my site).
Has anybody had any luck getting it to go?
Here's the error I get when I try adding the DNS entry to Azure (I'm in reserved mode, reemdairy is the name of the website):
There was an error processing your request. Please try again in a few
moments.
Browser: 5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like
Gecko) Chrome/19.0.1084.56 Safari/536.5 User language: undefined
Portal Version: 6.0.6002.18488 (rd_auxportal_stable.120609-0259)
Subscriptions: 3aabe358-d178-4790-a97b-ffba902b2851 User email
address: touchmaniacs#live.com
Last 10 Requests
message: Failure: Ajax call to: Websites/UpdateConfig. failed with
status: error (500) in 2.57 seconds. x-ms-client-request-id was:
38834edf-c9f3-46bb-a1f7-b2839c692bcf-2012-06-12 22:25:14Z dateTime:
Wed Jun 13 2012 10:25:17 GMT+1200 (New Zealand Standard Time)
durationSeconds: 2.57 url: Websites/UpdateConfig status: 500
textStatus: error clientMsRequestId:
38834edf-c9f3-46bb-a1f7-b2839c692bcf-2012-06-12 22:25:14Z sessionId:
09c72263-6ce7-422b-84d7-4c21acded759 referrer:
https://manage.windowsazure.com/#Workspaces/WebsiteExtension/Website/reemdairy/configure
host: manage.windowsazure.com response: {"message":"Try again. Contact
support if the problem persists.","ErrorMessage":"Try again. Contact
support if the problem
persists.","httpStatusCode":"InternalServerError","operationTrackingId":"","stackTrace":null}
message: Complete: Ajax call to: Websites/GetConfig. completed with
status: success (200) in 1.021 seconds. x-ms-client-request-id was:
a0cdcced-13d0-44e2-866d-e0b061b9461b-2012-06-12 22:24:43Z dateTime:
Wed Jun 13 2012 10:24:44 GMT+1200 (New Zealand Standard Time)
durationSeconds: 1.021 url: Websites/GetConfig status: 200 textStatus:
success clientMsRequestId:
a0cdcced-13d0-44e2-866d-e0b061b9461b-2012-06-12 22:24:43Z sessionId:
09c72263-6ce7-422b-84d7-4c21acded759 referrer:
https://manage.windowsazure.com/#Workspaces/WebsiteExtension/Website/reemdairy/configure
host: manage.windowsazure.com
message: Complete: Ajax call to:
https://manage.windowsazure.com/Service/OperationTracking?subscriptionId=3aabe358-d178-4790-a97b-ffba902b2851.
completed with status: success (200) in 1.887 seconds.
x-ms-client-request-id was:
a7689fe9-b9f9-4d6c-8926-734ec9a0b515-2012-06-12 22:24:40Z dateTime:
Wed Jun 13 2012 10:24:42 GMT+1200 (New Zealand Standard Time)
durationSeconds: 1.887 url:
https://manage.windowsazure.com/Service/OperationTracking?subscriptionId=3aabe358-d178-4790-a97b-ffba902b2851
status: 200 textStatus: success clientMsRequestId:
a7689fe9-b9f9-4d6c-8926-734ec9a0b515-2012-06-12 22:24:40Z sessionId:
09c72263-6ce7-422b-84d7-4c21acded759 referrer:
https://manage.windowsazure.com/#Workspaces/WebsiteExtension/Website/reemdairy/configure
host: manage.windowsazure.com
message: Complete: Ajax call to: /Service/GetUserSettings. completed
with status: success (200) in 0.941 seconds. x-ms-client-request-id
was: 805e554d-1e2e-4214-afd5-be87c0f255d1-2012-06-12 22:24:40Z
dateTime: Wed Jun 13 2012 10:24:40 GMT+1200 (New Zealand Standard
Time) durationSeconds: 0.941 url: /Service/GetUserSettings status: 200
textStatus: success clientMsRequestId:
805e554d-1e2e-4214-afd5-be87c0f255d1-2012-06-12 22:24:40Z sessionId:
09c72263-6ce7-422b-84d7-4c21acded759 referrer:
https://manage.windowsazure.com/#Workspaces/WebsiteExtension/Website/reemdairy/configure
host: manage.windowsazure.com
message: Complete: Ajax call to:
Extensions/ApplicationsExtension/SqlAzure/ClusterSuffix. completed
with status: success (200) in 0.483 seconds. x-ms-client-request-id
was: 85157ceb-c538-40ca-8c1e-5cc07c57240f-2012-06-12 22:24:39Z
dateTime: Wed Jun 13 2012 10:24:40 GMT+1200 (New Zealand Standard
Time) durationSeconds: 0.483 url:
Extensions/ApplicationsExtension/SqlAzure/ClusterSuffix status: 200
textStatus: success clientMsRequestId:
85157ceb-c538-40ca-8c1e-5cc07c57240f-2012-06-12 22:24:39Z sessionId:
09c72263-6ce7-422b-84d7-4c21acded759 referrer:
https://manage.windowsazure.com/#Workspaces/WebsiteExtension/Website/reemdairy/configure
host: manage.windowsazure.com
message: Complete: Ajax call to:
Extensions/ApplicationsExtension/SqlAzure/GetClientIp. completed with
status: success (200) in 0.309 seconds. x-ms-client-request-id was:
2eb194b6-66ca-49e2-9016-e0f89164314c-2012-06-12 22:24:39Z dateTime:
Wed Jun 13 2012 10:24:40 GMT+1200 (New Zealand Standard Time)
durationSeconds: 0.309 url:
Extensions/ApplicationsExtension/SqlAzure/GetClientIp status: 200
textStatus: success clientMsRequestId:
2eb194b6-66ca-49e2-9016-e0f89164314c-2012-06-12 22:24:39Z sessionId:
09c72263-6ce7-422b-84d7-4c21acded759 referrer:
https://manage.windowsazure.com/#Workspaces/WebsiteExtension/Website/reemdairy/configure
host: manage.windowsazure.com
message: Complete: Ajax call to:
Extensions/ApplicationsExtension/SqlAzure/DefaultServerLocation.
completed with status: success (200) in 0.309 seconds.
x-ms-client-request-id was:
1bc165ef-2081-48f2-baed-16c6edf8ea67-2012-06-12 22:24:39Z dateTime:
Wed Jun 13 2012 10:24:40 GMT+1200 (New Zealand Standard Time)
durationSeconds: 0.309 url:
Extensions/ApplicationsExtension/SqlAzure/DefaultServerLocation
status: 200 textStatus: success clientMsRequestId:
1bc165ef-2081-48f2-baed-16c6edf8ea67-2012-06-12 22:24:39Z sessionId:
09c72263-6ce7-422b-84d7-4c21acded759 referrer:
https://manage.windowsazure.com/#Workspaces/WebsiteExtension/Website/reemdairy/configure
host: manage.windowsazure.com
message: Complete: Ajax call to:
Extensions/ApplicationsExtension/SqlAzure/ServerLocations. completed
with status: success (200) in 0.309 seconds. x-ms-client-request-id
was: e1fba7df-6a12-47f8-9434-bf17ca7d93f4-2012-06-12 22:24:39Z
dateTime: Wed Jun 13 2012 10:24:40 GMT+1200 (New Zealand Standard
Time) durationSeconds: 0.309 url:
Extensions/ApplicationsExtension/SqlAzure/ServerLocations status: 200
textStatus: success clientMsRequestId:
e1fba7df-6a12-47f8-9434-bf17ca7d93f4-2012-06-12 22:24:39Z sessionId:
09c72263-6ce7-422b-84d7-4c21acded759 referrer:
https://manage.windowsazure.com/#Workspaces/WebsiteExtension/Website/reemdairy/configure
host: manage.windowsazure.com

Its good that you have Windows Azure Website (Reserve) because only Reserve websites can have CNAME or A record point to your_site.azurewebsites.net.
May I ask what are you setting, CNAME or A Record?
Here is the step by step direction on setting either CNAME (which is suggested for websites and webroles) so please follow and suggest at what step you have an issue:
Configuring a Custom Domain Name in Windows Azure

I've successfully done this with the exact same setup (Umbraco, running on Azure with a domains4less.co.nz domain). DNS setup with Domains4less can be obtuse - but here's how to setup a CNAME to your app:
From 'Manage Domains', hit 'Setup' on the domain you want. Next page, 'Advanced Control Panel' and login. Expand 'Services', open 'Domain Templates' and click 'Add a domain template'
Give your template a name (e.g 'yourdomain.co.nz'), and scroll down to the CNAME Records section. Click 'Add a CNAME record', Prefix field: www, Destination Address: YOURAPPNAME.azurewebsites.net.. Save.
Open 'Domains' in the left-side menu and click '[edit]' on the domain you want to setup, open the 'Advanced Mode' tab and choose your template from the Template drop-down list. Save, done.
Phew.

Related

java.net.UnknownHostException: https-proxy.service

I am trying to add BCFIPS in my service, my testcase started failing after adding configuration for bcfips.
Provider: KeyPairGenerator.EC algorithm from: BCFIPS
Provider: KeyPairGenerator.EC algorithm from: BCFIPS
Mon Mar 28 10:29:37.494 IST 2022 [http-nio-auto-1-exec-2] [c.s.a.s.f.f.s.o.TokenStoringUserInfoTokenService: ERROR] - Exception on authentication: java.net.UnknownHostException: https-proxy.service
Provider: KeyStore.FIPS type from: BCFIPS
org.opentest4j.AssertionFailedError:
expected: 200 OK
but was: 401 UNAUTHORIZED
Expected :200 OK
Actual :401 UNAUTHORIZED

Lambda execution failed with status 200 due to customer function error

I'm creating a simple Lambda function to serve a POST in AWS Gateway:
import json
import boto3
from datetime import datetime
def lambda_handler(event,context):
wf = event['WF']
if wf == 'start1':
body = 'Suceeded'
return {
"isBase64Encoded": False,
'statusCode': 200,
'body': json.dumps(body),
'headers': {
'Content-Type': 'application/json'
}
}
else:
body = 'Failed'
return {
"isBase64Encoded": False,
'statusCode': 400,
'body': json.dumps(body),
'headers': {
'Content-Type': 'application/json'
}
}
If I send a POST with this body is successful:
{
"WF": "start1",
"Context": "OK"
}
Returns:
Test Event Name
test
Response
{
"isBase64Encoded": false,
"statusCode": 200,
"body": "\"Suceeded\"",
"headers": {
"Content-Type": "application/json"
}
}
Function Logs
START RequestId: 91663a9d-d8b6-4aad-b8b6-eb2f15ff0354 Version: $LATEST
END RequestId: 91663a9d-d8b6-4aad-b8b6-eb2f15ff0354
REPORT RequestId: 91663a9d-d8b6-4aad-b8b6-eb2f15ff0354 Duration: 1.74 ms Billed Duration: 2 ms Memory Size: 128 MB Max Memory Used: 66 MB Init Duration: 300.73 ms
Request ID
91663a9d-d8b6-4aad-b8b6-eb2f15ff0354
But if I run a test in the API Gateway service in AWS I get:
Fri Jun 04 13:45:22 UTC 2021 : Sending request to https://XXXXXXX
Fri Jun 04 13:45:22 UTC 2021 : Received response. Status: 200, Integration latency: 15 ms
Fri Jun 04 13:45:22 UTC 2021 : Endpoint response headers: {Date=Fri, 04 Jun 2021 13:45:22 GMT, Content-Type=application/json, Content-Length=159, Connection=keep-alive, x-amzn-RequestId=d479fdac-6737-42fa-96a3-9e991056b48d, X-Amz-Function-Error=Unhandled, x-amzn-Remapped-Content-Length=0, X-Amz-Executed-Version=$LATEST, X-Amzn-Trace-Id=root=1-60ba2e72-ff62f051febbd21d6cc9d114;sampled=0}
Fri Jun 04 13:45:22 UTC 2021 : Endpoint response body before transformations: {"errorMessage": "'WF'", "errorType": "KeyError", "stackTrace": [" File \"/var/task/lambda_function.py\", line 7, in lambda_handler\n wf = event['WF']\n"]}
Fri Jun 04 13:45:22 UTC 2021 : Lambda execution failed with status 200 due to customer function error: 'WF'. Lambda request id: d479fdac-6737-42fa-96a3-9e991056b48d
Fri Jun 04 13:45:22 UTC 2021 : Method completed with status: 502
Why line 7 is wrong?
Is there another way to parse the body of the POST?
The solution was found by disabling Lambda Proxy Integration in the POST - Integration Request.
It looks like your API Gateway invocation is not populating the event parameter of your Lambda function. When you create a test event your lambda function's page, you get to create your own test event. API Gateway will not use this test event, it will instead send an empty event (probably null).
I.e.
import json
import boto3
from datetime import datetime
def lambda_handler(event,context): # Event is null here
wf = event['WF'] # Attempting to read the attribute 'WF' of null results in an error
In my instance, I had received this error when invoking my Lambda function via API gateway, it was also completely fine when invoking directly the lambda function expecting a simple JSON body.
my expected payload:
{"Email": "foo3#foo.com"}
It turns out Lambda Proxy Integration in the POST in the configuration API gateway changes the payload structure before passing into Lambda, and I was getting the error missing Key attribute Email. I noticed that line Endpoint request body after transformations: in cloudwatch. I learned that it was changing the payload.
How I debug this:
Invoke Lambda using test events ensuring the both the error scenario and success scenarios are working.
Ensure there are no permission issues via API gateway by making sure that your API gateway can invoke the Lambda and have appropriate IAM roles/policies
Ensure your lambda has the API gateway as the trigger
I tried removing all the security token first via API gateway to verify I am able to invoke the API
I tried both HTTP methods POST And GET, seeing the same error (Email was missing) was the key to figuring this out as I was already passing the payload in the request body in the POST method.

Logging in with axios

I am just starting with web scraping and using axios.
I am trying to take it one step at a time. I am trying to scrape a web page. There is a url for login page like
webpage/login
If I inspect the page the login form which has 2 input fields name and password,
<input type="text" name="login">
<input type="password" name="password">
Once I enter the username and password in the browser, I get redirected to a page which contains the data that I need.
axios({
method: 'post',
url: 'https://mywebsite/login/',
data: {
login: 'Dave232',
password: 'pass23456'
}
})
.then(response=>{
console.log(response.data)
console.log(response.headers);
})
.catch(error=>{
console.log(error)
})
However, when I run my node app, I get the login page html back instead of the next page.
console.log(response.header)
returns
{ date: 'Wed, 18 Sep 2019 03:17:35 GMT',
server: 'Apache-Coyote/1.1',
'content-type': 'text/html;charset=UTF-8',
'content-length': '24979',
'set-cookie':
[ 'cfid=04d1704f-88f6-49b6-bcd4-4a7467b8e4ab;Path=/;Expires=Thu, 16-Sep-2049 11:09:05 GMT;HTTPOnly',
'cftoken=0;Path=/;Expires=Thu, 16-Sep-2049 11:09:05 GMT;HTTPOnly',
'JSESSIONID=6874842A05E89B0D8B1D33BEBAD537AF.NE1ITCPRHEWS06; Path=/website/; Secure; HttpOnly',
'LOGGED_IN=;Path=/;Expires=Wed, 18-Sep-2019 03:17:35 GMT',
'CF_CLIENT_WEBSITE=%7B%27queueLastTab%27%3A%27workorder%27%2C%27last_contract_category_sk%27%3A%27%27%7D;Path=/;Expires=Thu, 19-Sep-2019 03:17:35 GMT',
'CF_CLIENT_WEBSITE_LV=1568776655537;Path=/;Expires=Thu, 19-Sep-2019 03:17:35 GMT',
'CF_CLIENT_WEBSITE_TC=1568776655537;Path=/;Expires=Thu, 19-Sep-2019 03:17:35 GMT',
'CF_CLIENT_WEBSITE_HC=2;Path=/;Expires=Thu, 19-Sep-2019 03:17:35 GMT' ],
connection: 'close' }
Please help me.
Edit 1:
Just realized that the forms action preperty looks something like this:
<form action="index.cfm?fuseaction=security.login_check" method="post">
I have never seen an action property like this. But I tried the url:
url/index.cfm?fuseaction=security.login_check
which did not work either
You need to handle redirection in your node app. You can access redirect URL using.
response.request.res.responseUrl
https://github.com/axios/axios/issues/799

Generating signed XPI via jpm failed

There was a problem signing an Add-On via jpm: The command
jpm -v sign --api-key 'user:xxxxxxxx:xxx' --api-secret xxxxxxxxxxxxxxxxxxxxxxxxx
failed with the error message
Error: Received bad response from the server while requesting https://addons.mozilla.org/api/v3/addons/%40addonname/versions/0.x.y/
Signing via the web interface worked.
How can this be fixed?
The full verbose output is
JPM [info] binary set to /usr/bin/firefox
JPM [info] verbose set
JPM [info] Checking compatability bootstrap.js and install.rdf for xpi
Validating the manifest
JPM [info] Creating fallbacks if they are necessary..
Creating XPI
JPM [info] Creating XPI...
JPM [info] .jpmignore found
JPM [info] Adding: /path/to/file
[...]
JPM [info] Adding: /path/to/another_file
JPM [info] XPI created at /tmp/tmp-unsigned-xpi-25600yuqzFN3Alxa0/#addonname-0.x.y.xpi (121ms)
JPM [info] Removing fallbacks if they were necessary..
JPM [info] Creating updateRDF...
Created XPI at /tmp/tmp-unsigned-xpi-25600yuqzFN3Alxa0/#addonname-0.x.y.xpi
JPM [info] Created XPI for signing: /tmp/tmp-unsigned-xpi-25600yuqzFN3Alxa0/#addonname-0.x.y.xpi
JPM [debug] [API] -{ url: 'https://addons.mozilla.org/api/v3/addons/%40addonname/versions/0.x.y/',
formData:
{ upload:
{ _readableState: [Object],
readable: true,
domain: null,
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
path: '/tmp/tmp-unsigned-xpi-25600yuqzFN3Alxa0/#addonname-0.x.y.xpi',
fd: null,
flags: 'r',
mode: 438,
start: undefined,
end: undefined,
autoClose: true,
pos: undefined } },
headers: { Authorization: '<REDACTED>', Accept: 'application/json' } }
JPM [debug] [API] <- { headers:
{ allow: 'GET, PUT, HEAD, OPTIONS',
'content-type': 'application/json',
date: 'Thu, 17 Dec 2015 10:17:23 GMT',
server: 'nginx',
'set-cookie': '<REDACTED>',
'strict-transport-security': 'max-age=31536000',
vary: 'Accept, X-Mobile, User-Agent',
'www-authenticate': 'JWT realm="api"',
'x-frame-options': 'DENY',
'content-length': '51',
connection: 'Close' },
response: { detail: 'Incorrect authentication credentials.' } }
JPM [error] FAIL
Error: Received bad response from the server while requesting https://addons.mozilla.org/api/v3/addons/%40addonname/versions/0.x.y/
status: 401
response: {"detail":"Incorrect authentication credentials."}
headers: {"allow":"GET, PUT, HEAD, OPTIONS","content-type":"application/json","date":"Thu, 17 Dec 2015 10:17:23 GMT","server":"nginx","set-cookie":["multidb_pin_writes=y; expires=Thu, 17-Dec-2015 10:17:38 GMT; Max-Age=15; Path=/"],"strict-transport-security":"max-age=31536000","vary":"Accept, X-Mobile, User-Agent","www-authenticate":"JWT realm=\"api\"","x-frame-options":"DENY","content-length":"51","connection":"Close"}
at /usr/local/lib/node_modules/jpm/lib/amo-client.js:85:13
at tryCatchReject (/usr/local/lib/node_modules/jpm/node_modules/when/lib/makePromise.js:845:30)
at runContinuation1 (/usr/local/lib/node_modules/jpm/node_modules/when/lib/makePromise.js:804:4)
at Fulfilled.when (/usr/local/lib/node_modules/jpm/node_modules/when/lib/makePromise.js:592:4)
at Pending.run (/usr/local/lib/node_modules/jpm/node_modules/when/lib/makePromise.js:483:13)
at Scheduler._drain (/usr/local/lib/node_modules/jpm/node_modules/when/lib/Scheduler.js:62:19)
at Scheduler.drain (/usr/local/lib/node_modules/jpm/node_modules/when/lib/Scheduler.js:27:9)
at doNTCallback0 (node.js:417:9)
at process._tickCallback (node.js:346:13)
These posts (1), (2) show that this error can occur if your local clock is off by more than 60 seconds with the Mozilla server.
This is also documented in the Olympia 3.0 Authentication API (see exp parameter):
iat
This is a standard JWT claim indicating the issued at time. It should be a Unix epoch timestamp and must be in UTC time.
exp
This is a standard JWT claim indicating the expiration time. It should be a Unix epoch timestamp in UTC time and must be no longer
than 60 seconds past the issued at time.
Note:
If you’re having trouble authenticating, make sure your system clock
is correct and consider synchronizing it with something like NTP
(Network Time Protocol).

Strange Config file error

I am working on an application which requires AWS (Amazon Web Services) push notification services.
I am running this on a node server, when I run the curl http request I get this error:
Registering user with deviceId: nodeserver
{ [Error: Missing credentials in config]
message: 'Missing credentials in config',
code: 'SigningError',
time: Tue Nov 17 2015 13:52:20 GMT+0000 (GMT),
originalError:
{ message: 'Could not load credentials from any providers',
code: 'CredentialsError',
time: Tue Nov 17 2015 13:52:20 GMT+0000 (GMT),
originalError:
{ message: 'Connection timed out after 1000ms',
code: 'TimeoutError',
time: Tue Nov 17 2015 13:52:20 GMT+0000 (GMT) } } }
Does anybody know what this error is or if anybody has had this type of error before and knows how to go about fixing it?

Resources