azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Create Subscription 404 Client Error: Not Found for url

Open SiddharthPant opened this issue 6 years ago • 3 comments

  • Package Name: azure-mgmt-subscription
  • Package Version: 0.5.0
  • Operating System: Ubuntu 18.04.4
  • Python Version: 3.8.2

Describe the bug Trying to create a subscription throws out 404 Client Error

To Reproduce Steps to reproduce the behavior:

  1. I have a normal MCA account which gets created when anyone signs up at portal.azure.com
  2. Following code to create subscription programmatically:
from azure.common.client_factory import get_client_from_cli_profile
from azure.mgmt.subscription import SubscriptionClient
from azure.mgmt.subscription.models import ModernSubscriptionCreationParameters, ErrorResponseException
client = get_client_from_cli_profile(SubscriptionClient)
param_body = ModernSubscriptionCreationParameters(display_name="Azure Subscription 3", billing_profile_id="TX**-****-***-**B", sku_id="001")
try:
    client.subscription_factory.create_subscription(
        billing_account_name="3c******-****-****-****-*********************-****-****-****-**********a4",
        invoice_section_name="IT**-****-***-**B",
        body=param_body
    )
except ErrorResponseException as err:
    print(err.message)
    print(err.error)

This code throws out error and fails to run: Operation returned an invalid status code 'Not Found' 404 Client Error: Not Found for url: https://management.azure.com/providers/Microsoft.Billing/billingAccounts/3c******-****-****-****-*********************-****-****-****-**********a4_2019-05-31/invoiceSections/IT**-****-***-**B/providers/Microsoft.Subscription/createSubscription?api-version=2018-11-01-preview

Expected behavior Subscription should have been created programmatically with the given details.

Screenshots NA

Additional context Please tell me whether a normal MCA account type should work with this API or not. Do I require enterprise enrollment account type for this?

SiddharthPant avatar Apr 21 '20 20:04 SiddharthPant

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @anuragdalmia, @shilpigautam, @ramaganesan-rg.

ghost avatar Apr 21 '20 23:04 ghost

Investigating.

anuragdalmia avatar Jun 04 '20 19:06 anuragdalmia

@SiddharthPant - We have enabled support for this in our latest version. Can you please take a look at that and let us know if that addresses the issue for you - https://pypi.org/project/azure-mgmt-subscription/0.6.0/

anuragdalmia avatar Jun 08 '20 19:06 anuragdalmia