Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
80 stars 26 forks source link

Getting subscription offer type #2184

Open RemcoRock opened 1 month ago

RemcoRock commented 1 month ago

Bicep version run bicep --version via the Bicep CLI, az bicep version via the AZ CLI or via VS code by navigating to the extensions tab and searching for Bicep Bicep CLI version 0.26.54 (5e20b29b58)

Describe the bug We try running the following code in bicep to determine the offer type of our azure subscription. Using this information, we want to deploy a virtual network peering with either our production hub or our devtest hub, expecting either a value of 'Enterprise Agreement' or 'Enterprise DevTest' or the correlating offer ID's (MS-AZR-0017P or MS-AZR-0148P, respectively)

resource currentSubscription 'Microsoft.Subscription/subscriptionDefinitions@2017-11-01-preview' existing = {
  scope: tenant()
  name: '${subscription('insertsubscriptionid')}'
}

output currentSubscription string = currentSubscription.properties.offerType

Running this code returns the following error, however: New-AzSubscriptionDeployment -Location 'West Europe' -TemplateFile '.\temp.bicep' New-AzDeployment: 10:02:44 AM - The deployment 'temp' failed with error(s). Showing 1 out of 1 error(s). Status Message: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. (Code:BadRequest)

To Reproduce Steps to reproduce the behavior: We have attempted running the same code with different subscriptions, and also tried multiple Resource Providers, to no avail.

Additional context Add any other context about the problem here.

stephaniezyen commented 1 month ago

This looks to be a Microsoft.Subscription RP issue, please open a support ticket to route this to the right team.