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

Get-AzApiManagementProduct incorrectly validates productId #8547

Closed
RoyWang05 opened this issue Feb 15, 2019 · 4 comments
Closed

Get-AzApiManagementProduct incorrectly validates productId #8547

RoyWang05 opened this issue Feb 15, 2019 · 4 comments
Assignees
Labels
API Management Service Attention This issue is responsible by Azure service team.
Milestone

Comments

@RoyWang05
Copy link

$ctx = New-AzApiManagementContext -ResourceGroupName PlatformV1-ChinaNorth-PROD -ServiceName Cognitive-CN-Prod
Get-AzApiManagementProduct -Context $ctx -ProductId "ComputerVision.BaiShanYun"

            Get-AzApiManagementProduct : 'productId' does not match expected pattern '(^[\w]+$)|(^[\w][\w\-]+[\w]$)'.

At line:1 char:1

  • Get-AzApiManagementProduct -Context $ctx -ProductId "ComputerVision.B ...

But if I query all products and found this product does exist:

            PS C:\Users\roywang> $pd

ProductId : ComputerVision.BaiShanYun
Title : Computer Vision API – Bai Shan Yun
Description : Test product for Bai Shan Yun. Should be deleted after testing.
LegalTerms :
SubscriptionRequired : True
ApprovalRequired : False
SubscriptionsLimit : 5
State : Published
Id : /subscriptions/8345a3f5-1a51-4ee8-afc2-330938a2f14e/resourceGroups/PlatformV1-ChinaNorth-PROD/providers/Microsoft.ApiManagement/service/Cognitive-CN-Prod/product
s/ComputerVision.BaiShanYun
ResourceGroupName : PlatformV1-ChinaNorth-PROD
ServiceName : Cognitive-CN-Prod

Script/Steps for Reproduction

Module Version

Get-Module -ListAvailable

Environment Data

$PSVersionTable

Debug Output


@maddieclayton maddieclayton added API Management Service Attention This issue is responsible by Azure service team. labels Feb 15, 2019
@maddieclayton
Copy link
Contributor

@solankisamir Can you take a look at this issue?

@solankisamir
Copy link
Member

#ack

@solankisamir
Copy link
Member

Workaround till we fix in powershell

PS C:\WINDOWS\system32> Get-AzResource -ResourceType Microsoft.ApiManagement/service/products -ResourceName sdktestapim5797/starter -ResourceGroupName sdktestrg623 -ApiVersion 2018-01-01

Name : starter
ResourceId : /subscriptions/******/resourceGroups/sdktestrg623/providers/Microsoft.ApiManagement/service/sdktestapim5797/products/starter
ResourceName : sdktestapim5797/starter
ResourceType : Microsoft.ApiManagement/service/products
ResourceGroupName : sdktestrg623
SubscriptionId : bab08e11-7b12-4354-9fd1-4b5d64d40b68
Properties : @{displayName=Starter; description=Subscribers will be able to run 5 calls/minute up to a maximum of 100 calls/week.; terms=; subscriptionRequired=True;
approvalRequired=False; subscriptionsLimit=1; state=published}

@solankisamir solankisamir added this to the 2019-05-21 milestone May 7, 2019
@solankisamir
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Management Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants