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

'Microsoft.Subscription/aliases@2021-10-01' - No . allowed in name #2171

Open
BramVandendaele opened this issue May 15, 2024 · 2 comments
Open

Comments

@BramVandendaele
Copy link

Bicep version
Bicep CLI v0.27.1

Describe the bug
When trying to create a subscription alias. When using a . in the name. I receive an error that the resource cannot be found. When replacing the '.' with a '-'. Then it works.

To Reproduce
When deploying the module like below:
param subscriptionName string = 'test.subscription.name'

resource subscription 'Microsoft.Subscription/aliases@2021-10-01' = {
  name: subscriptionName
  scope: tenant()
  properties: {
    billingScope: billingAccount
    displayName: subscriptionName
    workload: 'Production'
    additionalProperties: {
     managementGroupId: managementGroupId
   }
  }

error received below:

{"code":"DeploymentFailed","target":"/providers/Microsoft.Management/managementGroups/xxxxxxx/providers/Microsoft.Resources/deployments/xxxxxx","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","message":"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."}]}

When using
param subscriptionName string = 'test-subscription-name'

there is no error anymore.

Additional context
Add any other context about the problem here.

@slavizh
Copy link

slavizh commented May 15, 2024

This is nor bicep bug not a bug on the resource provider. If I am not mistaken quite majority of resource providers does not allow using . in the name of the resource.

@slavizh
Copy link

slavizh commented May 15, 2024

Note that alias name and displayName are two different properties. They do not have to be the same. The alias name is the name of the alias resource. displayName will be the name of the subscription. The display name of the subscription most likely allows using . as that is display name, not resource name.

@stephaniezyen stephaniezyen transferred this issue from Azure/bicep May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants