Azure.Provisioning.FrontDoor
1.0.0-beta.1
Prefix Reserved
dotnet add package Azure.Provisioning.FrontDoor --version 1.0.0-beta.1
NuGet\Install-Package Azure.Provisioning.FrontDoor -Version 1.0.0-beta.1
<PackageReference Include="Azure.Provisioning.FrontDoor" Version="1.0.0-beta.1" />
<PackageVersion Include="Azure.Provisioning.FrontDoor" Version="1.0.0-beta.1" />
<PackageReference Include="Azure.Provisioning.FrontDoor" />
paket add Azure.Provisioning.FrontDoor --version 1.0.0-beta.1
#r "nuget: Azure.Provisioning.FrontDoor, 1.0.0-beta.1"
#:package Azure.Provisioning.FrontDoor@1.0.0-beta.1
#addin nuget:?package=Azure.Provisioning.FrontDoor&version=1.0.0-beta.1&prerelease
#tool nuget:?package=Azure.Provisioning.FrontDoor&version=1.0.0-beta.1&prerelease
Azure Provisioning FrontDoor client library for .NET
Azure.Provisioning.FrontDoor simplifies declarative resource provisioning in .NET.
Getting started
Install the package
Install the client library for .NET with NuGet:
dotnet add package Azure.Provisioning.FrontDoor --prerelease
Prerequisites
You must have an Azure subscription.
Authenticate the Client
Key concepts
This library allows you to specify your infrastructure in a declarative style using dotnet. You can then use azd to deploy your infrastructure to Azure directly without needing to write or maintain bicep or arm templates.
Examples
Create a basic Front Door
This template creates a basic Front Door configuration with a single backend, single default path match /* and no custom domain.
Infrastructure infra = new();
ProvisioningParameter frontDoorName =
new(nameof(frontDoorName), typeof(string))
{
Description = "The name of the frontdoor resource."
};
infra.Add(frontDoorName);
ProvisioningParameter backendAddress =
new(nameof(backendAddress), typeof(string))
{
Description = "The hostname of the backend. Must be an IP address or FQDN."
};
infra.Add(backendAddress);
ProvisioningVariable frontEndEndpointName =
new(nameof(frontEndEndpointName), typeof(string))
{
Value = "frontEndEndpoint"
};
infra.Add(frontEndEndpointName);
ProvisioningVariable loadBalancingSettingsName =
new(nameof(loadBalancingSettingsName), typeof(string))
{
Value = "loadBalancingSettings"
};
infra.Add(loadBalancingSettingsName);
ProvisioningVariable healthProbeSettingsName =
new(nameof(healthProbeSettingsName), typeof(string))
{
Value = "healthProbeSettings"
};
infra.Add(healthProbeSettingsName);
ProvisioningVariable routingRuleName =
new(nameof(routingRuleName), typeof(string))
{
Value = "routingRule"
};
infra.Add(routingRuleName);
ProvisioningVariable backendPoolName =
new(nameof(backendPoolName), typeof(string))
{
Value = "backendPool"
};
infra.Add(backendPoolName);
FrontDoorResource frontDoor =
new(nameof(frontDoor), FrontDoorResource.ResourceVersions.V2021_06_01)
{
Name = frontDoorName,
Location = new AzureLocation("global"),
EnabledState = FrontDoorEnabledState.Enabled,
FrontendEndpoints =
{
new FrontendEndpointData
{
Name = frontEndEndpointName,
HostName = BicepFunction.Interpolate($"{frontDoorName}.azurefd.net"),
SessionAffinityEnabledState = SessionAffinityEnabledState.Disabled
}
},
LoadBalancingSettings =
{
new FrontDoorLoadBalancingSettingsData
{
Name = loadBalancingSettingsName,
SampleSize = 4,
SuccessfulSamplesRequired = 2
}
},
HealthProbeSettings =
{
new FrontDoorHealthProbeSettingsData
{
Name = healthProbeSettingsName,
Path = "/",
Protocol = FrontDoorProtocol.Http,
IntervalInSeconds = 120
}
},
BackendPools =
{
new FrontDoorBackendPool
{
Name = backendPoolName,
Backends =
{
new FrontDoorBackend
{
Address = backendAddress,
BackendHostHeader = backendAddress,
HttpPort = 80,
HttpsPort = 443,
Weight = 50,
Priority = 1,
EnabledState = BackendEnabledState.Enabled
}
},
LoadBalancingSettingsId = new FunctionCallExpression(new IdentifierExpression("resourceId"), new StringLiteralExpression("Microsoft.Network/frontDoors/loadBalancingSettings"), new IdentifierExpression(frontDoorName.BicepIdentifier), new IdentifierExpression(loadBalancingSettingsName.BicepIdentifier)),
HealthProbeSettingsId = new FunctionCallExpression(new IdentifierExpression("resourceId"), new StringLiteralExpression("Microsoft.Network/frontDoors/healthProbeSettings"), new IdentifierExpression(frontDoorName.BicepIdentifier), new IdentifierExpression(healthProbeSettingsName.BicepIdentifier))
}
},
RoutingRules =
{
new RoutingRuleData
{
Name = routingRuleName,
FrontendEndpoints =
{
new WritableSubResource
{
Id = new FunctionCallExpression(new IdentifierExpression("resourceId"), new StringLiteralExpression("Microsoft.Network/frontDoors/frontEndEndpoints"), new IdentifierExpression(frontDoorName.BicepIdentifier), new IdentifierExpression(frontEndEndpointName.BicepIdentifier))
}
},
AcceptedProtocols = { FrontDoorProtocol.Http, FrontDoorProtocol.Https },
PatternsToMatch = { "/*" },
RouteConfiguration = new ForwardingConfiguration
{
ForwardingProtocol = FrontDoorForwardingProtocol.MatchRequest,
BackendPoolId = new FunctionCallExpression(new IdentifierExpression("resourceId"), new StringLiteralExpression("Microsoft.Network/frontDoors/backEndPools"), new IdentifierExpression(frontDoorName.BicepIdentifier), new IdentifierExpression(backendPoolName.BicepIdentifier))
},
EnabledState = RoutingRuleEnabledState.Enabled
}
}
};
infra.Add(frontDoor);
infra.Add(new ProvisioningOutput("name", typeof(string)) { Value = new MemberExpression(new IdentifierExpression( frontDoor.BicepIdentifier), "name") }); // TODO -- update this to use the expression conversion
infra.Add(new ProvisioningOutput("resourceGroupName", typeof(string)) { Value = BicepFunction.GetResourceGroup().Name });
infra.Add(new ProvisioningOutput("resourceId", typeof(string)) { Value = frontDoor.Id });
Create a Front Door with HTTP to HTTPS redirection
This template creates a basic Front Door configuration for HTTP to HTTPS redirection, single default path match '/*' and no custom domain.
Infrastructure infra = new();
ProvisioningParameter frontDoorName =
new(nameof(frontDoorName), typeof(string))
{
Description = "The name of the frontdoor resource."
};
infra.Add(frontDoorName);
ProvisioningParameter backendAddress =
new(nameof(backendAddress), typeof(string))
{
Description = "The hostname of the backend. Must be an IP address or FQDN."
};
infra.Add(backendAddress);
FrontDoorResource frontDoor =
new(nameof(frontDoor), FrontDoorResource.ResourceVersions.V2020_05_01)
{
Name = frontDoorName,
Location = new AzureLocation("global"),
EnabledState = FrontDoorEnabledState.Enabled,
FrontendEndpoints =
{
new FrontendEndpointData
{
Name = "frontendEndpoint1",
HostName = BicepFunction.Interpolate($"{frontDoorName}.azurefd.net"),
SessionAffinityEnabledState = SessionAffinityEnabledState.Disabled
}
},
LoadBalancingSettings =
{
new FrontDoorLoadBalancingSettingsData
{
Name = "loadBalancingSettings1",
SampleSize = 4,
SuccessfulSamplesRequired = 2
}
},
HealthProbeSettings =
{
new FrontDoorHealthProbeSettingsData
{
Name = "healthProbeSettings1",
Path = "/",
Protocol = FrontDoorProtocol.Http,
IntervalInSeconds = 120
}
},
BackendPools =
{
new FrontDoorBackendPool
{
Name = "backendPool1",
Backends =
{
new FrontDoorBackend
{
Address = backendAddress,
BackendHostHeader = backendAddress,
HttpPort = 80,
HttpsPort = 443,
Weight = 50,
Priority = 1,
EnabledState = BackendEnabledState.Enabled
}
},
LoadBalancingSettingsId = new FunctionCallExpression(new IdentifierExpression("resourceId"), new StringLiteralExpression("Microsoft.Network/frontDoors/loadBalancingSettings"), new IdentifierExpression(frontDoorName.BicepIdentifier), new StringLiteralExpression("loadBalancingSettings1")),
HealthProbeSettingsId = new FunctionCallExpression(new IdentifierExpression("resourceId"), new StringLiteralExpression("Microsoft.Network/frontDoors/healthProbeSettings"), new IdentifierExpression(frontDoorName.BicepIdentifier), new StringLiteralExpression("healthProbeSettings1"))
}
},
RoutingRules =
{
new RoutingRuleData
{
Name = "httptohttps",
FrontendEndpoints =
{
new WritableSubResource
{
Id = new FunctionCallExpression(new IdentifierExpression("resourceId"), new StringLiteralExpression("Microsoft.Network/frontDoors/frontendEndpoints"), new IdentifierExpression(frontDoorName.BicepIdentifier), new StringLiteralExpression("frontendEndpoint1"))
}
},
AcceptedProtocols = { FrontDoorProtocol.Http },
PatternsToMatch = { "/*" },
RouteConfiguration = new RedirectConfiguration
{
RedirectProtocol = FrontDoorRedirectProtocol.HttpsOnly,
RedirectType = FrontDoorRedirectType.Moved
},
EnabledState = RoutingRuleEnabledState.Enabled
}
}
};
infra.Add(frontDoor);
Troubleshooting
- File an issue via GitHub Issues.
- Check previous questions or ask new ones on Stack Overflow using Azure and .NET tags.
Next steps
Contributing
For details on contributing to this repository, see the contributing guide.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (for example, label, comment). Follow the instructions provided by the bot. You'll only need to do this action once across all repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any other questions or comments.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Azure.Core (>= 1.49.0)
- Azure.Provisioning (>= 1.3.0)
-
net8.0
- Azure.Core (>= 1.49.0)
- Azure.Provisioning (>= 1.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-beta.1 | 156 | 10/17/2025 |