Skip to content

Commit d36fed9

Browse files
Support all bicep parameter types (Azure#43844)
* Support all bicep parameter types * Support outputs * Fix typing of Value * fix build * Add apicompat and readme * new files * fix hyperlink * EBN * pr fb * Fix property names * parameter names * outputtype * remove isLiteral
1 parent 59b5bcc commit d36fed9

File tree

82 files changed

+964
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+964
-104
lines changed

eng/.docsettings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ known_content_issues:
104104
- ['sdk/eventhub/README.md','Not a package: azure-sdk-tools/issues/42']
105105
- ['sdk/extensions/README.md','Not a package: azure-sdk-tools/issues/42']
106106
- ['sdk/personalizer/README.md','Not a package: azure-sdk-tools/issues/42']
107+
- ['sdk/provisioning/README.md','Not a package: azure-sdk-tools/issues/42']
107108
- ['sdk/search/README.md','Not a package: azure-sdk-tools/issues/42']
108109
- ['sdk/storage/README.md','Not a package: azure-sdk-tools/issues/42']
109110

sdk/provisioning/Azure.Provisioning.AppConfiguration/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Release History
22

3+
## 0.2.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
12+
313
## 0.1.0 (2024-04-24)
414

515
### Features Added

sdk/provisioning/Azure.Provisioning.AppConfiguration/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ First create your Infrastructure class.
3131
```C# Snippet:SampleInfrastructure
3232
public class SampleInfrastructure : Infrastructure
3333
{
34+
public SampleInfrastructure() : base(envName: "Sample", tenantId: Guid.Empty, subscriptionId: Guid.Empty, configuration: new Configuration { UseInteractiveMode = true })
35+
{
36+
}
3437
}
3538
```
3639

@@ -43,7 +46,7 @@ var infrastructure = new SampleInfrastructure();
4346
// Add a new key vault
4447
var keyVault = infrastructure.AddKeyVault();
4548

46-
// You can call Build to convert the infrastructure into bicep files
49+
// You can call Build to convert the infrastructure into bicep files.
4750
infrastructure.Build();
4851
```
4952

sdk/provisioning/Azure.Provisioning.AppConfiguration/src/Azure.Provisioning.AppConfiguration.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
<PropertyGroup>
44
<Description>Azure.Provisioning.AppConfiguration simplifies declarative resource provisioning in .NET for Azure App Configuration.</Description>
5-
<Version>0.1.0</Version>
5+
<Version>0.2.0-beta.1</Version>
6+
<ApiCompatVersion>0.1.0</ApiCompatVersion>
67
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
78
<Nullable>enable</Nullable>
89
</PropertyGroup>

sdk/provisioning/Azure.Provisioning.AppConfiguration/tests/AppConfigTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ public async Task AppConfiguration()
2020
{
2121
var infra = new TestInfrastructure();
2222
var appConfig = new AppConfigurationStore(infra, "standard");
23+
appConfig.AssignProperty(a => a.DisableLocalAuth, new Parameter("disableLocalAuth", BicepType.Bool, defaultValue: false));
24+
appConfig.AssignProperty(a => a.SoftDeleteRetentionInDays, new Parameter("retention", BicepType.Int, defaultValue: 5));
25+
appConfig.AssignProperty(a => a.PrivateEndpointConnections,
26+
new Parameter(
27+
"privateEndpointConnections",
28+
BicepType.Array,
29+
defaultValue: "[{ 'properties': { " + Environment.NewLine +
30+
"'provisioningState': 'Succeeded'" + Environment.NewLine +
31+
"'privateLinkServiceConnectionState': { 'status': 'Approved', 'description': 'Approved', 'actionsRequired': 'None' }" + Environment.NewLine +
32+
" } }]"));
2333
appConfig.AssignRole(RoleDefinition.AppConfigurationDataOwner, Guid.Empty);
2434
infra.Build(GetOutputPath());
2535

sdk/provisioning/Azure.Provisioning.AppConfiguration/tests/Infrastructure/AppConfiguration/main.bicep

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
targetScope = 'subscription'
22

3+
@description('')
4+
param disableLocalAuth bool = false
5+
6+
@description('')
7+
param retention int = 5
8+
9+
@description('')
10+
param privateEndpointConnections array = [{ 'properties': {
11+
'provisioningState': 'Succeeded'
12+
'privateLinkServiceConnectionState': { 'status': 'Approved', 'description': 'Approved', 'actionsRequired': 'None' }
13+
} }]
14+
315

416
resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
517
name: 'rg-TEST'
@@ -12,4 +24,9 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'
1224
module rg_TEST_module './resources/rg_TEST_module/rg_TEST_module.bicep' = {
1325
name: 'rg_TEST_module'
1426
scope: resourceGroup_I6QNkoPsb
27+
params: {
28+
disableLocalAuth: disableLocalAuth
29+
retention: retention
30+
privateEndpointConnections: privateEndpointConnections
31+
}
1532
}

sdk/provisioning/Azure.Provisioning.AppConfiguration/tests/Infrastructure/AppConfiguration/resources/rg_TEST_module/rg_TEST_module.bicep

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
@description('')
2+
param disableLocalAuth bool = false
3+
4+
@description('')
5+
param retention int = 5
6+
7+
@description('')
8+
param privateEndpointConnections array = [{ 'properties': {
9+
'provisioningState': 'Succeeded'
10+
'privateLinkServiceConnectionState': { 'status': 'Approved', 'description': 'Approved', 'actionsRequired': 'None' }
11+
} }]
12+
113

214
resource appConfigurationStore_6Q8NF0lPF 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
315
name: toLower(take('store${uniqueString(resourceGroup().id)}', 24))
@@ -6,6 +18,9 @@ resource appConfigurationStore_6Q8NF0lPF 'Microsoft.AppConfiguration/configurati
618
name: 'standard'
719
}
820
properties: {
21+
privateEndpointConnections: privateEndpointConnections
22+
disableLocalAuth: disableLocalAuth
23+
softDeleteRetentionInDays: retention
924
}
1025
}
1126

sdk/provisioning/Azure.Provisioning.ApplicationInsights/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Release History
22

3+
## 0.2.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
12+
313
## 0.1.0 (2024-04-30)
414

515
### Features Added

sdk/provisioning/Azure.Provisioning.ApplicationInsights/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ First create your Infrastructure class.
3131
```C# Snippet:SampleInfrastructure
3232
public class SampleInfrastructure : Infrastructure
3333
{
34+
public SampleInfrastructure() : base(envName: "Sample", tenantId: Guid.Empty, subscriptionId: Guid.Empty, configuration: new Configuration { UseInteractiveMode = true })
35+
{
36+
}
3437
}
3538
```
3639

@@ -43,7 +46,7 @@ var infrastructure = new SampleInfrastructure();
4346
// Add a new key vault
4447
var keyVault = infrastructure.AddKeyVault();
4548

46-
// You can call Build to convert the infrastructure into bicep files
49+
// You can call Build to convert the infrastructure into bicep files.
4750
infrastructure.Build();
4851
```
4952

sdk/provisioning/Azure.Provisioning.ApplicationInsights/src/Azure.Provisioning.ApplicationInsights.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
<PropertyGroup>
44
<Description>Azure.Provisioning.ApplicationInsights simplifies declarative resource provisioning in .NET for Azure Application Insights.</Description>
5-
<Version>0.1.0</Version>
5+
<Version>0.2.0-beta.1</Version>
6+
<ApiCompatVersion>0.1.0</ApiCompatVersion>
67
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
8+
<NoWarn>$(NoWarn);AZC0001</NoWarn>
79
</PropertyGroup>
810

911
<ItemGroup>

sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Release History
22

3+
## 0.2.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
12+
313
## 0.1.0 (2024-04-24)
414

515
### Features Added

sdk/provisioning/Azure.Provisioning.CognitiveServices/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ First create your Infrastructure class.
3131
```C# Snippet:SampleInfrastructure
3232
public class SampleInfrastructure : Infrastructure
3333
{
34+
public SampleInfrastructure() : base(envName: "Sample", tenantId: Guid.Empty, subscriptionId: Guid.Empty, configuration: new Configuration { UseInteractiveMode = true })
35+
{
36+
}
3437
}
3538
```
3639

@@ -43,7 +46,7 @@ var infrastructure = new SampleInfrastructure();
4346
// Add a new key vault
4447
var keyVault = infrastructure.AddKeyVault();
4548

46-
// You can call Build to convert the infrastructure into bicep files
49+
// You can call Build to convert the infrastructure into bicep files.
4750
infrastructure.Build();
4851
```
4952

sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
<PropertyGroup>
44
<Description>Azure.Provisioning.CognitiveServices simplifies declarative resource provisioning in .NET for Azure Cognitive Services.</Description>
5-
<Version>0.1.0</Version>
5+
<Version>0.2.0-beta.1</Version>
6+
<ApiCompatVersion>0.1.0</ApiCompatVersion>
67
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
78
</PropertyGroup>
89

sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Release History
22

3+
## 0.2.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
12+
313
## 0.1.0 (2024-04-24)
414

515
### Features Added

sdk/provisioning/Azure.Provisioning.CosmosDB/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ First create your Infrastructure class.
3131
```C# Snippet:SampleInfrastructure
3232
public class SampleInfrastructure : Infrastructure
3333
{
34+
public SampleInfrastructure() : base(envName: "Sample", tenantId: Guid.Empty, subscriptionId: Guid.Empty, configuration: new Configuration { UseInteractiveMode = true })
35+
{
36+
}
3437
}
3538
```
3639

@@ -43,7 +46,7 @@ var infrastructure = new SampleInfrastructure();
4346
// Add a new key vault
4447
var keyVault = infrastructure.AddKeyVault();
4548

46-
// You can call Build to convert the infrastructure into bicep files
49+
// You can call Build to convert the infrastructure into bicep files.
4750
infrastructure.Build();
4851
```
4952

sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
<PropertyGroup>
44
<Description>Azure.Provisioning.CosmosDB simplifies declarative resource provisioning in .NET for Azure CosmosDB.</Description>
5-
<Version>0.1.0</Version>
5+
<Version>0.2.0-beta.1</Version>
6+
<ApiCompatVersion>0.1.0</ApiCompatVersion>
67
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
78
</PropertyGroup>
89

sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Release History
22

3+
## 0.2.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
12+
313
## 0.1.0 (2024-04-24)
414

515
### Features Added

sdk/provisioning/Azure.Provisioning.EventHubs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ First create your Infrastructure class.
3131
```C# Snippet:SampleInfrastructure
3232
public class SampleInfrastructure : Infrastructure
3333
{
34+
public SampleInfrastructure() : base(envName: "Sample", tenantId: Guid.Empty, subscriptionId: Guid.Empty, configuration: new Configuration { UseInteractiveMode = true })
35+
{
36+
}
3437
}
3538
```
3639

@@ -43,7 +46,7 @@ var infrastructure = new SampleInfrastructure();
4346
// Add a new key vault
4447
var keyVault = infrastructure.AddKeyVault();
4548

46-
// You can call Build to convert the infrastructure into bicep files
49+
// You can call Build to convert the infrastructure into bicep files.
4750
infrastructure.Build();
4851
```
4952

sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
<PropertyGroup>
44
<Description>Azure.Provisioning.EventHubs simplifies declarative resource provisioning in .NET for Azure Event Hubs.</Description>
5-
<Version>0.1.0</Version>
5+
<Version>0.2.0-beta.1</Version>
6+
<ApiCompatVersion>0.1.0</ApiCompatVersion>
67
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
78
</PropertyGroup>
89

sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Release History
22

3+
## 0.2.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
12+
313
## 0.1.0 (2024-04-24)
414

515
### Features Added

sdk/provisioning/Azure.Provisioning.KeyVault/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ First create your Infrastructure class.
3131
```C# Snippet:SampleInfrastructure
3232
public class SampleInfrastructure : Infrastructure
3333
{
34+
public SampleInfrastructure() : base(envName: "Sample", tenantId: Guid.Empty, subscriptionId: Guid.Empty, configuration: new Configuration { UseInteractiveMode = true })
35+
{
36+
}
3437
}
3538
```
3639

@@ -43,7 +46,7 @@ var infrastructure = new SampleInfrastructure();
4346
// Add a new key vault
4447
var keyVault = infrastructure.AddKeyVault();
4548

46-
// You can call Build to convert the infrastructure into bicep files
49+
// You can call Build to convert the infrastructure into bicep files.
4750
infrastructure.Build();
4851
```
4952

sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
<PropertyGroup>
44
<Description>Azure.Provisioning.KeyVault simplifies declarative resource provisioning in .NET for Azure Key Vault.</Description>
5-
<Version>0.1.0</Version>
5+
<Version>0.2.0-beta.1</Version>
6+
<ApiCompatVersion>0.1.0</ApiCompatVersion>
67
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
78
</PropertyGroup>
89

sdk/provisioning/Azure.Provisioning.KeyVault/src/KeyVaultAddAccessPolicy.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@ public KeyVaultAddAccessPolicy(IConstruct scope, Parameter principalIdParameter,
3838
AssignProperty(p => p.AccessPolicies[0].TenantId, Tenant.TenantIdExpression);
3939
}
4040

41-
private static string GetParamValue(Parameter principalIdParameter, IConstruct scope)
42-
{
43-
if (principalIdParameter.Source is null || ReferenceEquals(principalIdParameter.Source, scope))
44-
{
45-
return principalIdParameter.Value!;
46-
}
47-
else
48-
{
49-
return $"{principalIdParameter.Source.Name}.outputs.{principalIdParameter.Name}";
50-
}
51-
}
52-
5341
protected override Resource? FindParentInScope(IConstruct scope)
5442
{
5543
var result = base.FindParentInScope(scope);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
targetScope = 'resourceGroup'
2+
3+
@description('')
4+
param location string = resourceGroup().location
5+
6+
@description('Enable soft delete for the key vault.')
7+
param enableSoftDelete bool = true
8+
9+
10+
resource keyVault_7LloDNJK5 'Microsoft.KeyVault/vaults@2022-07-01' = {
11+
name: toLower(take('kv${uniqueString(resourceGroup().id)}', 24))
12+
location: location
13+
properties: {
14+
tenantId: '00000000-0000-0000-0000-000000000000'
15+
sku: {
16+
family: 'A'
17+
name: 'standard'
18+
}
19+
enableSoftDelete: enableSoftDelete
20+
enableRbacAuthorization: true
21+
}
22+
}
23+
24+
output VAULT_URI string = keyVault_7LloDNJK5.properties.vaultUri

0 commit comments

Comments
 (0)