Posts

Showing posts from January, 2020

telegraf - running as a daemon

By default, telegraf comes as a tar/zip file which are not installed into a specific folder. As part the linux way of doing things, packages are placed in /user/local folder.

I needed to configure telegraf as my daemon. So i used the following conf and place it under /etc/systemd/system

[Unit]
Description=telegraf.servicee

[Service]
ExecStart=/usr/local/bin/telegraf --config /usr/local/etc/telegraf/telegraf.conf

[Install]
WantedBy=multi-user.target:

To reload and re-run all the daemon. 

sudo systemctl daemon-reload

To start a single service 

systemctl start telegraf.service

To stop the status 

systemctl status telegraf.service

To get the status 

systemctl status telegraf.service



How to quickly test if a Azure Blob storage Blob sas key works

Try to update a file called "alerting.jpg" to a blob container.
Then get the full path of the blob file. For example it could be :-

https://mystorage.blob.core.windows.net/batch/alerting.jpg

then append your sas key to the this uri.

https://devsapmtgdsdataextracts.blob.core.windows.net/batch/alerting.jpg?sv=2017-07-29&ss=b&srt=sco&sp=rl&se=2099-12-31&st=2018-03-21&spr=https,http&sig=someweirdkey


And once you combined it, just paste it into your browser. You should be able to access  and load the file if your SAS key is legit.


Azure App Configuration : practical guide

Image
Create a non https mvc dotnet core project.
dotnetnew mvc --no-https Sample csproj configuration. Dotnet core will throw you missing Configuration Error, if you include some packages that are not suppose to be in.




If you're doing it from nuget package manager, please ensure you checked "Include Pre-release"

dotnetadd package Microsoft.Azure.AppConfiguration.AspNetCore --version
3.0.0-preview-010560002-1165


You need to create a ConnectionString:Appconfig in your app settings. In actual deployment it looks like this




The value should be something like this (just copy connection string value)  :-







Endpoint=https://your-awesome-appconfig.azconfig.io;Id=fake_id;Secret=fakesecret

Let's wire up your view to actually pull data from Application Configuration



You need to grab some configuration data from the store and show it like this

dotnet create angular project without https

To do that, use the following command :-


dotnet new angular -o belair_app --no-https

The project 'Web' must provide a value for Configuration” error after migrating to .NET Core 3

To fix this :-

If it is in .net 3.0, remove all these

"Microsoft.AspNetCore.Mvc"Version="2.2.0""Microsoft.AspNetCore.Mvc.Razor.ViewCompilation"Version="2.2.0"
And make it look like this below :-





dotnet cli for angular project

Quick and easy way to set you up :)

Run the following from the command line :-

dotnetnew angular -o my-new-app


Setting up server side
export ASPNETCORE_Environment=Development
dotnet build
dotnet run

Setting up client side
npm install --save
ng serve

Direct docs is availabe from here