diff --git a/Deployment/DOD/azuredeploy.json b/Deployment/DOD/azuredeploy.json index 2f240e4c0..a1557dc08 100644 --- a/Deployment/DOD/azuredeploy.json +++ b/Deployment/DOD/azuredeploy.json @@ -284,6 +284,8 @@ "hostingPlanName": "[parameters('baseResourceName')]", "storageAccountName": "[uniquestring(concat(resourceGroup().id, parameters('baseResourceName')))]", "appInsightsName": "[parameters('baseResourceName')]", + "workspaceAnalyticsName": "[concat(parameters('baseResourceName'), '-log-analytics')]", + "workspaceAnalyticsSku": "pergb2018", "prepFunctionAppName": "[concat(parameters('baseResourceName'), '-prep-function')]", "sendFunctionAppName": "[concat(parameters('baseResourceName'), '-function')]", "dataFunctionAppName": "[concat(parameters('baseResourceName'), '-data-function')]", @@ -474,16 +476,31 @@ } }, { - "apiVersion": "2015-05-01", - "name": "[variables('appInsightsName')]", + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2017-03-15-preview", + "name": "[variables('workspaceAnalyticsName')]", + "location": "[parameters('location')]", + "properties": { + "sku": { + "name": "[variables('workspaceAnalyticsSku')]" + } + } + }, + { "type": "Microsoft.Insights/components", + "apiVersion": "2020-02-02-preview", + "name": "[variables('appInsightsName')]", "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" + ], "tags": { - "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" + "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" }, "properties": { - "Application_Type": "web", - "Request_Source": "rest" + "Application_Type": "web", + "Request_Source": "rest", + "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" } }, { diff --git a/Deployment/GCC/botazuredeploy.json b/Deployment/GCC/botazuredeploy.json index 931d37cfb..a7c8ce354 100644 --- a/Deployment/GCC/botazuredeploy.json +++ b/Deployment/GCC/botazuredeploy.json @@ -56,20 +56,37 @@ "botAppName": "[parameters('baseResourceName')]", "botAppDomain": "[concat(variables('botAppName'), '.azurewebsites.us')]", "botAppUrl": "[concat('https://', variables('botAppDomain'))]", - "appInsightsName": "[parameters('baseResourceName')]" + "appInsightsName": "[parameters('baseResourceName')]", + "workspaceAnalyticsName": "[concat(parameters('baseResourceName'), '-log-analytics')]", + "workspaceAnalyticsSku": "pergb2018" }, "resources": [ { - "apiVersion": "2015-05-01", - "name": "[variables('appInsightsName')]", + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2017-03-15-preview", + "name": "[variables('workspaceAnalyticsName')]", + "location": "[resourceGroup().location]", + "properties": { + "sku": { + "name": "[variables('workspaceAnalyticsSku')]" + } + } + }, + { "type": "Microsoft.Insights/components", + "apiVersion": "2020-02-02-preview", + "name": "[variables('appInsightsName')]", "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" + ], "tags": { - "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" + "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" }, "properties": { - "Application_Type": "web", - "Request_Source": "rest" + "Application_Type": "web", + "Request_Source": "rest", + "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" } }, { diff --git a/Deployment/GCCH/azuredeploy.json b/Deployment/GCCH/azuredeploy.json index 928ba201d..6f16c14d1 100644 --- a/Deployment/GCCH/azuredeploy.json +++ b/Deployment/GCCH/azuredeploy.json @@ -284,6 +284,8 @@ "hostingPlanName": "[parameters('baseResourceName')]", "storageAccountName": "[uniquestring(concat(resourceGroup().id, parameters('baseResourceName')))]", "appInsightsName": "[parameters('baseResourceName')]", + "workspaceAnalyticsName": "[concat(parameters('baseResourceName'), '-log-analytics')]", + "workspaceAnalyticsSku": "pergb2018", "prepFunctionAppName": "[concat(parameters('baseResourceName'), '-prep-function')]", "sendFunctionAppName": "[concat(parameters('baseResourceName'), '-function')]", "dataFunctionAppName": "[concat(parameters('baseResourceName'), '-data-function')]", @@ -474,16 +476,31 @@ } }, { - "apiVersion": "2015-05-01", - "name": "[variables('appInsightsName')]", + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2017-03-15-preview", + "name": "[variables('workspaceAnalyticsName')]", + "location": "[parameters('location')]", + "properties": { + "sku": { + "name": "[variables('workspaceAnalyticsSku')]" + } + } + }, + { "type": "Microsoft.Insights/components", + "apiVersion": "2020-02-02-preview", + "name": "[variables('appInsightsName')]", "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" + ], "tags": { - "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" + "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" }, "properties": { - "Application_Type": "web", - "Request_Source": "rest" + "Application_Type": "web", + "Request_Source": "rest", + "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" } }, { diff --git a/Deployment/applicationinsights-migration.ps1 b/Deployment/applicationinsights-migration.ps1 new file mode 100644 index 000000000..0dfcce169 --- /dev/null +++ b/Deployment/applicationinsights-migration.ps1 @@ -0,0 +1,67 @@ +function CreateLogAnalyticsWorkspace { + param( + [Parameter(Mandatory = $true)] [string] $subscriptionId, + [Parameter(Mandatory = $true)] [string] $resourceGroupName, + [Parameter(Mandatory = $true)] [string] $baseResourceName + ) + + try{ + $workspaceName = $baseResourceName + "-log-analytics" + + Import-Module Az.OperationalInsights + 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 "Getting resource group location" + $rgLocation = (Get-AzResourceGroup -Name $resourceGroupName).location + Write-Host "Successfully got the resource group location " -ForegroundColor Green + + + Write-Host "****************************************************************************************************************************************************************************************************************************" + Write-Host "Creating Log Analytics Workspace" + New-AzOperationalInsightsWorkspace -Location $rgLocation -Name $workspaceName -ResourceGroupName $resourceGroupName + Write-Host "Successfully created Log Analytics Workspace : $WorkspaceName" -ForegroundColor Green + +} +catch { + $errorMessage = $_.Exception.Message + Write-Host "Failed to create the Log Analytics Workspace. Error message: $errorMessage" -ForegroundColor Red + } +} + + +function UpdateClassicAppInsights { + param( + [Parameter(Mandatory = $true)] [string] $resourceGroupName, + [Parameter(Mandatory = $true)] [string] $baseResourceName + ) + + try{ + + $workspaceName = $baseResourceName + "-log-analytics" + + Write-Host "****************************************************************************************************************************************************************************************************************************" + Write-Host "Getting resource id for log analytics workspace" + $workspaceResourceId = (Get-AzOperationalInsightsWorkspace -ResourceGroupName $resourceGroupName -Name $workspaceName).ResourceId + Write-Host "Successfully got the resource id for log analytics workspace " -ForegroundColor Green + + Write-Host "****************************************************************************************************************************************************************************************************************************" + Write-Host "Updating classic application insights to workspace based application insights" + Update-AzApplicationInsights -Name $baseResourceName -ResourceGroupName $resourceGroupName -IngestionMode LogAnalytics -WorkspaceResourceId $workspaceResourceId + Write-Host "Successfully migrated the classic application insights to workspace based application insights $baseResourceName" -ForegroundColor Green +} +catch { + $errorMessage = $_.Exception.Message + Write-Host "Failed to update the classic application insights $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" + + +CreateLogAnalyticsWorkspace -subscriptionId $subscriptionId -resourceGroupName $resourceGroupName -baseResourceName $baseResourceName +UpdateClassicAppInsights -resourceGroupName $resourceGroupName -baseResourceName $baseResourceName diff --git a/Deployment/azuredeploy.json b/Deployment/azuredeploy.json index 5ff82d861..072b5347f 100644 --- a/Deployment/azuredeploy.json +++ b/Deployment/azuredeploy.json @@ -284,6 +284,8 @@ "hostingPlanName": "[parameters('baseResourceName')]", "storageAccountName": "[uniquestring(concat(resourceGroup().id, parameters('baseResourceName')))]", "appInsightsName": "[parameters('baseResourceName')]", + "workspaceAnalyticsName": "[concat(parameters('baseResourceName'), '-log-analytics')]", + "workspaceAnalyticsSku": "pergb2018", "prepFunctionAppName": "[concat(parameters('baseResourceName'), '-prep-function')]", "sendFunctionAppName": "[concat(parameters('baseResourceName'), '-function')]", "dataFunctionAppName": "[concat(parameters('baseResourceName'), '-data-function')]", @@ -461,16 +463,31 @@ } }, { - "apiVersion": "2015-05-01", - "name": "[variables('appInsightsName')]", + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2017-03-15-preview", + "name": "[variables('workspaceAnalyticsName')]", + "location": "[parameters('location')]", + "properties": { + "sku": { + "name": "[variables('workspaceAnalyticsSku')]" + } + } + }, + { "type": "Microsoft.Insights/components", + "apiVersion": "2020-02-02-preview", + "name": "[variables('appInsightsName')]", "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" + ], "tags": { - "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" + "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" }, "properties": { - "Application_Type": "web", - "Request_Source": "rest" + "Application_Type": "web", + "Request_Source": "rest", + "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" } }, { diff --git a/Deployment/azuredeploywithcert.json b/Deployment/azuredeploywithcert.json index 966dc66cc..1ac5f9222 100644 --- a/Deployment/azuredeploywithcert.json +++ b/Deployment/azuredeploywithcert.json @@ -290,6 +290,8 @@ "hostingPlanName": "[parameters('baseResourceName')]", "storageAccountName": "[uniquestring(concat(resourceGroup().id, parameters('baseResourceName')))]", "appInsightsName": "[parameters('baseResourceName')]", + "workspaceAnalyticsName": "[concat(parameters('baseResourceName'), '-log-analytics')]", + "workspaceAnalyticsSku": "pergb2018", "prepFunctionAppName": "[concat(parameters('baseResourceName'), '-prep-function')]", "sendFunctionAppName": "[concat(parameters('baseResourceName'), '-function')]", "dataFunctionAppName": "[concat(parameters('baseResourceName'), '-data-function')]", @@ -460,19 +462,34 @@ "capacity": 0 } }, - { - "apiVersion": "2015-05-01", - "name": "[variables('appInsightsName')]", - "type": "Microsoft.Insights/components", + { + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2017-03-15-preview", + "name": "[variables('workspaceAnalyticsName')]", "location": "[parameters('location')]", - "tags": { - "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" - }, "properties": { - "Application_Type": "web", - "Request_Source": "rest" + "sku": { + "name": "[variables('workspaceAnalyticsSku')]" + } } }, + { + "type": "Microsoft.Insights/components", + "apiVersion": "2020-02-02-preview", + "name": "[variables('appInsightsName')]", + "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" + ], + "tags": { + "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('botAppName'))]": "Resource" + }, + "properties": { + "Application_Type": "web", + "Request_Source": "rest", + "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceAnalyticsName'))]" + } + }, { "apiVersion": "2021-03-01", "name": "[variables('authorBotName')]", diff --git a/Manifest/manifest_authors.json b/Manifest/manifest_authors.json index 6c29c17fa..49bde92a4 100644 --- a/Manifest/manifest_authors.json +++ b/Manifest/manifest_authors.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json", "manifestVersion": "1.5", - "version": "5.5", + "version": "5.5.1", "id": "1c07cd26-a088-4db8-8928-ace382fa219f", "packageName": "com.microsoft.teams.companycommunicator.authors", "developer": { diff --git a/Manifest/manifest_users.json b/Manifest/manifest_users.json index 178012425..212b19509 100644 --- a/Manifest/manifest_users.json +++ b/Manifest/manifest_users.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json", "manifestVersion": "1.5", - "version": "5.5", + "version": "5.5.1", "id": "148a66bb-e83d-425a-927d-09f4299a9274", "packageName": "com.microsoft.teams.companycommunicator", "developer": { diff --git a/Source/CompanyCommunicator/ClientApp/package.json b/Source/CompanyCommunicator/ClientApp/package.json index 23e34f908..2454153c6 100644 --- a/Source/CompanyCommunicator/ClientApp/package.json +++ b/Source/CompanyCommunicator/ClientApp/package.json @@ -1,6 +1,6 @@ { "name": "company-communicator", - "version": "5.4.1", + "version": "5.5.1", "private": true, "dependencies": { "@fluentui/react": "^8.110.3", diff --git a/Wiki/Cost-estimate.md b/Wiki/Cost-estimate.md index 62d5edbdb..86b5e711e 100644 --- a/Wiki/Cost-estimate.md +++ b/Wiki/Cost-estimate.md @@ -19,6 +19,11 @@ We ignore: The recommended SKUs for a production environment are: * App Service: Standard (S2) * Service Bus: Basic +* Workspace-basd Application Insights: + This Application Insights resource is sending its data to a Log Analytics workspace. + The log Analytics workspace offers Pay-as-you-go pricing tier as it offers flexible consumption pricing in which charged per GB of data ingested - + * Analytics Logs data ingestion - **$2.30/GB** of data ingested per month + * Basic Logs data ingestion - **$0.50/GB** of data ingested per month ## Estimated load @@ -70,8 +75,8 @@ App Service (Bot + Tab) | - | Azure Function | Dedicated | 10000 executions | (free up to 1 million executions) Service Bus | Basic | 10000 operations | $0.01 Azure Front Door | Azure Front Door Classic | < 1GB data transfer, 2 routing rules | $0.50 + $0.01 + $43.65 = $44.16 -Application Insights | - | < 5GB data | $0.02 -**Total** | | | **$190.58** +Log Analytics Workspace (App Insights) | - | < 1GB data ingested | $2.30 +**Total** | | | **$192.86** ## Estimated load - 1M messages @@ -124,8 +129,8 @@ App Service (Bot + Tab) | - | Azure Function | Dedicated | 1M executions | (free up to 1 million executions) Service Bus | Basic | 2M executions | $0.10 Azure Front Door | Azure Front Door Classic | < 3GB data transfer, 2 routing rules | $0.50 + $0.03 + $43.65 = $44.18 -Application Insights | - | < 5GB data | $0.02 -**Total** | | | **$191.10** +Log Analytics Workspace (App Insights) | - | < 1GB data ingested | $2.30 +**Total** | | | **$193.38** ## Estimated load - 2M messages @@ -177,5 +182,5 @@ App Service (Bot + Tab) | - | Azure Function | Dedicated | 2M executions | $5.80 Service Bus | Basic | 2M executions | $0.10 Azure Front Door | Azure Front Door Classic | < 3GB data transfer, 2 routing rules | $0.50 + $0.03 + $43.65 = $44.18 -Application Insights | - | < 5GB data | $0.02 -**Total** | | | **$197.36** \ No newline at end of file +Log Analytics Workspace (App Insights) | - | < 1GB data ingested | $2.30 +**Total** | | | **$199.64** \ No newline at end of file diff --git a/Wiki/Release-notes.md b/Wiki/Release-notes.md index 214958aeb..721a5d43d 100644 --- a/Wiki/Release-notes.md +++ b/Wiki/Release-notes.md @@ -6,6 +6,7 @@ Cumulative improvements in Company Communicator App. |Version |Release Date | |---|---| +| 5.5.1 | Feb 22, 2024 | 5.5 | Sep 20, 2023 | 5.4.1 | June 14, 2023 | 5.4 | May 10, 2023 @@ -27,6 +28,10 @@ Cumulative improvements in Company Communicator App. | 1.0 | Dec 20, 2019 ### Company Communicator feature release notes +#### 5.5.1 (February 22, 2024) +##### Changes introduced +- Migration of classic Application Insights to workspace-based Application Insights. + #### 5.5 (September 14, 2023) ##### Changes introduced - Mobile Support for Android and iOS. diff --git a/Wiki/Support-policy.md b/Wiki/Support-policy.md new file mode 100644 index 000000000..2d615db85 --- /dev/null +++ b/Wiki/Support-policy.md @@ -0,0 +1,31 @@ +## Help and Improvements +### For Company Communicator users + +Hello users, Welcome to the **Company Communicator** support page. Please read our support policies below, + +#### Support Policy: Official Versions Only +We are committed to giving our users excellent help while keeping our application secure and dependable. + +#### Our Pledge to You: +- **Reliable Assistance:** We are committed to promptly addressing any issues or inquiries you might encounter with our official versions. +- **Transparent Communication:** We will keep you informed of any updates, fixes, and suggestions to enhance your experience. + +#### Our Support Scope: +To ensure the highest quality of service, we focus our support efforts on official versions of our application. Here is why: +- **Challenges with Custom Versions:** We respect the originality and ingenuity of custom versions, but our focus is on the official releases of *Company Communicator*. Therefore, we might not be able to offer extensive support for custom builds. + +#### How You Can Help Us Help You: +For the smoothest support experience, we kindly ask for your cooperation: +1. **Stick to Official Versions:** Whenever possible, utilize the official releases of *Company Communicator* for our full support capabilities. +2. **Give Specific Details:** When asking for help, please provide relevant information such as the version number and a detailed explanation of the problem. + +For assistance or inquiries, you can reach out to our support team by opening a new issue on *Company Communicator* [GitHub Issue page](https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/issues). + +**Please Switch to [our latest version](https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/wiki/v5-migration-guide) to get the most recent updates from Company Communicator.** + +## For owners of personalized Company Communicator editions + +If you are using modified versions of Company Communicator, you may need to adjust your code base to stay current with the latest updates from the official repo. Here are the principal areas that have been impacted by the recent updates: + +- **Authorization problem:** Version 5.5 has been launched by the official repo to address the authorization issue that happened when the redirect removed the Authorization header. This version offers a temporary solution. We are currently developing a permanent fix for this issue, which might involve some changes in Azure front door routing rules. Please be aware that a permanent fix for this will be posted on GitHub in the next few weeks. +- **Application Insights migration:** The official repo has moved to workspace-based Application Insights, as the classic Application Insights in Azure Monitor will be retired on 29 February 2024. This version creates a new Log Analytics workspace as part of version 5.5.1. For details, please refer to the [We’re retiring Classic Application Insights on 29 February 2024](https://azure.microsoft.com/en-us/updates/we-re-retiring-classic-application-insights-on-29-february-2024/). \ No newline at end of file diff --git a/Wiki/images/appinsights-migration-execution.png b/Wiki/images/appinsights-migration-execution.png new file mode 100644 index 000000000..784f1d3b3 Binary files /dev/null and b/Wiki/images/appinsights-migration-execution.png differ diff --git a/Wiki/images/create-log-analytics.png b/Wiki/images/create-log-analytics.png new file mode 100644 index 000000000..b257b7880 Binary files /dev/null and b/Wiki/images/create-log-analytics.png differ diff --git a/Wiki/images/log-analytics-overview-page.png b/Wiki/images/log-analytics-overview-page.png new file mode 100644 index 000000000..105c8b516 Binary files /dev/null and b/Wiki/images/log-analytics-overview-page.png differ diff --git a/Wiki/images/migrate-appinsights.png b/Wiki/images/migrate-appinsights.png new file mode 100644 index 000000000..da9cdb7c8 Binary files /dev/null and b/Wiki/images/migrate-appinsights.png differ diff --git a/Wiki/images/migrated-appinsights-overview.png b/Wiki/images/migrated-appinsights-overview.png new file mode 100644 index 000000000..a913edfaa Binary files /dev/null and b/Wiki/images/migrated-appinsights-overview.png differ diff --git a/Wiki/v5-migration-guide.md b/Wiki/v5-migration-guide.md index 9d3d4b805..e0be0212b 100644 --- a/Wiki/v5-migration-guide.md +++ b/Wiki/v5-migration-guide.md @@ -1,5 +1,85 @@ ## Company Communicator v5 Migration Guide +## Migrating Classic Application Insights to Workspace-based Application Insights + +Microsoft Azure is retiring the classic Application Insights in Azure Monitor on 29 February 2024. Please refer to [this](https://azure.microsoft.com/en-in/updates/we-re-retiring-classic-application-insights-on-29-february-2024/) article for more details. The below steps will help you create a new Log Analytics workspace within the existing resource group where Company Communicator has been deployed and migrate to the workspace-based App Insights. If you have deployed Company Communicator v5.5 or below within your tenant, please follow the below steps to migrate to the workspace-based App Insights: + +### Approach 1: Programmatic migration via PowerShell Script + +>Note: This approach applies only if your tenant is Commercial or GCC.This will not work for GCC-H or DoD tenants. + +Install Azure CLI to upgrade classic app insight to workplace based app insight. Please refer this [link](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli#install). + +Download the whole solution folder from [GitHub](https://github.com/OfficeDev/microsoft-teams-company-communicator-app) +- Unzip the Content to a folder. (say companyCommunicator) +- Open a PowerShell window in **administrator** mode and navigate to the folder where you unzipped the content. +- Navigate to Deployment folder. + ``` + cd microsoft-teams-apps-company-communicator-main\Deployment + ``` + +- Run the below command. This will allow you to run applicationinsights-migration.ps1. By default, the execution policy is restricted. You may change it to back restricted after deployment is completed. + ``` + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned + ``` +- Run the below command to unblock the deployment script. + ``` + Unblock-File -Path .\applicationinsights-migration.ps1 + ``` + +#### Execute script + +- Execute the `applicationinsights-migration.ps1` script in the PowerShell window: + ``` + .\applicationinsights-migration.ps1 + ``` +- During execution of script you will be asked to provide below input parameters, + * Subscription Id : Please enter the subscription id of the resources where Company Communicator deployed. + * Resource Group Name : Please enter the resource group name where the previous resources were created. + * Base Resource Name : Please enter the base resource name used in the previous deployment. Base resource name is same as the app service name. + +![AppInsights Migration](images/appinsights-migration-execution.png) + +#### Validate Application Insights migration +- Go to portal.azure.com. Navigate to resource group where all CC resources are deployed. +- Click on the App Insights -> Click on Overview + +![Migrated Workspace-based App Insights](images/migrated-appinsights-overview.png) + + +### Approach 2: Manual migration via Azure Portal + +>Note: This approach applies to Commercial, GCC, GCC-H & DoD tenants. + +For the migration of classic app insights to workspace-based app insights has a prerequisite of creating a new log analytics workspace resource. +Please follow the below steps to create a new log analytics workspace resource and migrate to workspace-based app insights. + +#### Create a new Log Analytics workspace resource +- Go to portal.azure.com. Navigate to resource group where all CC resources are deployed. +- Click on Create -> Search for Log Analytics workspace -> Click on Create +- Enter the below details and click on Review + Create + * Subscription : Select the subscription where all CC resources are deployed. + * Resource Group : Select the resource group where all CC resources are deployed. + * Workspace Name : Enter the name of the workspace (preferably same as the **"[BaseResourceName]-log-analytics"**) + * Region : Select the region where all CC resources are deployed. + * Pricing tier : A default pricing tier of pay-as-you-go (Per GB 2018) is applied. No charges will be incurred until you start collecting enough data. + +![Create Log Analytics Workspace](images/create-log-analytics.png) + +- The log analytics workspace resource will be created. Please note down the workspace name from the overview page of the resource +- **Note:** Please make sure that the workspace name is same as the **"[BaseResourceName]-log-analytics"** +![Log Analytics Overview Page](images/log-analytics-overview-page.png) + +- Now, browse to the application insights resource within CC deployed resource group. +- Browse to properties from left hand side menu and click on **Migrate to Workspace-based**. +- Select the option of Migrate to Worksapce-based. +- Select the subscription and the workspace name of the newly created log analytics workspace resource. +![Log Analytics Overview Page](images/migrate-appinsights.png) +- Click on Apply +- The application insights resource will be migrated to workspace-based app insights. +![Migrated Workspace-based App Insights](images/migrated-appinsights-overview.png) + + ## Upgrading from v5.x to latest version If you have CC v5.0, v5.1 or v5.2 deployed and plan to migrate to the latest version, please perform the following steps: