Skip to content

Commit aaf2e9b

Browse files
committed
Update docs metadata
1 parent 8827dfc commit aaf2e9b

File tree

2 files changed

+153
-9
lines changed

2 files changed

+153
-9
lines changed

api/overview/azure/latest/provisioning-readme.md

Lines changed: 147 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Azure Provisioning client library for .NET
33
keywords: Azure, dotnet, SDK, API, Azure.Provisioning, provisioning
4-
ms.date: 07/14/2025
4+
ms.date: 08/01/2025
55
ms.topic: reference
66
ms.devlang: dotnet
77
ms.service: provisioning
88
---
9-
# Azure Provisioning client library for .NET - version 1.2.1
9+
# Azure Provisioning client library for .NET - version 1.3.0
1010

1111

1212
Azure.Provisioning makes it easy to declaratively specify Azure infrastructure natively in .NET.
@@ -31,6 +31,150 @@ dotnet add package Azure.Provisioning
3131

3232
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.
3333

34+
## Examples
35+
36+
### Create Basic Infrastructure
37+
38+
This example demonstrates how to create basic Azure infrastructure using the Azure Provisioning framework, including a storage account with blob services and output values.
39+
40+
```C# Snippet:ProvisioningBasic
41+
Infrastructure infra = new();
42+
43+
// Create a storage account and blob resources
44+
StorageAccount storage =
45+
new(nameof(storage), StorageAccount.ResourceVersions.V2023_01_01)
46+
{
47+
Kind = StorageKind.StorageV2,
48+
Sku = new StorageSku { Name = StorageSkuName.StandardLrs },
49+
IsHnsEnabled = true,
50+
AllowBlobPublicAccess = false
51+
};
52+
infra.Add(storage);
53+
blobs = new(nameof(blobs)) { Parent = storage };
54+
infra.Add(blobs);
55+
56+
// Grab the endpoint
57+
endpoint = new ProvisioningOutput("blobs_endpoint", typeof(string)) { Value = storage.PrimaryEndpoints.BlobUri };
58+
infra.Add(endpoint);
59+
```
60+
61+
### Create A Container App Environment
62+
63+
This example shows how to create a complete container application environment with managed identity, container registry, log analytics workspace, and container app environment with the Aspire dashboard.
64+
65+
```C# Snippet:ProvisioningContainerApp
66+
Infrastructure infra = new();
67+
68+
ProvisioningParameter principalId = new(nameof(principalId), typeof(string)) { Value = "" };
69+
infra.Add(principalId);
70+
71+
ProvisioningParameter tags = new(nameof(tags), typeof(object)) { Value = new BicepDictionary<string>() };
72+
infra.Add(tags);
73+
74+
UserAssignedIdentity mi =
75+
new(nameof(mi))
76+
{
77+
Tags = tags,
78+
};
79+
infra.Add(mi);
80+
81+
ContainerRegistryService acr =
82+
new(nameof(acr))
83+
{
84+
Sku = new ContainerRegistrySku() { Name = ContainerRegistrySkuName.Basic },
85+
Tags = tags,
86+
Identity =
87+
new ManagedServiceIdentity
88+
{
89+
ManagedServiceIdentityType = ManagedServiceIdentityType.SystemAssignedUserAssigned,
90+
UserAssignedIdentities =
91+
{
92+
// TODO: Decide if we want to invest in a less janky way to use expressions as keys
93+
{ BicepFunction.Interpolate($"{mi.Id}").Compile().ToString(), new UserAssignedIdentityDetails() }
94+
}
95+
}
96+
};
97+
infra.Add(acr);
98+
99+
RoleAssignment pullAssignment = acr.CreateRoleAssignment(ContainerRegistryBuiltInRole.AcrPull, mi);
100+
infra.Add(pullAssignment);
101+
102+
OperationalInsightsWorkspace law =
103+
new(nameof(law))
104+
{
105+
Sku = new OperationalInsightsWorkspaceSku() { Name = OperationalInsightsWorkspaceSkuName.PerGB2018 },
106+
Tags = tags,
107+
};
108+
infra.Add(law);
109+
110+
ContainerAppManagedEnvironment cae =
111+
new(nameof(cae))
112+
{
113+
WorkloadProfiles =
114+
{
115+
new ContainerAppWorkloadProfile()
116+
{
117+
Name = "consumption",
118+
WorkloadProfileType = "Consumption"
119+
}
120+
},
121+
AppLogsConfiguration =
122+
new ContainerAppLogsConfiguration()
123+
{
124+
Destination = "log-analytics",
125+
LogAnalyticsConfiguration = new ContainerAppLogAnalyticsConfiguration()
126+
{
127+
CustomerId = law.CustomerId,
128+
SharedKey = law.GetKeys().PrimarySharedKey,
129+
}
130+
},
131+
Tags = tags,
132+
};
133+
infra.Add(cae);
134+
135+
RoleAssignment contribAssignment = cae.CreateRoleAssignment(AppContainersBuiltInRole.Contributor, mi);
136+
infra.Add(contribAssignment);
137+
138+
// Hack in the Aspire Dashboard as a literal since there's no
139+
// management plane library support for dotNetComponents yet
140+
BicepLiteral aspireDashboard =
141+
new(
142+
new ResourceStatement(
143+
"aspireDashboard",
144+
new StringLiteralExpression("Microsoft.App/managedEnvironments/dotNetComponents@2024-02-02-preview"),
145+
new ObjectExpression(
146+
new PropertyExpression("name", "aspire-dashboard"),
147+
new PropertyExpression("parent", new IdentifierExpression(cae.BicepIdentifier)),
148+
new PropertyExpression("properties",
149+
new ObjectExpression(
150+
new PropertyExpression("componentType", new StringLiteralExpression("AspireDashboard")))))));
151+
infra.Add(aspireDashboard);
152+
153+
infra.Add(new ProvisioningOutput("MANAGED_IDENTITY_CLIENT_ID", typeof(string)) { Value = mi.ClientId });
154+
infra.Add(new ProvisioningOutput("MANAGED_IDENTITY_NAME", typeof(string)) { Value = mi.Name });
155+
infra.Add(new ProvisioningOutput("MANAGED_IDENTITY_PRINCIPAL_ID", typeof(string)) { Value = mi.PrincipalId });
156+
infra.Add(new ProvisioningOutput("LOG_ANALYTICS_WORKSPACE_NAME", typeof(string)) { Value = law.Name });
157+
infra.Add(new ProvisioningOutput("LOG_ANALYTICS_WORKSPACE_ID", typeof(string)) { Value = law.Id });
158+
infra.Add(new ProvisioningOutput("AZURE_CONTAINER_REGISTRY_ENDPOINT", typeof(string)) { Value = acr.LoginServer });
159+
infra.Add(new ProvisioningOutput("AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID", typeof(string)) { Value = mi.Id });
160+
infra.Add(new ProvisioningOutput("AZURE_CONTAINER_APPS_ENVIRONMENT_NAME", typeof(string)) { Value = cae.Name });
161+
infra.Add(new ProvisioningOutput("AZURE_CONTAINER_APPS_ENVIRONMENT_ID", typeof(string)) { Value = cae.Id });
162+
infra.Add(new ProvisioningOutput("AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN", typeof(string)) { Value = cae.DefaultDomain });
163+
```
164+
165+
### Create A Resource Group At Subscription Scope
166+
167+
This example demonstrates creating a resource group at the subscription scope, which is useful when you need to manage resource groups themselves as part of your infrastructure.
168+
169+
```C# Snippet:ProvisioningResourceGroup
170+
// Create a new infra group scoped to our subscription and add
171+
// the resource group
172+
Infrastructure infra = new() { TargetScope = DeploymentScope.Subscription };
173+
174+
ResourceGroup rg = new("rg_test", "2024-03-01");
175+
infra.Add(rg);
176+
```
177+
34178
## Troubleshooting
35179

36180
- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues).
@@ -59,7 +203,7 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact
59203
<[email protected]> with any other questions or comments.
60204

61205
<!-- LINKS -->
62-
[cg]: https://github.com/Azure/azure-sdk-for-net/blob/Azure.Provisioning_1.2.1/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md
206+
[cg]: https://github.com/Azure/azure-sdk-for-net/blob/Azure.Provisioning_1.3.0/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md
63207
[coc]: https://opensource.microsoft.com/codeofconduct/
64208
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
65209

metadata/latest/Azure.Provisioning.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name": "Azure.Provisioning",
3-
"Version": "1.2.1",
3+
"Version": "1.3.0",
44
"DevVersion": null,
55
"DirectoryPath": "sdk/provisioning/Azure.Provisioning",
66
"ServiceDirectory": "provisioning",
@@ -10,21 +10,21 @@
1010
"SdkType": "mgmt",
1111
"IsNewSdk": true,
1212
"ArtifactName": "Azure.Provisioning",
13-
"ReleaseStatus": "2025-07-09",
13+
"ReleaseStatus": "2025-08-01",
1414
"IncludedForValidation": false,
1515
"AdditionalValidationPackages": null,
1616
"ArtifactDetails": {
1717
"name": "Azure.Provisioning",
18+
"safeName": "AzureProvisioning",
1819
"triggeringPaths": [
1920
"/sdk/provisioning/ci.compute.yml"
20-
],
21-
"safeName": "AzureProvisioning"
21+
]
2222
},
2323
"CIParameters": {
2424
"BuildSnippets": true,
2525
"AOTTestInputs": [],
26-
"CheckAOTCompat": false,
27-
"CIMatrixConfigs": []
26+
"CIMatrixConfigs": [],
27+
"CheckAOTCompat": false
2828
},
2929
"Namespaces": [
3030
"Azure.Provisioning",

0 commit comments

Comments
 (0)