Skip to content
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

Update Azure.Provisioning to latest version #5592

Merged
merged 37 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bbfea9d
Update Azure.Provisioning to latest version
eerhardt Sep 9, 2024
929fcac
Add AsBicepParameter
eerhardt Sep 10, 2024
2a364cf
Update more stuff to make it deployable.
eerhardt Sep 10, 2024
d4c4f8c
Add a location parameter so azd up works.
eerhardt Sep 10, 2024
1e23335
Update Storage to use the new CDK
eerhardt Sep 10, 2024
6b4faf1
Update PostgreSQL to use the new CDK
eerhardt Sep 11, 2024
906e1c1
Sort the bicep statements so that parameters appear at the top and ou…
eerhardt Sep 11, 2024
3e1a0c1
Update Redis to use the new CDK
eerhardt Sep 11, 2024
d63bcf4
Update CosmosDB to use the new CDK
eerhardt Sep 12, 2024
9147277
Update Sql to use the new CDK
eerhardt Sep 12, 2024
2e34551
Update ServiceBus to use the new CDK
eerhardt Sep 12, 2024
0acf431
Update SignalR to use the new CDK
eerhardt Sep 12, 2024
eb7fb7a
Update Search to use the new CDK
eerhardt Sep 12, 2024
7a1bfa9
Update ApplicationInsights and OperationalInsights to use the new CDK
eerhardt Sep 12, 2024
bb41af8
Update AppConfiguration to use the new CDK
eerhardt Sep 12, 2024
7acb33c
Update CognitiveServices to use the new CDK
eerhardt Sep 12, 2024
0bb8479
Update WebPubSub to use the new CDK
eerhardt Sep 12, 2024
6097a9b
Update the CDK to version 1.0.0-alpha.20240912
eerhardt Sep 12, 2024
41c8089
Update to latest CDK version to fix CognitiveServices
eerhardt Sep 12, 2024
113be63
Update EventHubs to use new CDK
eerhardt Sep 12, 2024
bc16653
Get tests building
eerhardt Sep 12, 2024
bc36aa0
Fix up so azd up works
eerhardt Sep 13, 2024
c8322a4
Use GetTenant function
eerhardt Sep 13, 2024
665a4dc
Merge remote-tracking branch 'upstream/main' into UpdateCDK
eerhardt Sep 13, 2024
b371332
Fix bicep tests
eerhardt Sep 13, 2024
18cbd0a
Update test nuget.configs
eerhardt Sep 13, 2024
2bb632d
Update the rest of the bicep in the playground apps.
eerhardt Sep 16, 2024
9c1112b
Use simpler expression to set SqlFirewallRule addresses
eerhardt Sep 16, 2024
dc2ef1e
Merge remote-tracking branch 'upstream/main' into UpdateCDK
eerhardt Sep 16, 2024
15f7258
Add XML docs to the new APIs.
eerhardt Sep 16, 2024
d2fe6cd
Remove hard-coded ResourceVersions.
eerhardt Sep 16, 2024
35dd244
Merge remote-tracking branch 'upstream/main' into UpdateCDK
eerhardt Sep 17, 2024
fa37195
Fix up whitespace
eerhardt Sep 17, 2024
16ea988
Use 8.x naming scheme.
eerhardt Sep 17, 2024
369e72f
Fix deployment name in OpenAI
eerhardt Sep 17, 2024
da65e75
Merge remote-tracking branch 'upstream/main' into UpdateCDK
eerhardt Sep 17, 2024
422d838
Respond to PR feedback
eerhardt Sep 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<TestcontainersPackageVersion>3.10.0</TestcontainersPackageVersion>
<AzureProvisiongVersion>1.0.0-alpha.20240905.4</AzureProvisiongVersion>
</PropertyGroup>
<ItemGroup>
<!-- AWS SDK for .NET dependencies -->
Expand Down Expand Up @@ -34,23 +35,24 @@
<PackageVersion Include="Microsoft.Azure.SignalR" Version="1.27.0" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.5" />
<!-- Azure Management SDK for .NET dependencies -->
<PackageVersion Include="Azure.Provisioning" Version="0.3.0" />
<PackageVersion Include="Azure.Provisioning.AppConfiguration" Version="0.2.0" />
<PackageVersion Include="Azure.Provisioning.ApplicationInsights" Version="0.1.0" />
<PackageVersion Include="Azure.Provisioning.CognitiveServices" Version="0.2.0" />
<PackageVersion Include="Azure.Provisioning.CosmosDB" Version="0.1.0" />
<PackageVersion Include="Azure.Provisioning.EventHubs" Version="0.1.0" />
<PackageVersion Include="Azure.Provisioning.KeyVault" Version="0.2.0" />
<PackageVersion Include="Azure.Provisioning.OperationalInsights" Version="0.2.0" />
<PackageVersion Include="Azure.Provisioning.PostgreSql" Version="0.1.0" />
<PackageVersion Include="Azure.Provisioning.Redis" Version="0.2.0" />
<PackageVersion Include="Azure.Provisioning.Resources" Version="0.2.0" />
<PackageVersion Include="Azure.Provisioning.Search" Version="0.1.0" />
<PackageVersion Include="Azure.Provisioning.ServiceBus" Version="0.1.0" />
<PackageVersion Include="Azure.Provisioning.SignalR" Version="0.2.0" />
<PackageVersion Include="Azure.Provisioning.Sql" Version="0.1.0" />
<PackageVersion Include="Azure.Provisioning.Storage" Version="0.2.0" />
<PackageVersion Include="Azure.Provisioning.WebPubSub" Version="0.1.0-beta.1" />
<PackageVersion Include="Azure.Provisioning" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.AppConfiguration" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.ApplicationInsights" Version="1.0.0-alpha.20240905.2" />
<PackageVersion Include="Azure.Provisioning.CognitiveServices" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.CosmosDB" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.EventHubs" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.KeyVault" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.OperationalInsights" Version="1.0.0-alpha.20240905.2" />
<PackageVersion Include="Azure.Provisioning.PostgreSql" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.Redis" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.Search" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.ServiceBus" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.SignalR" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.Sql" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.Storage" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.Provisioning.WebPubSub" Version="$(AzureProvisiongVersion)" />
<PackageVersion Include="Azure.ResourceManager.Authorization" Version="1.1.3" />
<PackageVersion Include="Azure.ResourceManager.KeyVault" Version="1.3.0" />
<!-- ASP.NET Core dependencies -->
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Certificate" Version="$(MicrosoftAspNetCoreAuthenticationCertificatePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(MicrosoftAspNetCoreAuthenticationJwtBearerPackageVersion)" />
Expand Down Expand Up @@ -172,4 +174,4 @@
<PackageVersion Include="Azure.Identity" Version="1.12.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> <!-- https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3313 -->
</ItemGroup>
</Project>
</Project>
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
<add key="dotnet9-transport" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet9-transport/nuget/v3/index.json" />
<add key="azure-sdk-devfeed" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="dotnet9-transport">
Expand All @@ -35,6 +36,9 @@
<packageSource key="dotnet-eng">
<package pattern="*" />
</packageSource>
<packageSource key="azure-sdk-devfeed">
<package pattern="Azure.*" />
</packageSource>
</packageSourceMapping>
<disabledPackageSources>
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
Expand Down
8 changes: 4 additions & 4 deletions playground/cdk/CdkSample.AppHost/CdkSample.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
<ItemGroup>
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.KeyVault" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.Redis" />
<!-- <AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.Redis" />-->
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.PostgreSQL" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.CosmosDB" />
<!-- <AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.CosmosDB" />-->
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.Storage" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.ServiceBus" />
<!-- <AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.ServiceBus" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.Sql" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.SignalR" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.Search" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.OperationalInsights" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.ApplicationInsights" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.AppConfiguration" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure.AppConfiguration" />-->
<ProjectReference Include="..\CdkSample.ApiService\CdkSample.ApiService.csproj" />
</ItemGroup>

Expand Down
138 changes: 70 additions & 68 deletions playground/cdk/CdkSample.AppHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,37 @@

#pragma warning disable AZPROVISION001 // Because we use the CDK callbacks.

using Aspire.Hosting.Azure;
using Azure.Provisioning.KeyVaults;
using Azure.ResourceManager.ApplicationInsights.Models;
using Azure.ResourceManager.OperationalInsights.Models;
using Azure.Provisioning.KeyVault;
using Azure.Provisioning.Storage;

var builder = DistributedApplication.CreateBuilder(args);

var cosmosdb = builder.AddAzureCosmosDB("cosmos").AddDatabase("cosmosdb");
//var cosmosdb = builder.AddAzureCosmosDB("cosmos").AddDatabase("cosmosdb");

var sku = builder.AddParameter("storagesku");
var locationOverride = builder.AddParameter("locationOverride");
var storage = builder.AddAzureStorage("storage", (_, _, account) =>
var storage = builder.AddAzureStorage("storage", (_, construct, account) =>
{
account.AssignProperty(sa => sa.Sku.Name, sku);
account.AssignProperty(sa => sa.Location, locationOverride);
account.Sku = new StorageSku() { Name = sku.AsBicepParameter(construct) };
account.Location = locationOverride.AsBicepParameter(construct);
});

var blobs = storage.AddBlobs("blobs");

var sqldb = builder.AddSqlServer("sql").AsAzureSqlDatabase().AddDatabase("sqldb");
//var sqldb = builder.AddSqlServer("sql").AsAzureSqlDatabase().AddDatabase("sqldb");

var signaturesecret = builder.AddParameter("signaturesecret");
var signaturesecret = builder.AddParameter("signaturesecret", secret: true);
var keyvault = builder.AddAzureKeyVault("mykv", (_, construct, keyVault) =>
{
var secret = new KeyVaultSecret(construct, name: "mysecret");
secret.AssignProperty(x => x.Properties.Value, signaturesecret);
var secret = new KeyVaultSecret("mysecret")
{
Parent = keyVault,
Properties = new SecretProperties { Value = signaturesecret.AsBicepParameter(construct) }
};
construct.Add(secret);
});

var cache = builder.AddRedis("cache").AsAzureRedis();
//var cache = builder.AddRedis("cache").AsAzureRedis();

var pgsqlAdministratorLogin = builder.AddParameter("pgsqlAdministratorLogin");
var pgsqlAdministratorLoginPassword = builder.AddParameter("pgsqlAdministratorLoginPassword", secret: true);
Expand All @@ -41,66 +43,66 @@

var pgsql2 = builder.AddPostgres("pgsql2").AsAzurePostgresFlexibleServer();

var sb = builder.AddAzureServiceBus("servicebus")
.AddQueue("queue1",
(_, construct, queue) =>
{
queue.Properties.MaxDeliveryCount = 5;
queue.Properties.LockDuration = TimeSpan.FromMinutes(5);
})
.AddTopic("topic1",
(_, construct, topic) =>
{
topic.Properties.EnablePartitioning = true;
})
.AddTopic("topic2")
.AddSubscription("topic1", "subscription1",
(_, construct, subscription) =>
{
subscription.Properties.LockDuration = TimeSpan.FromMinutes(5);
subscription.Properties.RequiresSession = true;
})
.AddSubscription("topic1", "subscription2")
.AddTopic("topic3", new[] { "sub1", "sub2" });

var appConfig = builder.AddAzureAppConfiguration("appConfig");

var search = builder.AddAzureSearch("search");

var signalr = builder.AddAzureSignalR("signalr");

var logAnalyticsWorkspace = builder.AddAzureLogAnalyticsWorkspace(
"logAnalyticsWorkspace",
(_, _, logAnalyticsWorkspace) =>
{
logAnalyticsWorkspace.Properties.Sku = new OperationalInsightsWorkspaceSku(OperationalInsightsWorkspaceSkuName.PerNode);
});

var appInsights = builder.AddAzureApplicationInsights(
"appInsights",
(_, _, appInsights) =>
{
appInsights.AssignProperty(
p => p.WorkspaceResourceId,
logAnalyticsWorkspace.Resource.WorkspaceId,
AzureBicepResource.KnownParameters.LogAnalyticsWorkspaceId);

appInsights.Properties.IngestionMode = ComponentIngestionMode.LogAnalytics;
});
//var sb = builder.AddAzureServiceBus("servicebus")
// .AddQueue("queue1",
// (_, construct, queue) =>
// {
// queue.Properties.MaxDeliveryCount = 5;
// queue.Properties.LockDuration = TimeSpan.FromMinutes(5);
// })
// .AddTopic("topic1",
// (_, construct, topic) =>
// {
// topic.Properties.EnablePartitioning = true;
// })
// .AddTopic("topic2")
// .AddSubscription("topic1", "subscription1",
// (_, construct, subscription) =>
// {
// subscription.Properties.LockDuration = TimeSpan.FromMinutes(5);
// subscription.Properties.RequiresSession = true;
// })
// .AddSubscription("topic1", "subscription2")
// .AddTopic("topic3", new[] { "sub1", "sub2" });

//var appConfig = builder.AddAzureAppConfiguration("appConfig");

//var search = builder.AddAzureSearch("search");

//var signalr = builder.AddAzureSignalR("signalr");

//var logAnalyticsWorkspace = builder.AddAzureLogAnalyticsWorkspace(
// "logAnalyticsWorkspace",
// (_, _, logAnalyticsWorkspace) =>
// {
// logAnalyticsWorkspace.Properties.Sku = new OperationalInsightsWorkspaceSku(OperationalInsightsWorkspaceSkuName.PerNode);
// });

//var appInsights = builder.AddAzureApplicationInsights(
// "appInsights",
// (_, _, appInsights) =>
//{
// appInsights.AssignProperty(
// p => p.WorkspaceResourceId,
// logAnalyticsWorkspace.Resource.WorkspaceId,
// AzureBicepResource.KnownParameters.LogAnalyticsWorkspaceId);

// appInsights.Properties.IngestionMode = ComponentIngestionMode.LogAnalytics;
//});

builder.AddProject<Projects.CdkSample_ApiService>("api")
.WithExternalHttpEndpoints()
.WithReference(signalr)
//.WithReference(signalr)
.WithReference(blobs)
.WithReference(sqldb)
//.WithReference(sqldb)
.WithReference(keyvault)
.WithReference(cache)
.WithReference(cosmosdb)
.WithReference(pgsqldb)
.WithReference(sb)
.WithReference(appConfig)
.WithReference(search)
.WithReference(appInsights);
//.WithReference(cache)
//.WithReference(cosmosdb)
.WithReference(pgsqldb);
//.WithReference(sb)
//.WithReference(appConfig)
//.WithReference(search)
//.WithReference(appInsights);

#if !SKIP_DASHBOARD_REFERENCE
// This project is only added in playground projects to support development/debugging
Expand Down
Loading