Skip to content

Instantly share code, notes, and snippets.

Avatar

Thurupathan thuru-zz

View GitHub Profile
@thuru-zz
thuru-zz / azurelighthouse_subscription_arm.json
Created Mar 5, 2020
Azure Lighthouse ARM Template (subscription delegated management access)
View azurelighthouse_subscription_arm.json
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"mspOfferName": {
"type": "string",
"metadata": {
"description": "Specify the name of the offer from the Managed Service Provider"
}
},
@thuru-zz
thuru-zz / azurelighthouse_subscription_arm.json
Created Mar 5, 2020
Azure Lighthouse ARM template (subscription level permission)
View azurelighthouse_subscription_arm.json
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"mspOfferName": {
"type": "string",
"metadata": {
"description": "Specify the name of the offer from the Managed Service Provider"
}
},
@thuru-zz
thuru-zz / sql database and ef core with asp.net core
Last active Jan 7, 2020
accessing azure sql database using ef core in asp.net core : 2nd Edt. Practical Azure Application Development : Chapter 04
@thuru-zz
thuru-zz / blob storage usage
Last active Jan 7, 2020
using blob storage : 2nd Edt. Practical Azure Application Development : Chapter 04
View blob life cycle policy.json
{
"rules": [
"enabled": true,
"name": "yearly backup rule",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 30
View service principle oid.ps
Get-AzureRmADServicePrincipal -ObjectId db9c6f9e-bea0-4325-b18c-dcd6eda668af
ServicePrincipalNames : {98b1ebaf-b6b2-4368-ba53-c36ae0551b90, https://identity.azure.net/4zuSVB9vvyfEk5wvTupj9aFQnGVY0bvqMPfQ9bTKrwk=}
ApplicationId : 98b1ebaf-b6b2-4368-ba53-c36ae0551b90
DisplayName : chimp01
Id : db9c6f9e-bea0-4325-b18c-dcd6eda668af
Type : ServicePrincipal
View gist:9382cd52dccd0b8d84bf87daa015951f
(Get-AzureRmADServicePrincipal).Count
View reverse proxy call.cs
string reverseProxyUrl = "http://localhost:19801/ApplicationName/InternalServiceName/RestOfTheUri";
var httpClient = new HttpClient();
var response = await httpClient.GetAsync(reverseProxyUrl);
View reverse proxy call.cs
string reverseProxyUrl = "http://localhost:19801/ApplicationName/InternalServiceName/RestOfTheUri";
var httpClient = new HttpClient();
var response = await httpClient.GetAsync(reverseProxyUrl);
@thuru-zz
thuru-zz / ReverseProxyServiceResponseFilter.cs
Created Aug 1, 2018
Reverse Proxy Service Response Filter
View ReverseProxyServiceResponseFilter.cs
public class ReverseProxyServiceResponseFilter : IResultFilter
{
public void OnResultExecuted(ResultExecutedContext context)
{
if(context.HttpContext.Response.StatusCode == 404)
{
context.HttpContext.Response.Headers.Add("X-ServiceFabric", "ResourceNotFound");
}
}