profile
viewpoint
Chandler Deng chandde Microsoft Redmond, WA 98052 Microsoft, Windows, C++, Azure IoT Edge/Hub, RUST, React/gulp/yarn/npm

microsoft/Windows-iotcore-samples 552

Official code samples repository for Windows 10 Internet of Things (IoT)

push eventchandde/projection-grid

Chandler Deng

commit sha 989b6c982498002548bcaa5a49032703be04a252

Update package.json

view details

push time in a day

push eventchandde/projection-grid

Chandler Deng

commit sha c7f33950e4615c684278548c94a0fffdd87bd3d2

Update table-view.js

view details

push time in a day

push eventchandde/projection-grid

Chandler Deng

commit sha d270b680e7e086d1bfbbd55c475146126eedb2d3

Make sure top is never negative value

view details

push time in a day

issue commentstefanprodan/AspNetCoreRateLimit

Cannot use this in Azure App Service as App Service Configuration requires all settings to be string type

I resolved this issue by converting the entire IpRateLimiting configuration into a json, and put the json string in app settings (or Azure App Service Configuration),

{
    "otherconfigurations": "othervalues",
    "IpRateLimiting": "{\"EnableEndpointRateLimiting\":true,\"StackBlockedRequests\":false,\"RealIPHeader\":\"X-Real-IP\",\"ClientIdHeader\":\"X-ClientId\",\"HttpStatusCode\":429,\"GeneralRules\":[{\"Endpoint\":\"*\",\"Period\":\"10m\",\"Limit\":60},{\"Endpoint\":\"*:/sendemail\",\"Period\":\"5m\",\"Limit\":5}]}"
  }
}

At runtime, read the configuration value string, build a new configuration by the json stream

var ipRateLimitingStr = config.GetSection("IpRateLimiting");
var ipRateLimitingConfiguration = new ConfigurationBuilder().AddJsonStream(new MemoryStream(Encoding.ASCII.GetBytes(ipRateLimitingStr.Value))).Build();
services.Configure<IpRateLimitOptions>(ipRateLimitingConfiguration);
chandde

comment created time in 10 days

issue openedstefanprodan/AspNetCoreRateLimit

Cannot use this in Azure App Service as App Service Configuration requires all settings to be string type

When I locally tested it and it worked pretty well, however, I have an Asp.Net Core App Service running in Azure, I use App Service Configuration to set the configs, there is a requirement that all settings key and value must be string type (i.e. quoted, here's a link to Azure Docs https://docs.microsoft.com/en-us/azure/app-service/configure-common), however package uses a few boolean and integer setting values, how should I make it work? see below snapshot, is there a way to work around this?

Do I have to load the string version of config, then build another config with manual conversion ("true" -> true, "20" -> 20) then feed the component?

image

"IpRateLimiting": {
  "EnableEndpointRateLimiting": true, <- non string
  "StackBlockedRequests": false, <- non string
  "RealIPHeader": "X-Real-IP",
  "ClientIdHeader": "X-ClientId",
  "HttpStatusCode": 429, <- non string
  "GeneralRules": [
    {
      "Endpoint": "*",
      "Period": "10m",
      "Limit": 60 <- non string
    },
    {
      "Endpoint": "*:/sendemail",
      "Period": "5m",
      "Limit": 5 <- non string
    }
  ]
}

created time in 10 days

push eventchandde/misc

chandde

commit sha 9c22dc8d4f0256d75a837aa32380bb14f6f57b46

change model to float:

view details

push time in a month

push eventchandde/misc

Chandler Deng

commit sha 9e533e006cb1f6205d0fd7b546b04a34463b30ec

change values to float

view details

Chandler Deng

commit sha 9e0fc4a96d88de5441c425edf8f0832f0637535a

Merge branch 'master' of https://github.com/chandde/misc merge master

view details

push time in a month

push eventchandde/misc

Chandler Deng

commit sha 2406c743a6205d60935e1311b836ef9d269cd422

split subdomain into new class

view details

push time in 2 months

push eventchandde/misc

Chandler Deng

commit sha 95590d7fb6a6c9bc490c848b6763c4e9a4db6ffa

smartpage netcore cache and home temp func

view details

push time in 2 months

push eventchandde/misc

Chandler Deng

commit sha bb3953731dfff08cb6273efacab1b141e5553bd1

hometemp-pi.py

view details

push time in 2 months

push eventchandde/misc

Chandler Deng

commit sha dfa1c335ca439aed9d8c80e08c0c43a0e2376611

home temp and mail client

view details

push time in 2 months

push eventchandde/misc

Chandler Deng

commit sha 9acd53a5b3053c2aaefb96100e5c57879d94e541

tune configuration

view details

push time in 2 months

push eventchandde/misc

Chandler Deng

commit sha 5d9a692ead1b2269fa124840b2fd9de96ddb4c9a

aspcore net ui server

view details

push time in 2 months

push eventchandde/misc

Chandler Deng

commit sha 3d9caefc458eabdecfea6e2227cf442f533a02e6

ignore node modules when publishing

view details

push time in 2 months

push eventchandde/misc

chandde

commit sha 2424d836dec660b7aadece3d4bf7b05047c278d5

move to app service

view details

push time in 2 months

push eventchandde/misc

Chandler Deng

commit sha 49e42b621d71d239abdc0589d6b765ecda997b42

use cdn link for config

view details

push time in 3 months

push eventchandde/misc

Chandler Deng

commit sha 074a16af8feb0310d8d6915cfd3fc02eb4f841db

support subdomain + suffix

view details

push time in 3 months

push eventchandde/misc

chandde

commit sha cd7af3df6d5d7d7944f31bb6872ef9969bf56dba

change main.js pointing to blob

view details

push time in 3 months

push eventchandde/misc

Chandler Deng

commit sha 100b68997925f3bf2cc7bf0f4850cc783cd8a3ac

adjust styles

view details

push time in 3 months

push eventchandde/misc

Chandler Deng

commit sha b50596a43a313c5cf9ee06ead818528a61aedccc

adapt new blob structure

view details

push time in 3 months

more