你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzApiManagementCache
创建新的缓存实体
语法
New-AzApiManagementCache
-Context <PsApiManagementContext>
[-CacheId <String>]
-ConnectionString <String>
[-AzureRedisResourceId <String>]
[-Description <String>]
[-UseFromLocation <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
cmdlet New-AzApiManagementCache 在 Api 管理服务中创建一个新的缓存实体。
示例
示例 1:创建新的缓存实体
New-AzApiManagementCache -Context $context -ConnectionString "teamdemo.redis.cache.windows.net:6380,password=xxxxxx+xxxxx=,ssl=True,abortConnect=False" -Description "Team Cache"
CacheId : centralus
Description : Team Cache
ConnectionString : {{5cc19889e6ed3b0524c3f7d3}}
ResourceId :
Id : /subscriptions/subid/resourceGroups/Api-Default-WestUS/providers/Microsof
t.ApiManagement/service/contoso/caches/centralus
ResourceGroupName : Api-Default-WestUS
ServiceName : contoso
该 cmdlet 在 Api 管理服务的主位置创建新的缓存实体。
参数
-AzureRedisResourceId
Azure Redis 缓存实例的 Arm ResourceId。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-CacheId
新缓存的标识符。 此参数是可选的。 如果未指定,将生成。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ConnectionString
Redis 连接字符串。 此参数是必需的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Context
PsApiManagementContext 的实例。 此参数是必需的。
类型: | PsApiManagementContext |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Description
缓存说明。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-UseFromLocation
Cache UseFromLocation。 此参数是可选的默认值“default”。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |