Skip to content

Commit 5fbedfb

Browse files
changes to accomodate binding of app insights
1 parent 9fbf677 commit 5fbedfb

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

scripts/build.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,11 @@ npm install
7878
npm run ubuntu-dev-build
7979
cd $HOME/web/src/signalr-web/SignalRMiddleware/
8080
dotnet build
81+
cd $HOME/web/src/signalr-web/SignalRMiddleware/SignalRMiddlewareTests/
8182
dotnet test
82-
dotnet publish -c Release
83+
dotnet publish -c Release
84+
85+
cd $HOME/web/src/signalr-web/SignalRMiddleware/SignalRMiddleware/bin/Release/netcoreapp2.1/publish/
86+
zip -r SignalRMiddleware.zip .
87+
88+
echo "Build successfully completed!"

scripts/deploy.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ az storage container create --account-name $IMAGES_BLOB_STORAGE_ACCOUNT_NAME --n
6666

6767
echo "Creating CORS Policy for Blob Storage"
6868
az storage cors clear --account-name $IMAGES_BLOB_STORAGE_ACCOUNT_NAME --services b
69-
az storage cors add --account-name $IMAGES_BLOB_STORAGE_ACCOUNT_NAME --services b --methods POST GET PUT --origins * --allowed-headers * --exposed-headers *
69+
az storage cors add --account-name $IMAGES_BLOB_STORAGE_ACCOUNT_NAME --services b --methods POST GET PUT --origins "*" --allowed-headers "*" --exposed-headers "*"
7070

7171
echo "Deploying Images Functions..."
7272
az webapp deployment source config-zip --resource-group ContentReactor-Images --name $IMAGES_API_NAME --src $HOME/images/src/ContentReactor.Images/ContentReactor.Images.Api/bin/Release/netstandard2.0/ContentReactor.Images.Api.zip
@@ -91,7 +91,7 @@ az storage container create --account-name $AUDIO_BLOB_STORAGE_ACCOUNT_NAME --na
9191

9292
echo "Creating CORS Policy for Blob Storage"
9393
az storage cors clear --account-name $AUDIO_BLOB_STORAGE_ACCOUNT_NAME --services b
94-
az storage cors add --account-name $AUDIO_BLOB_STORAGE_ACCOUNT_NAME --services b --methods POST GET PUT --origins * --allowed-headers * --exposed-headers *
94+
az storage cors add --account-name $AUDIO_BLOB_STORAGE_ACCOUNT_NAME --services b --methods POST GET PUT --origins "*" --allowed-headers "*" --exposed-headers "*"
9595

9696
echo "Deploying Audio Functions..."
9797
az webapp deployment source config-zip --resource-group ContentReactor-Audio --name $AUDIO_API_NAME --src $HOME/audio/src/ContentReactor.Audio/ContentReactor.Audio.Api/bin/Release/netstandard2.0/ContentReactor.Audio.Api.zip
@@ -129,5 +129,7 @@ az group create -n ContentReactor-Web -l westus2
129129
az group deployment create --name ContentReactorWeb-Deployment --resource-group ContentReactor-Web --template-file $HOME/web/deploy/template.json --parameters uniqueResourceNameSuffix=$uniqueSuffixString functionAppProxyName=crapiproxy$uniqueSuffixString
130130
WEB_APP_NAME=crweb$uniqueSuffixString
131131

132+
webInstrumentationKey=$(az resource show --namespace microsoft.insights --resource-type components --name $WEB_APP_NAME-ai -g ContentReactor-Web --query properties.InstrumentationKey)
133+
sed -i -e 's/\"%INSTRUMENTATION_KEY%\"/'"$webInstrumentationKey"'/g' $HOME/web/src/signalr-web/SignalRMiddleware/EventApp/src/environments/environment.ts
132134
az webapp deployment source config-zip --resource-group ContentReactor-Web --name $WEB_APP_NAME --src $HOME/web/src/signalr-web/SignalRMiddleware/SignalRMiddleware/bin/Release/netcoreapp2.1/publish/SignalRMiddleware.zip
133135
az group deployment create -g ContentReactor-Events --template-file $HOME/web/deploy/eventGridSubscriptions.json --parameters eventGridTopicName=c$EVENT_GRID_TOPIC_NAME appServiceName=$WEB_APP_NAME

web/deploy/template.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
33
"contentVersion": "1.0.0.0",
44
"parameters": {
5-
65
"uniqueResourceNameSuffix": {
76
"type": "string",
87
"defaultValue": "[uniqueString(subscription().subscriptionId, resourceGroup().id)]"
@@ -20,10 +19,6 @@
2019
"metadata": {
2120
"description": "Describes plan's pricing tier and capacity. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/"
2221
}
23-
},
24-
"aspnetcoreVersion":{
25-
"type": "string",
26-
"defaultValue": "2.1.0-preview1-final"
2722
}
2823
},
2924
"variables": {
@@ -42,10 +37,20 @@
4237

4338
"appHostingPlanNameVar": "[concat(variables('appServicePlanName'),'-apps')]",
4439

45-
"applicationInsightsName": "[concat(variables('appServiceName'), 'ai')]"
40+
"applicationInsightsName": "[concat(variables('appServiceName'), '-ai')]"
4641

4742
},
4843
"resources": [
44+
{
45+
"name": "[variables('applicationInsightsName')]",
46+
"type": "Microsoft.Insights/components",
47+
"apiVersion": "2014-04-01",
48+
"location": "[parameters('applicationInsightsLocation')]",
49+
"kind": "other",
50+
"properties": {
51+
"applicationId": "[variables('applicationInsightsName')]"
52+
}
53+
},
4954
{
5055
"name": "[variables('appHostingPlanNameVar')]",
5156
"type": "Microsoft.Web/serverfarms",

0 commit comments

Comments
 (0)