Skip to content

Updated Azure.Provisioning.* to the latest releases (including previews) #50227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,14 @@
"regionality"
]
},
{
"filename": "**/sdk/provisioning/**/*.cs",
"words": [
"Awsec",
"Freemium",
"Mibps"
]
},
{
"filename": "**/sdk/qumulo/**/*",
"words": [
Expand Down
46 changes: 27 additions & 19 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,34 @@
<PackageReference Update="Azure.Storage.Queues" Version="12.21.0" />
<PackageReference Update="Azure.Storage.Files.Shares" Version="12.21.0" />
<PackageReference Update="Azure.Storage.DataMovement" Version="12.0.0" />
<PackageReference Update="Azure.ResourceManager" Version="1.13.0" />
<PackageReference Update="Azure.ResourceManager.AppConfiguration" Version="1.3.2" />
<PackageReference Update="Azure.ResourceManager.ApplicationInsights" Version="1.0.0" />
<PackageReference Update="Azure.ResourceManager.Authorization" Version="1.1.3" />
<PackageReference Update="Azure.ResourceManager" Version="1.13.1" />
<PackageReference Update="Azure.ResourceManager.AppConfiguration" Version="1.4.0" />
<PackageReference Update="Azure.ResourceManager.AppContainers" Version="1.4.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.ApplicationInsights" Version="1.0.1" />
<PackageReference Update="Azure.ResourceManager.AppService" Version="1.3.0" />
<PackageReference Update="Azure.ResourceManager.Authorization" Version="1.1.4" />
<PackageReference Update="Azure.ResourceManager.Batch" Version="1.4.0" />
<PackageReference Update="Azure.ResourceManager.CognitiveServices" Version="1.3.3" />
<PackageReference Update="Azure.ResourceManager.CosmosDB" Version="1.4.0-beta.9" />
<PackageReference Update="Azure.ResourceManager.CognitiveServices" Version="1.4.0" />
<PackageReference Update="Azure.ResourceManager.Communication" Version="1.2.1" />
<PackageReference Update="Azure.ResourceManager.ContainerRegistry" Version="1.3.0" />
<PackageReference Update="Azure.ResourceManager.ContainerService" Version="1.2.3" />
<PackageReference Update="Azure.ResourceManager.CosmosDB" Version="1.4.0-beta.12" />
<PackageReference Update="Azure.ResourceManager.EventGrid" Version="1.1.0" />
<PackageReference Update="Azure.ResourceManager.EventHubs" Version="1.2.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.KeyVault" Version="1.2.3" />
<PackageReference Update="Azure.ResourceManager.ManagedServiceIdentities" Version="1.2.3" />
<PackageReference Update="Azure.ResourceManager.OperationalInsights" Version="1.2.2" />
<PackageReference Update="Azure.ResourceManager.PostgreSql" Version="1.2.0-beta.6" />
<PackageReference Update="Azure.ResourceManager.Redis" Version="1.4.0" />
<PackageReference Update="Azure.ResourceManager.Resources" Version="1.7.3" />
<PackageReference Update="Azure.ResourceManager.Search" Version="1.3.0-beta.3" />
<PackageReference Update="Azure.ResourceManager.ServiceBus" Version="1.1.0-beta.7" />
<PackageReference Update="Azure.ResourceManager.WebPubSub" Version="1.2.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.SignalR" Version="1.1.2" />
<PackageReference Update="Azure.ResourceManager.Sql" Version="1.3.0-beta.8" />
<PackageReference Update="Azure.ResourceManager.Storage" Version="1.2.3" />
<PackageReference Update="Azure.ResourceManager.KeyVault" Version="1.3.2" />
<PackageReference Update="Azure.ResourceManager.Kubernetes" Version="1.0.0-beta.5" />
<PackageReference Update="Azure.ResourceManager.KubernetesConfiguration" Version="1.2.0" />
<PackageReference Update="Azure.ResourceManager.ManagedServiceIdentities" Version="1.3.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.OperationalInsights" Version="1.3.0" />
<PackageReference Update="Azure.ResourceManager.PostgreSql" Version="1.2.0" />
<PackageReference Update="Azure.ResourceManager.Redis" Version="1.5.0" />
<PackageReference Update="Azure.ResourceManager.Resources" Version="1.9.1" />
<PackageReference Update="Azure.ResourceManager.Search" Version="1.3.0-beta.5" />
<PackageReference Update="Azure.ResourceManager.ServiceBus" Version="1.1.0" />
<PackageReference Update="Azure.ResourceManager.WebPubSub" Version="1.2.0-beta.2" />
<PackageReference Update="Azure.ResourceManager.SignalR" Version="1.1.3" />
<PackageReference Update="Azure.ResourceManager.Sql" Version="1.3.0" />
<PackageReference Update="Azure.ResourceManager.Storage" Version="1.4.2" />

<!-- CDK -->
<PackageReference Update="Azure.Provisioning" Version="1.0.0" />
Expand Down Expand Up @@ -304,7 +312,7 @@
<PackageReference Update="Azure.Messaging.EventGrid" Version="4.17.0" />
<PackageReference Update="Azure.Messaging.EventHubs.Processor" Version="5.12.0" />
<PackageReference Update="Azure.Messaging.ServiceBus" Version="7.19.0" />
<PackageReference Update="Azure.ResourceManager" Version="1.13.0" />
<PackageReference Update="Azure.ResourceManager" Version="1.13.1" />
<PackageReference Update="Azure.ResourceManager.Compute" Version="1.9.0" />
<PackageReference Update="Azure.ResourceManager.CognitiveServices" Version="1.3.0" />
<PackageReference Update="Azure.ResourceManager.ContainerService" Version="1.2.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public AppConfigurationFeature()

protected internal override void EmitConstructs(ProjectInfrastructure infrastructure)
{
AppConfigurationStore appConfigResource = new("appConfiguration")
AppConfigurationStore appConfigResource = new("appConfiguration", AppConfigurationStore.ResourceVersions.V2024_05_01)
{
Name = infrastructure.ProjectId,
SkuName = Sku.ToString(),
Expand Down Expand Up @@ -80,7 +80,7 @@ protected internal override void EmitConstructs(ProjectInfrastructure infrastruc
if (_bicepIdentifier == null) _bicepIdentifier = store.BicepIdentifier + "_setting";

string bicepIdentifier = infrastructure.Features.CreateUniqueBicepIdentifier(_bicepIdentifier);
AppConfigurationKeyValue kvp = new(bicepIdentifier)
AppConfigurationKeyValue kvp = new(bicepIdentifier, AppConfigurationKeyValue.ResourceVersions.V2024_05_01)
{
Name = Key,
Value = Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ public AppServiceFeature()
protected internal override void EmitConstructs(ProjectInfrastructure infrastructure)
{
//Add a App Service to the infrastructure.
AppServicePlan hostingPlan = new("appServicePlan")
AppServicePlan hostingPlan = new("appServicePlan", AppServicePlan.ResourceVersions.V2024_04_01)
{
Name = infrastructure.ProjectId,
Sku = Sku,
Kind = "app"
};
infrastructure.AddConstruct(Id + "_plan", hostingPlan);

WebSite appService = new("appServiceWebsite")
WebSite appService = new("appServiceWebsite", WebSite.ResourceVersions.V2024_04_01)
{
Name = infrastructure.ProjectId,
Kind = "app",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace Azure.Projects;

internal class EventGridSystemTopicFeature : AzureProjectFeature
{
internal const string EventGridTopicVersion = "2022-06-15";
internal static string EventGridTopicVersion =>
SystemTopic.ResourceVersions.V2022_06_15;

public EventGridSystemTopicFeature(string topicName, StorageAccountFeature source, string topicType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public KeyVaultFeature()
protected internal override void EmitConstructs(ProjectInfrastructure infrastructure)
{
// Add a KeyVault to the infrastructure.
KeyVaultService kv = new("keyVault")
KeyVaultService kv = new("keyVault", KeyVaultService.ResourceVersions.V2023_07_01)
{
Name = infrastructure.ProjectId,
Properties =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ResourceGroupFeature(string? name = default)
protected internal override void EmitConstructs(ProjectInfrastructure infrastructure)
{
string name = (Name == null) ? infrastructure.ProjectId : Name;
var rg = new ResourceGroup(name);
var rg = new ResourceGroup(name, ResourceGroup.ResourceVersions.V2023_07_01);
infrastructure.AddConstruct(Id, rg);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ServiceBusNamespaceFeature(string namespaceName)

protected internal override void EmitConstructs(ProjectInfrastructure infrastructure)
{
var sb = new ServiceBusNamespace("cm_servicebus")
var sb = new ServiceBusNamespace("cm_servicebus", ServiceBusNamespace.ResourceVersions.V2024_01_01)
{
Sku = new ServiceBusSku
{
Expand All @@ -33,7 +33,7 @@ protected internal override void EmitConstructs(ProjectInfrastructure infrastruc
infrastructure.AddConstruct(Id, sb);

infrastructure.AddConstruct(Id + "_rule",
new ServiceBusNamespaceAuthorizationRule("cm_servicebus_auth_rule", "2021-11-01")
new ServiceBusNamespaceAuthorizationRule("cm_servicebus_auth_rule", ServiceBusNamespaceAuthorizationRule.ResourceVersions.V2021_11_01)
{
Parent = sb,
Rights = [ServiceBusAccessRight.Listen, ServiceBusAccessRight.Send, ServiceBusAccessRight.Manage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected internal override void EmitConstructs(ProjectInfrastructure infrastruc
string topidId = ServiceBusTopicFeature.CreateId(_namespaceName, _topicName);
ServiceBusTopic serviceBusTopic = infrastructure.GetConstruct<ServiceBusTopic>(topidId);

var subscription = new ServiceBusSubscription(Name, "2021-11-01")
var subscription = new ServiceBusSubscription(Name, ServiceBusSubscription.ResourceVersions.V2021_11_01)
{
Name = Name,
Parent = serviceBusTopic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected internal override void EmitFeatures(ProjectInfrastructure infrastructu
protected internal override void EmitConstructs(ProjectInfrastructure infrastructure)
{
ServiceBusNamespace serviceBusNamespace = infrastructure.GetConstruct<ServiceBusNamespace>(_namespace!.Id);
var topic = new ServiceBusTopic(Name, "2021-11-01")
var topic = new ServiceBusTopic(Name, ServiceBusTopic.ResourceVersions.V2021_11_01)
{
Name = Name,
Parent = serviceBusNamespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected internal override void EmitConstructs(ProjectInfrastructure infrastruc
}
StorageAccount storageAccount = infrastructure.GetConstruct<StorageAccount>(Account.Id);

BlobService blobService = new("storageBlobService")
BlobService blobService = new("storageBlobService", BlobService.ResourceVersions.V2024_01_01)
{
Parent = storageAccount
};
Expand Down Expand Up @@ -146,7 +146,7 @@ protected internal override void EmitConstructs(ProjectInfrastructure infrastruc
}

BlobService blobService = infrastructure.GetConstruct<BlobService>(Service.Id);
BlobContainer blobContainer = new($"storageBlobContainer_{ContainerName}", "2023-01-01")
BlobContainer blobContainer = new($"storageBlobContainer_{ContainerName}", BlobContainer.ResourceVersions.V2023_01_01)
{
Parent = blobService,
Name = ContainerName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected internal override void EmitConstructs(ProjectInfrastructure infrastruc
ServiceBusTopic destinationTopic = infrastructure.GetConstruct<ServiceBusTopic>(_destination.Id);

ServiceBusBuiltInRole role = ServiceBusBuiltInRole.AzureServiceBusDataSender;
var roleAssignment = new RoleAssignment($"cm_servicebus_{parentTopic.Name.Value}_role")
var roleAssignment = new RoleAssignment($"cm_servicebus_{parentTopic.Name.Value}_role", RoleAssignment.ResourceVersions.V2022_04_01)
{
Name = BicepFunction.CreateGuid(serviceBusNamespace.Id, infrastructure.Identity.Id, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.ToString())),
Scope = new IdentifierExpression(serviceBusNamespace.BicepIdentifier),
Expand All @@ -40,7 +40,7 @@ protected internal override void EmitConstructs(ProjectInfrastructure infrastruc
PrincipalId = infrastructure.Identity.PrincipalId,
};

var subscription = new SystemTopicEventSubscription("cm_eventgrid_subscription_blob", "2022-06-15")
var subscription = new SystemTopicEventSubscription("cm_eventgrid_subscription_blob", SystemTopicEventSubscription.ResourceVersions.V2022_06_15)
{
Name = _name,
Parent = parentTopic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public ProjectInfrastructure(ConnectionStore connections, string? projectId = de
});

// setup project identity
Identity = new UserAssignedIdentity("projectIdentity")
Identity = new UserAssignedIdentity("projectIdentity", UserAssignedIdentity.ResourceVersions.V2023_01_31)
{
Name = ProjectId
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public FeatureRole(string name, string id)

internal class RoleResolver(string id, Dictionary<Provisionable, List<FeatureRole>> annotations, IEnumerable<UserAssignedIdentity> managedIdentities, IEnumerable<BicepValue<Guid>> userPrincipals) : InfrastructureResolver
{
private static string RoleAssignmentVersion =>
RoleAssignment.ResourceVersions.V2022_04_01;

public override IEnumerable<Provisionable> ResolveResources(IEnumerable<Provisionable> resources, ProvisioningBuildOptions options)
{
Dictionary<string, int> roleCount = new();
Expand All @@ -50,7 +53,7 @@ public override IEnumerable<Provisionable> ResolveResources(IEnumerable<Provisio

string bicepId = $"{resource.BicepIdentifier}_admin_{role.Name}";
if (count > 1) bicepId = $"{resource.BicepIdentifier}_admin_{role.Name}_{count}";
yield return new RoleAssignment(bicepId)
yield return new RoleAssignment(bicepId, RoleAssignmentVersion)
{
Name = BicepFunction.CreateGuid(resource.BicepIdentifier, id, userPrincipal, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.Id)),
Scope = new IdentifierExpression(resource.BicepIdentifier),
Expand All @@ -62,7 +65,7 @@ public override IEnumerable<Provisionable> ResolveResources(IEnumerable<Provisio

foreach (UserAssignedIdentity identity in managedIdentities)
{
yield return new RoleAssignment($"{resource.BicepIdentifier}_{identity.BicepIdentifier}_{role.Name}")
yield return new RoleAssignment($"{resource.BicepIdentifier}_{identity.BicepIdentifier}_{role.Name}", RoleAssignmentVersion)
{
Name = BicepFunction.CreateGuid(resource.BicepIdentifier, identity.Id, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", role.Id)),
Scope = new IdentifierExpression(resource.BicepIdentifier),
Expand Down
Loading
Loading