Azure / Azure/azure-rest-api-specs
SubscriptionClient: cannot create alias subscription with management group
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
- **Package Name**: azure-mgmt-subscription
- **Package Version**: 3.1.1
- **Operating System**: Linux
- **Python Version**: 3.9.16
**Describe the bug**
I try to create a subscription with the following piece of code:
```
subscription = subscription_client.alias.begin_create(
alias_name=name,
body=subscription_models.PutAliasRequest(
properties=subscription_models.PutAliasRequestProperties(
display_name=name,
workload=subscription_models.Workload.PRODUCTION,
billing_scope=billing_scope,
additional_properties=subscription_models.PutAliasRequestAdditionalProperties(
management_group_id=management_group,
subscription_tenant_id=tenant_id
)
)
)
)
```
The management group ID is: `general` (from the Azure portal).
If I pass `management_group_id="general"` I get the error:
```
Subscription creation failed since provided management group id is not in the expected format (/providers/Microsoft.Management/managementGroups/{mgmtGroupId})
```
If I pass `management_group_id="/providers/Microsoft.Management/managementGroups/general"` I get the error:
```
Subscription creation failed since provided management group id is not valid
```
**To Reproduce**
See above
**Expected behavior**
The subscription should be created when I pass `management_group="/providers/Microsoft.Management/managementGroups/general"`
Contributor guide
Research direction
Begin with the azure-mgmt-subscription 3.1.1 SubscriptionClient.alias.begin_create entry point and compare the two management_group_id values in the reproduction. Confirm the service or specification behavior for the expected management-group resource ID; done means identifying a supported creation path or documenting the API limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100