Skip to content

Commit 287203c

Browse files
Merge pull request #273726 from bandersmsft/program-create-sub-ea
MCM - Update program-create-ea-sub for subcriptionOwnerId
2 parents a04d144 + 9a15685 commit 287203c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

articles/cost-management-billing/manage/programmatically-create-subscription-enterprise-agreement.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,30 @@ You get the subscriptionId as part of the response from the command.
290290

291291
---
292292

293+
## Create subscription and make subscriptionOwnerId the owner
294+
295+
When a service principal uses the Subscription Alias API to create a new subscription and doesn't include `additionalProperties` in the request, the service principal automatically becomes the owner of the new subscription. If you don't want the service principal to be the owner, you can specify `subscriptionTenantId` and `subscriptionOwnerId` in the `additionalProperties`. This process makes the specified `subscriptionOwnerId` the owner of the new subscription, not the service principal.
296+
297+
Sample request body:
298+
299+
```json
300+
301+
{
302+
"properties": {
303+
"billingScope": "/providers/Microsoft.Billing/billingAccounts/{EABillingAccountId}/enrollmentAccounts/{EnrollmentAccountId}",
304+
"displayName": "{SubscriptionName}",
305+
"workLoad": "Production",
306+
"resellerId": null,
307+
"additionalProperties": {
308+
"managementGroupId": "",
309+
"subscriptionTenantId": "{SubscriptionTenantId}", // Here you input the tenant GUID where the subscription resides after creation
310+
"subscriptionOwnerId": "{ObjectId that becomes the owner of the subscription}", // Here you input the objectId which is set as the subscription owner when it gets created.
311+
"tags": {}
312+
}
313+
}
314+
}
315+
```
316+
293317
## Create subscriptions in a different tenant
294318

295319
Using the subscription [Alias](/rest/api/subscription/2021-10-01/alias/create) REST API, you can create a subscription in a different tenant using the `subscriptionTenantId` parameter in the request body. Your Azure Service Principal (SPN) must get a token from its home tenant to create the subscription. After you create the subscription, you must get a token from the target tenant to accept the transfer using the [Accept Ownership](/rest/api/subscription/2021-10-01/subscription/accept-ownership) API.

0 commit comments

Comments
 (0)