Skip to content

Commit a650066

Browse files
author
Priyank Lodha
committed
Add Context Cache resources to Storage Management API 2026-06-01
Adds the ContextCache (tracked) and ContextCacheContainer (proxy) resources with their models, operations, and examples, gated to the 2026-06-01 API version. Models and APIs mirror the Context Cache spec exactly; no internal/location-based resources are included.
1 parent 3a6f5c8 commit a650066

31 files changed

Lines changed: 2825 additions & 10 deletions
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import "@azure-tools/typespec-azure-core";
2+
import "@azure-tools/typespec-azure-resource-manager";
3+
import "@typespec/openapi";
4+
import "@typespec/rest";
5+
import "./models.tsp";
6+
7+
using TypeSpec.Rest;
8+
using Azure.ResourceManager;
9+
using TypeSpec.Http;
10+
using TypeSpec.OpenAPI;
11+
using TypeSpec.Versioning;
12+
13+
namespace Microsoft.Storage;
14+
/**
15+
* A Context Cache resource
16+
*/
17+
@added(Versions.v2026_06_01)
18+
model ContextCache
19+
is Azure.ResourceManager.TrackedResource<ContextCacheProperties, false> {
20+
/**
21+
* The name of the context cache
22+
*/
23+
@pattern("^[a-z0-9][a-z0-9-]{1,22}[a-z0-9]$")
24+
@key("contextCacheName")
25+
@segment("contextCaches")
26+
@path
27+
name: string;
28+
29+
...ManagedSystemAssignedIdentityProperty;
30+
}
31+
32+
@armResourceOperations
33+
@added(Versions.v2026_06_01)
34+
interface ContextCaches {
35+
/**
36+
* Get a Context Cache.
37+
*/
38+
get is ArmResourceRead<ContextCache>;
39+
40+
/**
41+
* Create or update a Context Cache.
42+
*/
43+
createOrUpdate is ArmResourceCreateOrUpdateAsync<ContextCache>;
44+
45+
/**
46+
* Update a Context Cache.
47+
*/
48+
update is ArmCustomPatchAsync<ContextCache, ContextCacheUpdate>;
49+
50+
/**
51+
* Delete a Context Cache.
52+
*/
53+
delete is ArmResourceDeleteWithoutOkAsync<ContextCache>;
54+
55+
/**
56+
* List Context Caches by resource group.
57+
*/
58+
listByResourceGroup is ArmResourceListByParent<ContextCache>;
59+
60+
/**
61+
* List Context Caches by subscription.
62+
*/
63+
listBySubscription is ArmListBySubscription<ContextCache>;
64+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import "@azure-tools/typespec-azure-core";
2+
import "@azure-tools/typespec-azure-resource-manager";
3+
import "@typespec/openapi";
4+
import "@typespec/rest";
5+
import "./models.tsp";
6+
import "./StorageContextCache.tsp";
7+
8+
using TypeSpec.Rest;
9+
using Azure.ResourceManager;
10+
using TypeSpec.Http;
11+
using TypeSpec.OpenAPI;
12+
using TypeSpec.Versioning;
13+
14+
namespace Microsoft.Storage;
15+
/**
16+
* A container resource within a Context Cache
17+
*/
18+
@parentResource(ContextCache)
19+
@added(Versions.v2026_06_01)
20+
model ContextCacheContainer
21+
is Azure.ResourceManager.ProxyResource<
22+
ContextCacheContainerProperties,
23+
false
24+
> {
25+
/**
26+
* The name of the context cache container
27+
*/
28+
@pattern("^[a-z0-9](?!.*--)[a-z0-9-]{1,61}[a-z0-9]$")
29+
@key("contextCacheContainerName")
30+
@segment("contextCacheContainers")
31+
@path
32+
name: string;
33+
}
34+
35+
@armResourceOperations
36+
@added(Versions.v2026_06_01)
37+
interface ContextCacheContainers {
38+
/**
39+
* Get a container in a Context Cache.
40+
*/
41+
get is ArmResourceRead<ContextCacheContainer>;
42+
43+
/**
44+
* Create or update a container in a Context Cache.
45+
*/
46+
createOrUpdate is ArmResourceCreateOrUpdateAsync<ContextCacheContainer>;
47+
48+
/**
49+
* Update a container in a Context Cache.
50+
*/
51+
update is ArmCustomPatchAsync<
52+
ContextCacheContainer,
53+
ContextCacheContainerUpdate
54+
>;
55+
56+
/**
57+
* Delete a container from a Context Cache.
58+
*/
59+
delete is ArmResourceDeleteWithoutOkAsync<ContextCacheContainer>;
60+
61+
/**
62+
* List all containers in a Context Cache.
63+
*/
64+
listByContextCache is ArmResourceListByParent<ContextCacheContainer>;
65+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"operationId": "ContextCaches_CreateOrUpdate",
3+
"title": "Create a Context Cache",
4+
"parameters": {
5+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
6+
"resourceGroupName": "testrg",
7+
"api-version": "2026-06-01",
8+
"contextCacheName": "testaccount",
9+
"resource": {
10+
"location": "eastus",
11+
"tags": {
12+
"environment": "test"
13+
},
14+
"properties": {
15+
"accountKind": "Regional",
16+
"description": "Test Azure Context Cache account"
17+
}
18+
}
19+
},
20+
"responses": {
21+
"200": {
22+
"body": {
23+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Storage/contextCaches/testaccount",
24+
"name": "testaccount",
25+
"type": "Microsoft.Storage/contextCaches",
26+
"location": "eastus",
27+
"tags": {
28+
"environment": "test"
29+
},
30+
"properties": {
31+
"accountKind": "Regional",
32+
"description": "Test Azure Context Cache account",
33+
"provisioningState": "Succeeded"
34+
},
35+
"systemData": {
36+
"createdBy": "user@example.com",
37+
"createdByType": "User",
38+
"createdAt": "2026-01-01T00:00:00Z",
39+
"lastModifiedBy": "user@example.com",
40+
"lastModifiedByType": "User",
41+
"lastModifiedAt": "2026-01-01T00:00:00Z"
42+
}
43+
}
44+
},
45+
"201": {
46+
"headers": {
47+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2026-06-01",
48+
"Retry-After": "10"
49+
},
50+
"body": {
51+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Storage/contextCaches/testaccount",
52+
"name": "testaccount",
53+
"type": "Microsoft.Storage/contextCaches",
54+
"location": "eastus",
55+
"tags": {
56+
"environment": "test"
57+
},
58+
"properties": {
59+
"accountKind": "Regional",
60+
"description": "Test Azure Context Cache account",
61+
"provisioningState": "Creating"
62+
},
63+
"systemData": {
64+
"createdBy": "user@example.com",
65+
"createdByType": "User",
66+
"createdAt": "2026-01-01T00:00:00Z",
67+
"lastModifiedBy": "user@example.com",
68+
"lastModifiedByType": "User",
69+
"lastModifiedAt": "2026-01-01T00:00:00Z"
70+
}
71+
}
72+
},
73+
"default": {
74+
"body": {
75+
"error": {
76+
"code": "InvalidOperation",
77+
"message": "Invalid request body or parameters"
78+
}
79+
}
80+
}
81+
}
82+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"operationId": "ContextCaches_CreateOrUpdate",
3+
"title": "Create a Azure Context Cache Account with System Assigned Identity",
4+
"parameters": {
5+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
6+
"resourceGroupName": "testrg",
7+
"api-version": "2026-06-01",
8+
"contextCacheName": "testaccount",
9+
"resource": {
10+
"location": "eastus",
11+
"tags": {
12+
"environment": "test"
13+
},
14+
"identity": {
15+
"type": "SystemAssigned"
16+
},
17+
"properties": {
18+
"accountKind": "Regional",
19+
"description": "Test Azure Context Cache account",
20+
"encryption": {
21+
"customerManagedKeyEncryption": {
22+
"keyEncryptionKeyIdentity": {
23+
"identityType": "systemAssignedIdentity"
24+
},
25+
"keyEncryptionKeyUrl": "https://mykeyvault.vault.azure.net/keys/myEncryptionKey"
26+
}
27+
}
28+
}
29+
}
30+
},
31+
"responses": {
32+
"200": {
33+
"body": {
34+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Storage/contextCaches/testaccount",
35+
"name": "testaccount",
36+
"type": "Microsoft.Storage/contextCaches",
37+
"location": "eastus",
38+
"tags": {
39+
"environment": "test"
40+
},
41+
"identity": {
42+
"type": "SystemAssigned",
43+
"principalId": "00000000-0000-0000-0000-000000000000",
44+
"tenantId": "00000000-0000-0000-0000-000000000000"
45+
},
46+
"properties": {
47+
"accountKind": "Regional",
48+
"description": "Test Azure Context Cache account",
49+
"encryption": {
50+
"customerManagedKeyEncryption": {
51+
"keyEncryptionKeyIdentity": {
52+
"identityType": "systemAssignedIdentity"
53+
},
54+
"keyEncryptionKeyUrl": "https://mykeyvault.vault.azure.net/keys/myEncryptionKey"
55+
}
56+
},
57+
"provisioningState": "Succeeded"
58+
},
59+
"systemData": {
60+
"createdBy": "user@example.com",
61+
"createdByType": "User",
62+
"createdAt": "2026-01-01T00:00:00Z",
63+
"lastModifiedBy": "user@example.com",
64+
"lastModifiedByType": "User",
65+
"lastModifiedAt": "2026-01-01T00:00:00Z"
66+
}
67+
}
68+
},
69+
"201": {
70+
"headers": {
71+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2026-06-01",
72+
"Retry-After": "10"
73+
},
74+
"body": {
75+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Storage/contextCaches/testaccount",
76+
"name": "testaccount",
77+
"type": "Microsoft.Storage/contextCaches",
78+
"location": "eastus",
79+
"tags": {
80+
"environment": "test"
81+
},
82+
"identity": {
83+
"type": "SystemAssigned",
84+
"principalId": "00000000-0000-0000-0000-000000000000",
85+
"tenantId": "00000000-0000-0000-0000-000000000000"
86+
},
87+
"properties": {
88+
"accountKind": "Regional",
89+
"description": "Test Azure Context Cache account",
90+
"encryption": {
91+
"customerManagedKeyEncryption": {
92+
"keyEncryptionKeyIdentity": {
93+
"identityType": "systemAssignedIdentity"
94+
},
95+
"keyEncryptionKeyUrl": "https://mykeyvault.vault.azure.net/keys/myEncryptionKey"
96+
}
97+
},
98+
"provisioningState": "Creating"
99+
},
100+
"systemData": {
101+
"createdBy": "user@example.com",
102+
"createdByType": "User",
103+
"createdAt": "2026-01-01T00:00:00Z",
104+
"lastModifiedBy": "user@example.com",
105+
"lastModifiedByType": "User",
106+
"lastModifiedAt": "2026-01-01T00:00:00Z"
107+
}
108+
}
109+
},
110+
"default": {
111+
"body": {
112+
"error": {
113+
"code": "InvalidOperation",
114+
"message": "Invalid request body or parameters"
115+
}
116+
}
117+
}
118+
}
119+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"operationId": "ContextCaches_Delete",
3+
"title": "Delete a Context Cache",
4+
"parameters": {
5+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
6+
"resourceGroupName": "testrg",
7+
"api-version": "2026-06-01",
8+
"contextCacheName": "testaccount"
9+
},
10+
"responses": {
11+
"202": {
12+
"headers": {
13+
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/operationStatuses/00000000-0000-0000-0000-000000000001?api-version=2026-06-01",
14+
"Retry-After": "10"
15+
}
16+
},
17+
"204": {},
18+
"default": {
19+
"body": {
20+
"error": {
21+
"code": "ResourceNotFound",
22+
"message": "Resource testaccount not found"
23+
}
24+
}
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)