Currently CC allows authors to select from four audience options, including posting to the general channel of a team, sending individual messages to all users, to members of a team or to members of specific M365, security and/or distribution groups.
Recently I got a very large customer requesting the ability to upload a CSV file with a list of users to send notifications. That allows to create a custom audience for notifications and doesn’t require any admin involvement to create and populate groups on Azure Active Directory.
An additional change recently incorporated was the merge to the 4.1.5 official code. So the Company Communicator variant you see at https://github.com/cristianoag/microsoft-teams-apps-company-communicator already is updated with the latest official code.
Uploading CSV files to create the audience
You can open the CC authoring console and create the notification as you (or content authors) are used to do. When selecting the audience there will be a new option to send chat to users listed in a valid CSV file.
You can then click on the upload button and select a CSV file. A valid CSV file is a list of user principal names (UPNs) separated by commas (,). Please be aware that when creating a list of UPNs in Excel with one user per line and saving as a CSV, you don’t get a valid CSV file. You need to transpose the list to multiple columns and then saving the file to get a valid CSV.
The interface will make a basic syntax analysis to ensure the CSV file is valid before let you use it. If something is wrong, you will see an error message and the authoring interface won’t let you move forward.
After uploading the CSV file correctly you will have the chance to save or schedule the message depending on the other options you selected.
When you send the draft message you will get basic information showing that the message will be sent to an audience formed by users listed on the CSV file.
After sending the message and have all messages delivered, you can click on the message that should be part of the sent messages list and you will get additional statistics and a message showing more info about the audience.
When sending the message, the system does a deep analysis on each UPN listed on the file. That is to ensure users are valid for the specific tenant where Company Communicator is installed. All users considered invalid will be ignored by CC and only the valid ones will receive messages. Reports can be used to compare your CSV file with the list of users that got messages delivered.
Update
First of all, make sure you have at least the 4.1 version deployed (remember that this update will bring your deployment to 4.1.5), then follow the steps below to update the App Service and the three Azure Functions used by Company Communicator.
- Open your Azure Portal and authenticate using admin credentials.
- Open the resource group where you installed Company Communicator.
- Select the App Service being used by CC and click on Deployment Center, under Deployment.
- In Settings, click Disconnect under External Git.
- Click OK to disconnect your deployment.
- Under Source, select External Git.
- In Repository, type https://github.com/cristianoag/microsoft-teams-apps-company-communicator.git
- In Branch, type master
- Leave the Repository Type as Public, and click Save.
- Click Sync.
- The whole update process will take a few minutes. Make sure you see Success (Active) on the logs tab.
- Now repeat that for each one of the Azure Functions you have on the same resource group. Those are the resources listed as:
- <ccname>-data-function
- <ccname>-function
- <ccname>-prep-function
Final Notes
Please be aware that this is side project where myself and others dedicate time to bring to life super requested Company Communicator features. We are not officially maintaining neither supporting Company Communicator. That is the reason you see a user repo with the improvements.
We want to informally dedicate time and create a fast track to new requested features in the spirit of open source.
Enjoy this new feature!
Disclaimer – The information contained in this blog post doesn’t represent the official Microsoft guidance or best practices. It is just the view of the author on current alternatives, implementations and workarounds for common issues and/or business needs. Please refer to official Microsoft documentation and evaluate carefully any steps, code or procedures documented herein. The author doesn’t offer any warranty. Use this information at your own risk.
November 11, 2021 at 5:40 pm
So if we are already pointing all the resources to your repo ( https://github.com/cristianoag/microsoft-teams-apps-company-communicator.git), do we have to disconnect everything again (your “Update” process listed) to get the newest updates every time or can we just sync\restart things?
November 18, 2021 at 10:07 pm
Just a resync is enough.
November 22, 2021 at 3:20 am
Hi Cristiano, the CSV option was an excellent addition. I just need a little help on how to get it to accept csv file created through excel. From your instructions i created the csv file in excel as it looks below, is this correct ? But when i saved and tried to attach it still indicates the file is invalid.
A B
1 | motupa@email.com | James@email.com |
2 | | |
3 | | |
4 | | |
November 22, 2021 at 5:28 am
Check your file. It needs to have a single line with all users separated by commas “,”. I suspect due to regional settings your separator is not a comma.
February 28, 2022 at 7:15 am
Hi Cristiano, you suggest to create a notepad file with all users separated by comma and save file as .csv?
December 6, 2021 at 5:29 pm
Is there a limit to the number of users that can be in the .CSV file?
We tried to send a message to around 80 users and the “Syncing Recipients” process hung.
When we looked in the “PrepareToSendFunctionTaskHubInstances” table, there was an error:
“Orchestrator function ‘SyncRecipientsOrchestrator’ failed: The activity function ‘SyncCSVActivity’ failed: “Exception of type ‘Microsoft.Azure.Cosmos.Table.StorageException’ was thrown.”. See the function execution logs for additional details.”
Thank you for these awesome updates to the base version of the tool!
December 6, 2021 at 11:07 pm
Yeah. The limit is defined by the size of your message. The whole record on the database needs to be smaller than 32kb. So if you are uploading an image you will have less room to load a big csv. I’ll review the code tomorrow and try to have a message based on the current size of the record. To solve this I would need to store the csv file in a different database table. Maybe in the future.
December 7, 2021 at 12:24 pm
That makes sense. That you very much!
December 7, 2021 at 7:01 pm
I checked the code and I can provide a message during CSV validation based on the possible remaining space. That is going to be a temporary solution until I can change the code to use a database instead of just store the list of users together on the messages table.
February 11, 2022 at 7:01 am
Hi Cristiano,
First of all great work. I successfully deployed this and used the .csv. A week later I try again and is now throwing below error despite using the same .csv as previous success. Nothing was changed. Any clue what the error maybe?
Failed to prepare the message for sending:The orchestrator function ‘SyncRecipientsOrchestrator’ failed: “The activity function ‘SyncCSVActivity’ failed: “Value cannot be null. (Parameter ‘rowkey’)”. See the function execution logs for additional details.”. See the function execution logs for additional details.
February 11, 2022 at 7:55 am
Can you share the function logs? Maybe I missed a null check somewhere. It seems the csv file has an empty or null value. Can you test using a smaller file just to see if the function is failing for all files of just for a specific one?
February 13, 2022 at 11:11 pm
Thanks Cristiano for your reply.
I am actually using same .csv list (around 4 persons) that I have had successful execution for a few times 2 weeks prior (Jan 26); but starting to failed on Feb 08. I also tried .csv w/ only 1 person and its same error. Is the function logs in the Azure Admin side? I will ask our admin to retrieve.
April 18, 2022 at 6:09 am
Thank you so much for this much needed function.
Somehow i am only able to select the .csv after i saved it once in draft.
Is this the right procedure?