Skip to content

Commit d4438be

Browse files
fixed some bugs (Azure#46950)
* fixed some bugs * fixes
1 parent 9fc8128 commit d4438be

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

sdk/provisioning/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Provisioning.CloudMac
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Provisioning.CloudMachine.Tests", "tests\Azure.Provisioning.CloudMachine.Tests.csproj", "{46DCEF27-4157-4FB6-A283-B8484EC45665}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine", "..\..\cloudmachine\Azure.CloudMachine\src\Azure.CloudMachine.csproj", "{AE9C0E9B-27D9-4220-98DA-0CB6A7936277}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.Tests", "..\..\cloudmachine\Azure.CloudMachine\tests\Azure.CloudMachine.Tests.csproj", "{246D5F77-0151-40C5-8644-26A468A57CDC}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Provisioning.Deployment", "..\Azure.Provisioning.Deployment\src\Azure.Provisioning.Deployment.csproj", "{4562F8C1-9FE3-4B68-BBB2-D052B49C915A}"
15+
EndProject
1016
Global
1117
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1218
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +27,18 @@ Global
2127
{46DCEF27-4157-4FB6-A283-B8484EC45665}.Debug|Any CPU.Build.0 = Debug|Any CPU
2228
{46DCEF27-4157-4FB6-A283-B8484EC45665}.Release|Any CPU.ActiveCfg = Release|Any CPU
2329
{46DCEF27-4157-4FB6-A283-B8484EC45665}.Release|Any CPU.Build.0 = Release|Any CPU
30+
{AE9C0E9B-27D9-4220-98DA-0CB6A7936277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31+
{AE9C0E9B-27D9-4220-98DA-0CB6A7936277}.Debug|Any CPU.Build.0 = Debug|Any CPU
32+
{AE9C0E9B-27D9-4220-98DA-0CB6A7936277}.Release|Any CPU.ActiveCfg = Release|Any CPU
33+
{AE9C0E9B-27D9-4220-98DA-0CB6A7936277}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{246D5F77-0151-40C5-8644-26A468A57CDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{246D5F77-0151-40C5-8644-26A468A57CDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{246D5F77-0151-40C5-8644-26A468A57CDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{246D5F77-0151-40C5-8644-26A468A57CDC}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{4562F8C1-9FE3-4B68-BBB2-D052B49C915A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{4562F8C1-9FE3-4B68-BBB2-D052B49C915A}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{4562F8C1-9FE3-4B68-BBB2-D052B49C915A}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{4562F8C1-9FE3-4B68-BBB2-D052B49C915A}.Release|Any CPU.Build.0 = Release|Any CPU
2442
EndGlobalSection
2543
GlobalSection(SolutionProperties) = preSolution
2644
HideSolutionNode = FALSE

sdk/provisioning/Azure.Provisioning.CloudMachine/src/AzureSdkExtensions/OpenAIFeature.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public override void AddTo(CloudMachineInfrastructure cloudMachine)
4444
CognitiveServicesAccountDeployment? chat = default;
4545
if (Chat != default)
4646
{
47-
chat = new("openai_deployment_chat", "2023-05-01")
47+
chat = new("openai_deployment_chat", "2024-06-01-preview")
4848
{
4949
Parent = cognitiveServices,
5050
Name = cloudMachine.Id,
@@ -55,15 +55,22 @@ public override void AddTo(CloudMachineInfrastructure cloudMachine)
5555
Name = Chat.Model,
5656
Format = "OpenAI",
5757
Version = Chat.ModelVersion
58-
}
58+
},
59+
VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable,
60+
RaiPolicyName = "Microsoft.DefaultV2",
5961
},
62+
Sku = new CognitiveServicesSku
63+
{
64+
Capacity = 120,
65+
Name = "Standard"
66+
}
6067
};
6168
cloudMachine.AddResource(chat);
6269
}
6370

6471
if (Embeddings != null)
6572
{
66-
CognitiveServicesAccountDeployment embeddings = new("openai_deployment_embedding", "2023-05-01")
73+
CognitiveServicesAccountDeployment embeddings = new("openai_deployment_embedding", "2024-06-01-preview")
6774
{
6875
Parent = cognitiveServices,
6976
Name = $"{cloudMachine.Id}-embedding",
@@ -76,6 +83,11 @@ public override void AddTo(CloudMachineInfrastructure cloudMachine)
7683
Version = Embeddings.ModelVersion
7784
}
7885
},
86+
Sku = new CognitiveServicesSku
87+
{
88+
Capacity = 120,
89+
Name = "Standard"
90+
}
7991
};
8092

8193
// Ensure that additional deployments, are chained using DependsOn.

sdk/provisioning/Azure.Provisioning.CloudMachine/src/CDKLevel3/CloudMachineInfrastructure.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ public CloudMachineInfrastructure(string cmId)
168168
{
169169
TopicType = "Microsoft.Storage.StorageAccounts",
170170
Source = _storage.Id,
171-
Identity = managedServiceIdentity,
171+
Identity = new()
172+
{
173+
ManagedServiceIdentityType = ManagedServiceIdentityType.UserAssigned,
174+
UserAssignedIdentities = { { BicepFunction.Interpolate($"{Identity.Id}").Compile().ToString(), new UserAssignedIdentityDetails() } }
175+
},
172176
Name = _cmid
173177
};
174178
_eventGridSubscription_blobs = new("cm_eventgrid_subscription_blob", "2022-06-15")

sdk/provisioning/Azure.Provisioning.CloudMachine/tests/CloudMachineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class CloudMachineTests
1818
{
1919
[Theory]
2020
[TestCase([new string[] { "-bicep" }])]
21-
[TestCase([new string[] { "" }])]
21+
[TestCase([new string[] { }])]
2222
public void Provisioning(string[] args)
2323
{
2424
CloudMachineInfrastructure.Configure(args, (cm) =>

0 commit comments

Comments
 (0)