Azure / bicep-types-az

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

Notification Hub Namespace update failed with BadArgument Exception #2222

Open ChrWeinert opened 1 month ago

ChrWeinert commented 1 month ago

Bicep CLI version 0.28.1

We have a notification hub namespace that includes one notification hub. During the replacement of the Google fcm message support we wanted to set the new FCM v1 settings through our bicep script. Because these settings are only available in the "2023-10-01-preview" version, we updates our script to this version.

When running the deployment we get the following error

{
  "status": "Failed",
  "error": {
    "code": "BadArgument",
    "message": "Value cannot be null. (Parameter 'value')",
    "target": "value"
  }
}

Because we can´t get more detail information about this error, we made some tests within an empty resource group. We created a new notification hub namespace with a notification hub and the FCM v1 setttings. Everything works fine.

grafik

When we re-run the bicep we always get the same error. grafik

When we delete the notification hub namespace and re-run the script, everythings is working again.

It seems, there might be an issue when the deployment tries to update an existing notification hub namespace. We tried this with the API Version "2023-09-01", but the error also happens here.

Maybe someone can help us to figure out what is going wrong and how we can update our existing notification hub (namespaces) without getting this error.

Best Regards Christian


Here is the bicep script we use to reproduce the issue:

resource notificationHubNamespace 'Microsoft.NotificationHubs/namespaces@2023-10-01-preview' = {
  name: 'ntfns-mynotificationhubnamespace'
  location: resourceGroup().location
  sku: {
    name: 'Free'
  }
  properties: {
    namespaceType: 'NotificationHub'    
  }

  resource RootManageSharedAccessKeyAuthorizationRule 'AuthorizationRules' = {
    name: 'RootManageSharedAccessKey'
    properties: {
      rights: [
        'Listen'
        'Manage'
        'Send'
      ]
    }
  }

  resource notificationHub 'notificationHubs@2023-10-01-preview' = {
    name: 'ntf-myNotificationHub'
    location: resourceGroup().location

    resource DefaultFullSharedAccessSignatureAuthorizationRule 'AuthorizationRules' = {
      name: 'DefaultFullSharedAccessSignature'
      properties: {
        rights: [
          'Listen'
          'Manage'
          'Send'
        ]
      }
    }

    resource DefaultListenSharedAccessSignatureAuthorizationRule 'AuthorizationRules' = {
      name: 'DefaultListenSharedAccessSignature'
      properties: {
        rights: [
          'Listen'
        ]
      }
    }

    resource DefaultManageSendListenSharedAccessSignatureAuthorizationRule 'AuthorizationRules' = {
      name: 'DefaultManageSendListenSharedAccessSignature'
      properties: {
        rights: [
          'Listen'
          'Manage'
          'Send'
        ]
      }
    }

    resource DefaultSendListenSharedAccessSignatureAuthorizationRule 'AuthorizationRules' = {
      name: 'DefaultSendListenSharedAccessSignature'
      properties: {
        rights: [
          'Listen'
          'Send'
        ]
      }
    }

    resource DefaultSendSharedAccessSignatureAuthorizationRule 'AuthorizationRules' = {
      name: 'DefaultSendSharedAccessSignature'
      properties: {
        rights: [
          'Send'
        ]
      }
    }
  }
}
MrBear141 commented 1 month ago

I have the exact same error. This script can not be run second time:

param namespaceName string = 'namespace1'
param hubName string = 'hub1'
param location string = resourceGroup().location

resource namespaceHub 'Microsoft.NotificationHubs/namespaces@2023-09-01' = {
  name: namespaceName
  location: location
  sku: {
    name: 'Free'
  }
  properties: {
    replicationRegion: 'None'
    zoneRedundancy: 'Disabled'
  }
}

resource notificationHub 'Microsoft.NotificationHubs/namespaces/notificationHubs@2023-09-01' = {
  name: hubName
  location: location
  parent: namespaceHub
}
notaturkey commented 1 month ago

bump

stephaniezyen commented 1 month ago

Unfortunately this is an RP error, please open a support ticket with the Microsoft.NotificationHubs RP team to get this issue fixed as soon as possible. We will try to route it on our end as well.

MrBear141 commented 2 weeks ago

Well, here: https://github.com/Azure/arm-deploy/issues/235 , the issue is complitely ignored. And that is weird, as the issue seems critical. Part of our project that responsible for sendign push notifications are completely blocked, as we can not add creating azure notification as out IaC flow. is there any options how we can draw more attention to this issue? write/call to tech support or what?

alex-frankel commented 1 week ago

arm-deploy is a generic GH action for deploying any bicep/ARM templates. It's not the right place to get support for a specific resource type issue like the one you are experiencing. The best next step is to open a support ticket so this can be routed to the NotificationHubs team.

I have also shared this GH thread with the NotificationHubs Product Managers to see if they can expedite the process.

bvegso commented 1 day ago

i was recommended to revert the apiVersion for the namespace to 2017-04-01 and keep the rest at 2023-10-01-preview. it seems to re-deploy fine like that

 "resources": [
     {
       "type": "Microsoft.NotificationHubs/namespaces",
-      "apiVersion": "2023-10-01-preview",
+      "apiVersion": "2017-04-01",

while:

    {
      "type": "Microsoft.NotificationHubs/namespaces/notificationHubs",
      "apiVersion": "2023-10-01-preview",

etc.