Create Subscription 404 Client Error: Not Found for url
- 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:
- I have a normal MCA account which gets created when anyone signs up at portal.azure.com
- 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?
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @anuragdalmia, @shilpigautam, @ramaganesan-rg.
Investigating.
@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/