Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a Enterprise Dev/Test subscription with New-AzSubscription with Operation: Badrequest #13600

Closed
Acenl12 opened this issue Nov 27, 2020 · 5 comments
Labels
customer-reported question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. Subscription

Comments

@Acenl12
Copy link

Acenl12 commented Nov 27, 2020

Run this from an ADO pipeline on our release server:
New-AzSubscription -OfferType MS-AZR-0148P -Name $Sub.SubscriptionName -EnrollmentAccountObjectId $EnrollAccObjId -OwnerObjectId $OwnerObjId

That give this error:
2020-11-27T12:12:45.1499038Z ##[error]Operation returned an invalid status code 'BadRequest'
2020-11-27T12:12:45.3506619Z ##[error]PowerShell exited with code '1'.

Normal enteprise agreements with offertype MS-AZR-0017P don't fail and succeeded in creating.

We are using version 0.7.3 of the Az.Subscription module, because the cmdlet is missing is 0.8.0. By the way, I don't get the reason behinding changing the New-AzSubscription command, because New-AzSubscription worked perfect for us.

@Acenl12 Acenl12 added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 27, 2020
@msftbot msftbot bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported labels Nov 27, 2020
@Acenl12 Acenl12 changed the title Creating a Dev/Test subscription with New-AzSubscription with Operation: Badrequest Creating a Enterprise Dev/Test subscription with New-AzSubscription with Operation: Badrequest Nov 27, 2020
@dingmeng-xue dingmeng-xue added Service Attention This issue is responsible by Azure service team. Subscription and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Nov 30, 2020
@msftbot
Copy link
Contributor

msftbot bot commented Nov 30, 2020

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

Issue Details

Run this from an ADO pipeline on our release server:
New-AzSubscription -OfferType MS-AZR-0148P -Name $Sub.SubscriptionName -EnrollmentAccountObjectId $EnrollAccObjId -OwnerObjectId $OwnerObjId

That give this error:
2020-11-27T12:12:45.1499038Z ##[error]Operation returned an invalid status code 'BadRequest'
2020-11-27T12:12:45.3506619Z ##[error]PowerShell exited with code '1'.

Normal enteprise agreements with offertype MS-AZR-0017P don't fail and succeeded in creating.

We are using version 0.7.3 of the Az.Subscription module, because the cmdlet is missing is 0.8.0. By the way, I don't get the reason behinding changing the New-AzSubscription command, because New-AzSubscription worked perfect for us.

Author: guidovbrakel
Assignees: -
Labels:

Service Attention, Subscription, customer-reported, question

Milestone: -

@dingmeng-xue
Copy link
Member

@guidovbrakel , could you share your debug log? You can enable it via $DebugPreference="Continue".

@Acenl12
Copy link
Author

Acenl12 commented Nov 30, 2020

See below
@dingmeng-xue

2020-11-30T09:45:43.2346868Z
2020-11-30T09:45:43.2347016Z {
2020-11-30T09:45:43.2347118Z
2020-11-30T09:45:43.2347265Z "error": {
2020-11-30T09:45:43.2361142Z
2020-11-30T09:45:43.2361636Z "code": "EntitlementNotFound",
2020-11-30T09:45:43.2361815Z
2020-11-30T09:45:43.2362170Z "message": "Enrollment account does not have entitlement to create subscription for the offer type MS-AZR-0148P.
2020-11-30T09:45:43.2362611Z Contact enterprise admin/account admin to grant permissions."
2020-11-30T09:45:43.2362810Z
2020-11-30T09:45:43.2362965Z },
2020-11-30T09:45:43.2363074Z
2020-11-30T09:45:43.2363253Z "code": "EntitlementNotFound",
2020-11-30T09:45:43.2363437Z
2020-11-30T09:45:43.2363758Z "message": "Enrollment account does not have entitlement to create subscription for the offer type MS-AZR-0148P.
2020-11-30T09:45:43.2364617Z Contact enterprise admin/account admin to grant permissions."
2020-11-30T09:45:43.2364906Z
2020-11-30T09:45:43.2365078Z }
2020-11-30T09:45:43.2365232Z
2020-11-30T09:45:43.2365373Z
2020-11-30T09:45:43.4806751Z ##[error]Operation returned an invalid status code 'BadRequest'
2020-11-30T09:45:44.2240297Z ##[error]PowerShell exited with code '1'.
2020-11-30T09:45:45.8253302Z ##[command]Disconnect-AzAccount -Scope Process -ErrorAction Stop
2020-11-30T09:45:46.5630216Z ##[command]Clear-AzContext -Scope Process -ErrorAction Stop
2020-11-30T09:45:47.0725257Z ##[section]Finishing: Azure PowerShell script: FilePath

@Acenl12
Copy link
Author

Acenl12 commented Nov 30, 2020

We fixed it ourselves, we granted the enrollment the necessary permissions and now it works

@Acenl12 Acenl12 closed this as completed Nov 30, 2020
@ugreg
Copy link

ugreg commented Sep 22, 2022

@guidovbrakel can you provide some context of what necessary permissions you added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. Subscription
Projects
None yet
Development

No branches or pull requests

3 participants