Skip to content

Commit b75b127

Browse files
markcowlCopilot
andcommitted
Remove v5/v6 common-types refs for CustomerManagedKeyEncryption
- Created new types in Azure.ResourceManager.Foundations namespace that duplicate CustomerManagedKeyEncryption and its dependencies - Removed @@armCommonDefinition augment decorators for v5 and v6 versions of CustomerManagedKeyEncryption (type was removed from common-types after v4) - Deprecated CustomerManagedKeyEncryption, directing users to use the Encryption type instead Fixes #4513 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8cd8304 commit b75b127

4 files changed

Lines changed: 41 additions & 12 deletions

File tree

packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys-ref.tsp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,3 @@ namespace Azure.ResourceManager.CommonTypes;
2929
#{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true },
3030
"customermanagedkeys.json"
3131
);
32-
@@armCommonDefinition(
33-
CustomerManagedKeyEncryption,
34-
"customerManagedKeyEncryption",
35-
Azure.ResourceManager.CommonTypes.Versions.v5,
36-
"customermanagedkeys.json"
37-
);
38-
@@armCommonDefinition(
39-
CustomerManagedKeyEncryption,
40-
"customerManagedKeyEncryption",
41-
Azure.ResourceManager.CommonTypes.Versions.v6,
42-
"customermanagedkeys.json"
43-
);

packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ model KeyEncryptionKeyIdentity {
4848
}
4949

5050
/** Customer-managed key encryption properties for the resource. */
51+
#deprecated "Use Azure.ResourceManager.CommonTypes.Encryption instead"
5152
@added(Versions.v4)
5253
model CustomerManagedKeyEncryption {
5354
/** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */

packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "@typespec/rest";
33

44
import "./backcompat.tsp";
55
import "./deprecation.tsp";
6+
import "./encryption.tsp";
67
import "../common-types/common-types.tsp";
78
import "../decorators.tsp";
89
import "../responses.tsp";
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
namespace Azure.ResourceManager.Foundations;
2+
3+
/** The type of identity to use. */
4+
union KeyEncryptionKeyIdentityType {
5+
/** System assigned identity */
6+
SystemAssignedIdentity: "systemAssignedIdentity",
7+
8+
/** User assigned identity */
9+
UserAssignedIdentity: "userAssignedIdentity",
10+
11+
/** Delegated identity */
12+
DelegatedResourceIdentity: "delegatedResourceIdentity",
13+
14+
string,
15+
}
16+
17+
/** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */
18+
model KeyEncryptionKeyIdentity {
19+
/** The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. */
20+
identityType?: KeyEncryptionKeyIdentityType;
21+
22+
/** User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. */
23+
userAssignedIdentityResourceId?: Azure.Core.armResourceIdentifier;
24+
25+
/** application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540 */
26+
federatedClientId?: uuid;
27+
28+
/** delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. */
29+
delegatedIdentityClientId?: uuid;
30+
}
31+
32+
/** Customer-managed key encryption properties for the resource. */
33+
model CustomerManagedKeyEncryption {
34+
/** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */
35+
keyEncryptionKeyIdentity?: KeyEncryptionKeyIdentity;
36+
37+
/** key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. */
38+
keyEncryptionKeyUrl?: string;
39+
}

0 commit comments

Comments
 (0)