azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

--subscription-required parameter of az apim product create not working

Open mossywell opened this issue 4 years ago • 10 comments

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug The "az apim product create" is used to create a new product in APIM. Products can have subscriptionRequired set to true or false. There is an Azure CLI argument "--subscription-required" to allow this. However, in all circumstances, the subscriptionRequired value is set to true.

To Reproduce

  1. Create a new API Management
  2. Create a new Product
  3. Run this: az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required "false" Or az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required false Or az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required $false All result in subscriptionRequired : true

Expected behavior The value of subscriptionRequired should be set to false if "false" is used on the CLI argument.

Environment summary Azure CLI either in a cloud shell or locally.

Additional context N/A

mossywell avatar Dec 23 '21 19:12 mossywell

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @miaojiang.

Issue Details

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug The "az apim product create" is used to create a new product in APIM. Products can have subscriptionRequired set to true or false. There is an Azure CLI argument "--subscription-required" to allow this. However, in all circumstances, the subscriptionRequired value is set to true.

To Reproduce

  1. Create a new API Management
  2. Create a new Product
  3. Run this: az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required "false" Or az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required false Or az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required $false All result in subscriptionRequired : true

Expected behavior The value of subscriptionRequired should be set to false if "false" is used on the CLI argument.

Environment summary Azure CLI either in a cloud shell or locally.

Additional context N/A

Author: mossywell
Assignees: -
Labels:

Service Attention, API Management, customer-reported

Milestone: -

ghost avatar Dec 24 '21 01:12 ghost

route to service team

yonzhan avatar Dec 24 '21 01:12 yonzhan

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @miaojiang.

Issue Details

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug The "az apim product create" is used to create a new product in APIM. Products can have subscriptionRequired set to true or false. There is an Azure CLI argument "--subscription-required" to allow this. However, in all circumstances, the subscriptionRequired value is set to true.

To Reproduce

  1. Create a new API Management
  2. Create a new Product
  3. Run this: az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required "false" Or az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required false Or az apim product create --resource-group "<my RG>" --service-name "<My APIM>" --product-id "<My Product>" --product-name "<My Product>" --state "published" --subscription-required $false All result in subscriptionRequired : true

Expected behavior The value of subscriptionRequired should be set to false if "false" is used on the CLI argument.

Environment summary Azure CLI either in a cloud shell or locally.

Additional context N/A

Author: mossywell
Assignees: -
Labels:

Service Attention, API Management, customer-reported

Milestone: -

ghost avatar Feb 18 '22 07:02 ghost

@mossywell Apologies for the late reply. I was able to reproduce this issue. We will update this thread once we have more details on the fix.

@adrianhall Could you please look into this and provide an update on you get a chance ? Awaiting your reply.

navba-MSFT avatar Feb 18 '22 07:02 navba-MSFT

@mossywell Apologies for the late reply. I was able to reproduce this issue. We will update this thread once we have more details on the fix.

@adrianhall Could you please look into this and provide an update on you get a chance ? Awaiting your reply.

Thank you

mossywell avatar Feb 21 '22 22:02 mossywell

Thanks for the report. I've included this in our backlog so that a fix will be available in the next APIM release of the CLI. I'll update when then release happens.

adrianhall avatar Feb 22 '22 17:02 adrianhall

Excellent - thanks for the update.

mossywell avatar Feb 22 '22 17:02 mossywell

i have this problem too, please fix it soon!!

BCIfernando1989mg avatar Mar 25 '22 14:03 BCIfernando1989mg

@mossywell Apologies for the late reply. I was able to reproduce this issue. We will update this thread once we have more details on the fix. @adrianhall Could you please look into this and provide an update on you get a chance ? Awaiting your reply.

Thank you

bro, do you have any solution for this?

BCIfernando1989mg avatar Mar 25 '22 14:03 BCIfernando1989mg

It can be done in PowerShell as follows:

$context = New-AzApiManagementContext -ResourceGroupName "my-rg" -ServiceName "my-apim" $product = Get-AzApiManagementProduct -Context $context -ProductId "my-product" $product.SubscriptionRequired = $false $product | Set-AzApiManagementProduct -Context $context

mossywell avatar May 30 '22 12:05 mossywell

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Aug 19 '22 14:08 ghost