Azure App Service Continuous Deployment Webhook doesn't work - azure

(I already asked in the Microsoft Forum but didn't get an answer.)
I have an App Service using a private registry with Continuous Deployment enabled. The app is running totally fine but the Webhook URL for the Continuous Deployment doesn't work.
Here's the output of an HTTP GET request to the webhook:
$ curl https://\$MySiteName:SomeLongPassword#mysite.scm.azurewebsites.net/docker/hook
"No route registered for '/docker/hook'"
Someone in the Microsoft Forum told me to try a POST request, so here's the output of that:
$ curl -X POST https://\$MySiteName:SomeLongPassword#mysite.scm.azurewebsites.net/docker/hook
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>
I haven't found anywhere in the Microsoft Azure docs how to use the webhook.

After more searching, I found this answer.
The answer suggests to do the following:
curl https://\$MySiteName:SomeLongPassword#mysite.scm.azurewebsites.net/docker/hook -H "" -d ""
No idea why this works and I wish there was something in the Azure docs.

Related

gitHubAutoDeployer for Google Cloud Functions auth redirects

I'm attempting to use the gitHubAutoDeployer function provided by:
https://github.com/GoogleCloudPlatform/community/blob/master/tutorials/cloud-functions-github-auto-deployer/index.md
I followed the project, but upon deploying and trying to trigger it, I discovered that the response to my webhook was a Google OAuth screen (in the GitHub project, go to Settings > Webhooks > Recent Deliveries). I went ahead and made the request interactive in a browser so I could provide access. After providing my credentials, I was redirected to the following:
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>403 Forbidden</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Forbidden</h1>
<h2>Your client does not have permission to get URL <code>/gitHubAutoDeployer</code> from this server.</h2>
<h2></h2>
</body></html>
Now, Recent Deliveries in GitHub respond with a 302:
Content-Length: 2
Content-Type: text/html
Date: Mon, 30 Mar 2020 15:02:27 GMT
Location: https://accounts.google.com/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttps://us-central1-REDACTED.cloudfunctions.net/gitHubAutoDeployer
Server: Google Frontend
X-Cloud-Trace-Context: d3333e1490ee3ca522c37243673931ed
What am I doing wrong? Any thoughts?
UPDATE: I opened an issue on the project's GitHub - there's a little more information available over there:
https://github.com/GoogleCloudPlatform/community/issues/1202
I also followed the tutorial on the project you referenced and I got the same result.
However, I achieved the expected behavior using Cloud Build with Continuous deployment

Azure App Service on Linux plan encoding issue

I deployed a node app "typically prerender server" to two different places and tested prerender with a get request to a url contains Arabic letters
1. Heruko: working perfectly
2. Azure App Service on linux plan failed with HTTP Error 400. The request URL is invalid.
here is the respond body from Postsman
<html>
<head>
<title>Bad Request</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">.cf-hidden { display: none; } .cf-invisible { visibility: hidden; }</style>
</head>
<body>
<h2>Bad Request - Invalid URL</h2>
<hr>
<p>HTTP Error 400. The request URL is invalid.</p>
</body>
</html>
Notice that the response head/meta contains charset=us-ascii
here is how the prerender node app see part of the url
u008aÙ\u0088Ù\u0085_Ù\u0085Ù\u0083رÙ\u0088Ù\u0086ع
i even created a node docker image to set language and locale to en_US.UTF-8 and changed Azure App to use this Docker image but still get error.
Any help please ?!
Unfortunately, after some investigation, I still don't understand why this issue occurred.
Actually App Service on Linux are still in Preview and not in Production yet. In this case, I would suggest you use an alternative offering, like Cloud Service or VM instead.
I have also tried to create prerender server on an Azure Linux Virtual Machine (Ubuntu Server 16.04 LTS), and it worked well.

how to reslove this C:\inetpub\wwwroot?

I am Pretty new in windows IIS server. i have successfully upload cakephp3.0 project.
when i access the website from windows IIS server it displays me following url in every page
**C:\inetpub\wwwroot**
I have also checked my header.My header part look Like this:-
enter code here
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
//MY Html Code
Even i have checked my all ctp but i don't know where th url comes from C:\inetpub\wwwroot. Can anyone help me. How to resolve this problem.
C:\inetpub\wwwroot is the default local path for websites in IIS. You can change it by right clicking on your website > Manage Web Site > Advanced settings > Physical Path:

How to generate a static html file from a swagger documentation?

I have created a Swagger documentation with a yaml file under:
api/swagger/swagger.yaml
Now I want to share a static HTML document with its definition, yet it was stated on the swagger project, that they don't plan to support HTML generation at all.
How can I generate a static HTML file from a Swagger project?
The easiest way I can think of is to use Swagger Editor:
Go to: https://editor.swagger.io
Click on "File" in the top menu bar and then select "Import File"
After import, click on "Generate Client" in the top menu bar, and then select "HTML" or "HTML2" to generate static HTML documentation
editor.swagger.io uses generator.swagger.io to generate API clients, server stubs and documentation, and generator.swagger.io is powered by the open-source project Swagger Codegen.
Download https://github.com/swagger-api/swagger-ui - folder of interest is "dist"
Copy your Swagger JSON into the dist folder
Open index.html and change the value of URL inside the tag at the bottom of the file to ./swagger.json (or whatever your swagger json is called) (see here)
Host online! (or start a local server to view output).
There is swagger2markup-cli that can generate a static adoc file.
Ensure that you have Java runtime installed. (I am using Java(TM) SE Runtime Environment (build 1.8.0_111-b14)).
You fetch the jar:
wget https://jcenter.bintray.com/io/github/swagger2markup/swagger2markup-cli/1.1.0/swagger2markup-cli-1.1.0.jar
And you can generate the a static adoc with it via:
java -jar ~/your/path/swagger2markup-cli-1.1.0.jar convert -i api/swagger/swagger.yaml --outputFile static-swagger
That adoc file can then be converted into a html file via asciidoctor:
asciidoctor *.adoc
You may need to install it, as I am using Ubuntu, I could via:
sudo apt-get -qq install asciidoctor
Are you trying to export it to create single documentation from different services? If yes, an alternative might be https://github.com/varghgeorge/microservices-single-swagger. This simple springboot microservice will show all your swagger documentation (from different servers) in one place based on YAML config.
Another answer suggested the Swagger Editor
, which is great. However, to obtain a single file to import into it:
npm install -g #apidevtools/swagger-cli
swagger-cli bundle openapi.yaml --outfile ./openapi-expanded.json --type json
The above command assumes your root file is named openapi.yaml and you want an output JSON file openapi-expanded.json: that JSON is what you'll import.
Use an HTML file like this to load your OpenAPI definition:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="//unpkg.com/swagger-ui-dist#3/swagger-ui.css">
<title>Your App API v1</title>
<body>
<div id="your-app-docs" />
<script src="//unpkg.com/swagger-ui-dist#3/swagger-ui-bundle.js"></script>
<script>
window.onload = function () {
const ui = SwaggerUIBundle({
url: "openapi.yml",
dom_id: "#your-app-docs",
deepLinking: true,
})
}
</script>
</body>
</html>
You can then later host it locally or use a service like Netlify to host it on the web.

Scheduled Azure WebJob Scheduler log suddenly reporting 401 - Unauthorized

I have scheduled a (single, free) WebJob. This has been working fine form months. I just updated to the newest Azure WebJobs Nuget, which may be circumstantial.
What I now get in the Azure WebJob scheduler logs is the following although I deployed everything without errors from Visual Studio 2015. My other, non scheduled webjobs that I deployed to the same server at the same time work fine. Who can tell me where I need to look/change?
Http Action - Response from host 'dummy4711(account).scm.azurewebsites.net': 'Unauthorized' Response Headers: Date: Mon, 29 Feb 2016 23:32:03 GMT
Server: Microsoft-IIS/8.0
WWW-Authenticate: Basic realm="site"
Body: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <title>401 - Unauthorized: Access is denied due to invalid credentials.
Can you check your connection string? That's what the error is telling you.
Access is denied due to invalid credentials
Maybe you wiped them or change them before deploying.
EDIT
Here's a link to an example to set this up.
Had the same problem yesterday with a new job deployment, something went broke either with the new portal or Web Jobs SDK Update I just installed in VS 2015...
The cause was as small as hard to notice.
How did I solve it?
New portal, go to Scheduler Jobs > {job name} > Settings > Action Settings
Be sure to have action set to HTTPS and the URL should start with HTTPS://...
I don't know why my VS2015 SP1 was setting up the scheduler job with https but action was set to http, this cause the HTTP 401 error.
Cheers.

Resources