Skip to content

Instantly share code, notes, and snippets.

We have continued to research the topic and propose the following alternative solution. We ask Microsoft kindly to verify the solution described below and to inform whether this is an approperiate solution.

Proposed solution
A service principal is configured to create various resources in a subscription. This service principal has to be assigned to the Directory Readers role in the AAD in order to determine the Application Id for a Managed Identity in the context of the deployment process.

The configured “Managed Identity” of the Azure App Service can be registered on the respective Azure SQL database with the following command.

@Rookian
Rookian / depencies.md
Last active July 30, 2019 08:08
Module Dependencies

NOTE: The note content.

[HttpPost]
public ActionResult Test3([BindToPropertyWith(nameof(ViewModel.Command))]Command parameternameDoesNotMatter)
{
return RedirectToAction("Index");
}
@Rookian
Rookian / BindToPropertyWith.cs
Last active May 12, 2016 14:27
BindToPropertyWith
public class BindToPropertyWith : CustomModelBinderAttribute
{
private readonly string _propertyName;
public BindToPropertyWith(string propertyName)
{
_propertyName = propertyName;
}
public override IModelBinder GetBinder()
@Rookian
Rookian / BindAttribute.cs
Created May 12, 2016 14:10
BindAttribute
public ActionResult Test1([Bind(Prefix = nameof(ViewModel.Command))]Command parameternameDoesNotMatter)
{
return RedirectToAction("Index");
}
@Rookian
Rookian / Controller.cs
Last active May 12, 2016 14:09
Binding
public ActionResult Test(Command command)
{
return RedirectToAction("Index");
}
@Rookian
Rookian / Razor.cshtml
Created May 12, 2016 14:08
Razor View
@using (Html.BeginForm("Test", "Home", FormMethod.Post))
{
@Html.TextBoxFor(x => x.Command.Name)
@Html.HiddenFor(x => x.Command.Id)
<input type="submit" value="Submit"/>
}
@Rookian
Rookian / ViewModel.cs
Created May 12, 2016 14:08
ViewModel and InputModel
public class ViewModel
{
// POST values
public Command Command { get; set; }
// Read-only values
public string Name { get; set; }
}
public class Command // or InputModel
@Rookian
Rookian / gist:7c5f559f9b4e36ca7dbb069d7a675e0a
Last active May 12, 2016 14:18
ViewModel with inheritance
public class ViewModel : InputModel
{
public bool ShowSaveButton { get; set; }
public string Customer { get; set; }
}
@Rookian
Rookian / gist:c30128591f3986e2c38c
Created August 28, 2014 21:12
EF AutoMapper Proxy Tests:
using System.Data.Entity;
using System.Linq;
using AutoMapper;
namespace EFTests
{
public class Program
{
public static void Main()
{