Skip to content

Commit

Permalink
V5.3 release : (#937)
Browse files Browse the repository at this point in the history
- .NET upgrade from .NET Core 3.1 to .NET 6.0
- Updated Azure App Service app to use .NET 6.0.
- Updated Azure Function apps to use runtime version 4.x.
- Capture the sender info in the Author app.
- Bug fix for the issue with clean up function.
  • Loading branch information
v-royavinash authored Dec 14, 2022
1 parent fc5d04a commit c3ccabe
Show file tree
Hide file tree
Showing 65 changed files with 2,531 additions and 2,275 deletions.
27 changes: 19 additions & 8 deletions Deployment/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@
"AppInsightsSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('AppInsightsSecretName'))]",
"UserAppSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('UserAppSecretName'))]",
"AuthorAppSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('AuthorAppSecretName'))]",
"GraphAppSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('GraphAppSecretName'))]"
"GraphAppSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('GraphAppSecretName'))]",
"netFrameworkVersion":"v6.0"
},
"resources": [
{
Expand Down Expand Up @@ -571,7 +572,14 @@
"allowedOrigins": [
"[concat('https://', variables('frontDoorDomain'))]"
]
}
},
"metadata": [
{
"name": "CURRENT_STACK",
"value": "dotnet"
}
],
"netFrameworkVersion": "v6.0.100"
}
},
"dependsOn": [
Expand Down Expand Up @@ -666,7 +674,8 @@
"httpsOnly": true,
"siteConfig": {
"ftpsState": "Disabled",
"alwaysOn": "[not(variables('isSharedPlan'))]"
"alwaysOn": "[not(variables('isSharedPlan'))]",
"netFrameworkVersion": "[variables('netFrameworkVersion')]"
}
},
"dependsOn": [
Expand Down Expand Up @@ -710,7 +719,7 @@
"KeyVault:Url": "[variables('keyVaultUrl')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"AzureWebJobsDashboard": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('StorageAccountSecretResourceId'),'2015-06-01').secretUriWithVersion, ')')]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"FUNCTIONS_EXTENSION_VERSION": "~4",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"WEBSITE_CONTENTSHARE": "[toLower(variables('prepFunctionAppName'))]",
Expand Down Expand Up @@ -754,7 +763,8 @@
"httpsOnly": true,
"siteConfig": {
"ftpsState": "Disabled",
"alwaysOn": "[not(variables('isSharedPlan'))]"
"alwaysOn": "[not(variables('isSharedPlan'))]",
"netFrameworkVersion": "[variables('netFrameworkVersion')]"
}
},
"dependsOn": [
Expand Down Expand Up @@ -793,7 +803,7 @@
"KeyVault:Url": "[variables('keyVaultUrl')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"AzureWebJobsDashboard": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('StorageAccountSecretResourceId'),'2015-06-01').secretUriWithVersion, ')')]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"FUNCTIONS_EXTENSION_VERSION": "~4",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"WEBSITE_CONTENTSHARE": "[toLower(variables('sendFunctionAppName'))]",
Expand Down Expand Up @@ -835,7 +845,8 @@
"httpsOnly": true,
"siteConfig": {
"ftpsState": "Disabled",
"alwaysOn": "[not(variables('isSharedPlan'))]"
"alwaysOn": "[not(variables('isSharedPlan'))]",
"netFrameworkVersion": "[variables('netFrameworkVersion')]"
}
},
"dependsOn": [
Expand Down Expand Up @@ -875,7 +886,7 @@
"KeyVault:Url": "[variables('keyVaultUrl')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"AzureWebJobsDashboard": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('StorageAccountSecretResourceId'),'2015-06-01').secretUriWithVersion, ')')]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"FUNCTIONS_EXTENSION_VERSION": "~4",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"WEBSITE_CONTENTSHARE": "[toLower(variables('dataFunctionAppName'))]",
Expand Down
27 changes: 19 additions & 8 deletions Deployment/azuredeploywithcert.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@
"AppInsightsSecretName": "[concat(variables('keyVaultName'),'AppInsightsKey')]",
"StorageAccountSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('StorageAccountSecretName'))]",
"ServiceBusSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('ServiceBusSecretName'))]",
"AppInsightsSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('AppInsightsSecretName'))]"
"AppInsightsSecretResourceId": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'), variables('AppInsightsSecretName'))]",
"netFrameworkVersion": "v6.0"
},
"resources": [
{
Expand Down Expand Up @@ -571,7 +572,14 @@
"allowedOrigins": [
"[concat('https://', variables('frontDoorDomain'))]"
]
}
},
"metadata": [
{
"name": "CURRENT_STACK",
"value": "dotnet"
}
],
"netFrameworkVersion": "v6.0.100"
}
},
"dependsOn": [
Expand Down Expand Up @@ -665,7 +673,8 @@
"httpsOnly": true,
"siteConfig": {
"ftpsState": "Disabled",
"alwaysOn": "[not(variables('isSharedPlan'))]"
"alwaysOn": "[not(variables('isSharedPlan'))]",
"netFrameworkVersion": "[variables('netFrameworkVersion')]"
}
},
"dependsOn": [
Expand Down Expand Up @@ -709,7 +718,7 @@
"KeyVault:Url": "[variables('keyVaultUrl')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"AzureWebJobsDashboard": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('StorageAccountSecretResourceId'),'2015-06-01').secretUriWithVersion, ')')]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"FUNCTIONS_EXTENSION_VERSION": "~4",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"WEBSITE_CONTENTSHARE": "[toLower(variables('prepFunctionAppName'))]",
Expand Down Expand Up @@ -753,7 +762,8 @@
"httpsOnly": true,
"siteConfig": {
"ftpsState": "Disabled",
"alwaysOn": "[not(variables('isSharedPlan'))]"
"alwaysOn": "[not(variables('isSharedPlan'))]",
"netFrameworkVersion": "[variables('netFrameworkVersion')]"
}
},
"dependsOn": [
Expand Down Expand Up @@ -796,7 +806,7 @@
"KeyVault:Url": "[variables('keyVaultUrl')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"AzureWebJobsDashboard": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('StorageAccountSecretResourceId'),'2015-06-01').secretUriWithVersion, ')')]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"FUNCTIONS_EXTENSION_VERSION": "~4",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"WEBSITE_CONTENTSHARE": "[toLower(variables('sendFunctionAppName'))]",
Expand Down Expand Up @@ -838,7 +848,8 @@
"httpsOnly": true,
"siteConfig": {
"ftpsState": "Disabled",
"alwaysOn": "[not(variables('isSharedPlan'))]"
"alwaysOn": "[not(variables('isSharedPlan'))]",
"netFrameworkVersion": "[variables('netFrameworkVersion')]"
}
},
"dependsOn": [
Expand Down Expand Up @@ -880,7 +891,7 @@
"KeyVault:Url": "[variables('keyVaultUrl')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"AzureWebJobsDashboard": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('StorageAccountSecretResourceId'),'2015-06-01').secretUriWithVersion, ')')]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"FUNCTIONS_EXTENSION_VERSION": "~4",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2015-05-01-preview').key1)]",
"WEBSITE_CONTENTSHARE": "[toLower(variables('dataFunctionAppName'))]",
Expand Down
65 changes: 65 additions & 0 deletions Deployment/dotnet6-migration.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
function UpdateAzureFunctions {
param(
[Parameter(Mandatory = $true)] [string] $subscriptionId,
[Parameter(Mandatory = $true)] [string] $resourceGroupName,
[Parameter(Mandatory = $true)] [string] $baseResourceName
)

try{
$prepFunctionName = $baseResourceName + "-prep-function"
$sendFunctionName = $baseResourceName + "-function"
$dataFunctionName = $baseResourceName + "-data-function"

Write-Host "Please login with your Azure subscription account"
az login
az account set -s $subscriptionId
Write-Host "Successfully logged in to Azure Subscription " -ForegroundColor Green

Write-Host "****************************************************************************************************************************************************************************************************************************"
Write-Host "Updating prep function to .NET 6 : $prepFunctionName"
az functionapp config set --net-framework-version v6.0 -n $prepFunctionName -g $resourceGroupName
Write-Host "Completed updating prep function to .NET 6 : $prepFunctionName" -ForegroundColor Green

Write-Host "****************************************************************************************************************************************************************************************************************************"
Write-Host "Updating send function to .NET 6 : $sendFunctionName"
az functionapp config set --net-framework-version v6.0 -n $sendFunctionName -g $resourceGroupName
Write-Host "Completed updating send function to .NET 6 : $sendFunctionName" -ForegroundColor Green

Write-Host "****************************************************************************************************************************************************************************************************************************"
Write-Host "Updating data function to .NET 6 : $dataFunctionName"
az functionapp config set --net-framework-version v6.0 -n $dataFunctionName -g $resourceGroupName
Write-Host "Completed updating data function to .NET 6 : $dataFunctionName" -ForegroundColor Green
}
catch {
$errorMessage = $_.Exception.Message
Write-Host "Failed to update the Azure functions. Error message: $errorMessage" -ForegroundColor Red
}
}


function UpdateAzureAppService {
param(
[Parameter(Mandatory = $true)] [string] $resourceGroupName,
[Parameter(Mandatory = $true)] [string] $baseResourceName
)

try{

Write-Host "****************************************************************************************************************************************************************************************************************************"
Write-Host "Updating app service to .NET 6 $baseResourceName"
az webapp config set --net-framework-version v6.0 -n $baseResourceName -g $resourceGroupName
Write-Host "Completed updating app service to .NET 6 $baseResourceName" -ForegroundColor Green
}
catch {
$errorMessage = $_.Exception.Message
Write-Host "Failed to update the app service $baseResourceName. Error message: $errorMessage" -ForegroundColor Red
}
}

$subscriptionId = Read-Host "Please enter the subscription id of the resources where Company Communicator deployed"
$resourceGroupName = Read-Host "Please enter the resource group name"
$baseResourceName = Read-Host "Please enter the base resource name used"

UpdateAzureFunctions -subscriptionId $subscriptionId -resourceGroupName $resourceGroupName -baseResourceName $baseResourceName
UpdateAzureAppService -resourceGroupName $resourceGroupName -baseResourceName $baseResourceName

2 changes: 1 addition & 1 deletion Manifest/manifest_authors.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "5.2.0",
"version": "5.3.0",
"id": "1c07cd26-a088-4db8-8928-ace382fa219f",
"packageName": "com.microsoft.teams.companycommunicator.authors",
"developer": {
Expand Down
2 changes: 1 addition & 1 deletion Manifest/manifest_users.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "5.2.0",
"version": "5.3.0",
"id": "148a66bb-e83d-425a-927d-09f4299a9274",
"packageName": "com.microsoft.teams.companycommunicator",
"developer": {
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Begin with the [Solution overview](https://github.com/OfficeDev/microsoft-teams-

When you're ready to try out Company Communicator, or to use it in your own organization, you can choose to follow one of the below guides.
* [Deployment guide powershell](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-powershell).
* **Recommended** Use this option to deploy the Company Communicator v5.2 using powershell script. The entire set-up is done by the powershell script.
* **Recommended** Use this option to deploy the latest version of Company Communicator using powershell script. The entire set-up is done by the powershell script.
* [Deployment guide](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide).
* Use this option to deploy the Company Communicator v5.2 with client secrets.
* Use this option to deploy the latest version of Company Communicator with client secrets.
* [Deployment guide certificate](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-certificate).
* Use this option to deploy the Company Communicator v5.2 with certificates.
* Use this option to deploy the latest version of Company Communicator with certificates.

## Migration

If you already have older version of Company Communicator installed, then please use this [v5 migration guide](https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/wiki/v5-migration-guide). Please note that deploying the major version update, like Company Communicator version 5.2 involves more than syncing the App Service and Azure Functions, so plan to review the migration guide before migrating to latest.
If you already have older version of Company Communicator installed, then please use this [v5 migration guide](https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/wiki/v5-migration-guide). Please note that deploying the major version update, like Company Communicator version 5.3 involves more than syncing the App Service and Azure Functions, so plan to review the migration guide before migrating to latest.

Migrating to newer versions.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.1.2" />
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.2.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.8.3" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.22" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.1" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="5.1.3" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.12.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
<PackageReference Include="Microsoft.Graph" Version="3.22.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.30.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Polly" Version="7.2.1" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,13 @@ public async Task<IEnumerable<T>> GetAllAsync(string partition = null, int? coun
}

/// <inheritdoc/>
public async Task<IEnumerable<T>> GetAllLessThanDateTimeAsync(DateTime dateTime)
public async Task<IEnumerable<T>> GetAllBetweenDateTimesAsync(DateTime startDateTime, DateTime endDateTime)
{
var filterByDate = TableQuery.GenerateFilterConditionForDate("Timestamp", QueryComparisons.LessThanOrEqual, dateTime);
var filterByDate = TableQuery.CombineFilters(
TableQuery.GenerateFilterConditionForDate(
"Timestamp", QueryComparisons.LessThanOrEqual, startDateTime), TableOperators.And,
TableQuery.GenerateFilterConditionForDate(
"Timestamp", QueryComparisons.GreaterThanOrEqual, endDateTime));

var query = new TableQuery<T>().Where(filterByDate);

Expand Down
5 changes: 3 additions & 2 deletions Source/CompanyCommunicator.Common/Repositories/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ public interface IRepository<T>
/// <summary>
/// Get filtered data entities by date time from the table storage.
/// </summary>
/// <param name="dateTime">less than date time.</param>
/// <param name="startDateTime">Start date time.</param>
/// <param name="endDateTime">End date time.</param>
/// <returns>Filtered data entities.</returns>
public Task<IEnumerable<T>> GetAllLessThanDateTimeAsync(DateTime dateTime);
public Task<IEnumerable<T>> GetAllBetweenDateTimesAsync(DateTime startDateTime, DateTime endDateTime);

/// <summary>
/// Get all data stream from the table storage in a partition.
Expand Down
Loading

0 comments on commit c3ccabe

Please sign in to comment.