Skip to content

Instantly share code, notes, and snippets.

View asizikov's full-sized avatar
💭
💻

Anton Sizikov asizikov

💭
💻
View GitHub Profile
@asizikov
asizikov / answer.md
Last active September 15, 2020 13:45
A tale of CURL and quotation marks

I find it very suspicious that the error message has a leading quotation mark before https:

curl: (6) Could not resolve host: " https

Usually when the url is invalid you get something like that:

$ export TEST_URI="http::://dafsf//asdf"
$ curl -X -GET $TEST_URI
@asizikov
asizikov / Dockerfile
Created September 9, 2020 13:08
node server
FROM node:12 AS appbuild
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
"parameters": {
"rgName": {
"type": "string"
},
"rgLocation": {
"type": "string"
},
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": true
}
},
"logLevel": {
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS installer-env
WORKDIR /src
COPY . /src
RUN mkdir -p /home/site/wwwroot && \
dotnet publish DockerizedFunc.FunctionApp/*.csproj --output /home/site/wwwroot
# To enable ssh & remote debugging on app service change the base image to the one below
FROM mcr.microsoft.com/azure-functions/dotnet:3.0-appservice
#FROM mcr.microsoft.com/azure-functions/dotnet:3.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
using DockerizedFunc.FunctionApp;
using DockerizedFunc.Dependency;
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
[assembly: FunctionsStartup(typeof(Startup))]
namespace DockerizedFunc.FunctionApp
{
public class Startup : FunctionsStartup
using System;
using System.Threading.Tasks;
using DockerizedFunc.Dependency;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
namespace DockerizedFunc.FunctionApp
{
public class ConsoleWriter
{
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
namespace DockerizedFunc.Dependency
{
public interface IAsyncGreeter
{
Task SayHiAsync();
}
#!/bin/sh
rg='rg-tags-demo'
rids=($(az resource list -g $rg --query '[].id' -o tsv)) || true
for rid in ${rids[@]}
do
az resource update --set tags.'ProvisionedBy'='manual' --id $rid || true
done