Skip to content

Commit 20a9046

Browse files
authored
Update dependencies to latest version (#12)
1 parent 8fbc110 commit 20a9046

31 files changed

+128
-380
lines changed

Diff for: docs/azure-integration.md

+4-34
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Then copy the build output into `app` folder and set the entrypoint:
3838

3939
```docker
4040
# build runtime image
41-
FROM microsoft/aspnetcore:2.0
41+
FROM microsoft/dotnet:2.1-aspnetcore-runtime
4242
WORKDIR /app
4343
COPY --from=build-env /app/out .
4444
ENTRYPOINT ["dotnet", "ChatRoom.dll"]
@@ -47,7 +47,7 @@ ENTRYPOINT ["dotnet", "ChatRoom.dll"]
4747
Then you can test the image locally:
4848

4949
```
50-
docker run -p 5000:80 -e Azure__SignalR__ConnectionString=<connection_string> chatroom
50+
docker run -p 5000:80 -e Azure__SignalR__ConnectionString="<connection_string>" chatroom
5151
```
5252

5353
> For more information about building Docker image for .NET Core, please refer to this [doc](https://docs.microsoft.com/en-us/dotnet/core/docker/building-net-docker-images).
@@ -86,39 +86,9 @@ az webapp config container set \
8686
--docker-registry-server-url https://<acr_name>.azurecr.io \
8787
--docker-registry-server-user <acr_name> \
8888
--docker-registry-server-password <acr_password>
89-
az webapp config appsettings set --resource-group <resource_group_name> --name <app_name> --setting PORT=5000
89+
az webapp config appsettings set --resource-group <resource_group_name> --name <app_name> --setting PORT=80
9090
az webapp config appsettings set --resource-group <resource_group_name> --name <app_name> \
91-
--setting Azure__SignalR__ConnectionString=<connection_string>
91+
--setting Azure__SignalR__ConnectionString="<connection_string>"
9292
```
9393

9494
Now open `https://<app_name>.azurewebsites.net` and you will see your chat room running on Azure.
95-
96-
> Web App now supports .NET Core 2.0, so you can directly deploy to Web App without Docker:
97-
> 1. Create a web app:
98-
> ```
99-
> az group create --name <resource_group_name> --location CentralUS
100-
> az appservice plan create --name <plan_name> --resource-group <resource_group_name> --sku S1 --is-linux
101-
> az webapp create \
102-
> --resource-group <resource_group_name> --plan <plan_name> --name <app_name> \
103-
> --runtime "DOTNETCORE|2.0"
104-
> ```
105-
>
106-
> 2. Config deployment source and credential:
107-
> ```
108-
> az webapp deployment source config-local-git --resource-group <resource_group_name> --name <app_name>
109-
> az webapp deployment user set --user-name <user_name> --password <password>
110-
> ```
111-
>
112-
> 3. Deploy using git:
113-
> ```
114-
> git init
115-
> git remote add origin <deploy_git_url>
116-
> git add -A
117-
> git commit -m "init commit"
118-
> git push origin master
119-
> ```
120-
> 4. Update config
121-
> ```
122-
> az webapp config appsettings set --resource-group <resource_group_name> --name <app_name> \
123-
> --setting Azure__SignalR__ConnectionString=<connection_string>
124-
> ```

Diff for: samples/ChatRoom/.npmrc

-1
This file was deleted.

Diff for: samples/ChatRoom/ChatRoom.csproj

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.0</TargetFramework>
3+
<TargetFramework>netcoreapp2.1</TargetFramework>
44
<UserSecretsId>chatroom</UserSecretsId>
55
<RootNamespace>Microsoft.Azure.SignalR.Samples.ChatRoom</RootNamespace>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.0-rc1-30677" />
10-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0-rc1-30677" />
11-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0-rc1-30677" />
12-
<PackageReference Include="Microsoft.Azure.SignalR" Version="1.0.0-preview-10008" />
9+
<Folder Include="wwwroot\" />
1310
</ItemGroup>
1411

1512
<ItemGroup>
16-
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-rc1-final" />
14+
<PackageReference Include="Microsoft.Azure.SignalR" Version="1.0.0-preview1-10009" />
1715
</ItemGroup>
1816
</Project>

Diff for: samples/ChatRoom/Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
FROM microsoft/aspnetcore-build:2.0 AS build-env
1+
# Copyright (c) Microsoft. All rights reserved.
2+
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
FROM microsoft/dotnet:2.1-sdk-stretch AS build-env
25
WORKDIR /app
36

47
# copy csproj and restore as distinct layers
@@ -12,7 +15,7 @@ COPY ./ ./
1215
RUN dotnet publish -c Release -o out
1316

1417
# build runtime image
15-
FROM microsoft/aspnetcore:2.0
18+
FROM microsoft/dotnet:2.1-aspnetcore-runtime
1619
WORKDIR /app
1720
COPY --from=build-env /app/out .
1821
ENTRYPOINT ["dotnet", "ChatRoom.dll"]

Diff for: samples/ChatRoom/NuGet.config

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="azure-signalr-dev" value="https://www.myget.org/F/azure-signalr-dev/api/v3/index.json" />
5-
<add key="aspnetcore-dev" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
6-
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
74
</packageSources>
85
</configuration>

Diff for: samples/ChatRoom/README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
In [ChatRoomLocal sample](../ChatRoomLocal) you have learned how to use SignalR to build a chat room application. In that example, the SignalR runtime (which manages the client connections and message routing) is running on your own server. As the number of the clients increases, you'll eventually hit a limit on your server and you'll need to scale your server to handle more clients. This is usually not an easy task. In this tutorial, you'll learn how to use Azure SignalR Service to offload the connection management part to the service so that you don't need to worry about the scaling problem.
44

5-
## Create a SignalR Service
5+
## Provision a SignalR Service
66

7-
First let's create a SignalR service on Azure.
7+
First let's provision a SignalR service on Azure.
88

99
1. Open Azure portal, click "Create a resource" and find "SignalR Service" in "Web + Mobile".
1010

@@ -21,8 +21,6 @@ First let's create a SignalR service on Azure.
2121
* Free: which can handle 100 connections at the same time and can send and receive one million messages in a month.
2222
* Basic: which has 1000 concurrent connections and 75 millions message per month limit for *one unit*. You can scale up to 10 units for a single service instance and you'll be charged by the number of units you use.
2323

24-
> In private preview, only basic tier with one unit is supported.
25-
2624
3. Click "Create", your SignalR service will be created in a few minutes.
2725

2826
![signalr-3](../../docs/images/signalr-3.png)
@@ -64,7 +62,7 @@ Let's look at the key changes:
6462
You also need to reference the service SDK before using these APIs:
6563

6664
```xml
67-
<PackageReference Include="Microsoft.Azure.SignalR" Version="1.0.0-preview-10008" />
65+
<PackageReference Include="Microsoft.Azure.SignalR" Version="1.0.0-preview1-10009" />
6866
```
6967

7068
Other than these changes, everything else remains the same, you can still use the hub interface you're already familiar with to write business logic.

Diff for: samples/ChatRoom/package-lock.json

+3-83
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: samples/ChatRoom/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "chatsample",
33
"private": true,
44
"dependencies": {
5-
"@aspnet/signalr": "1.0.0-rc1-30656",
6-
"@aspnet/signalr-protocol-msgpack": "1.0.0-rc1-30656"
5+
"@aspnet/signalr": "^1.0.0-rc1-final"
76
}
87
}

Diff for: samples/ChatRoomLocal/.npmrc

-1
This file was deleted.

Diff for: samples/ChatRoomLocal/ChatRoomLocal.csproj

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.0</TargetFramework>
3+
<TargetFramework>netcoreapp2.1</TargetFramework>
44
<UserSecretsId>chatroom</UserSecretsId>
55
<RootNamespace>Microsoft.Azure.SignalR.Samples.ChatRoom</RootNamespace>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.0-rc1-30677" />
10-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0-rc1-30677" />
11-
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-rc1-30677" />
12-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0-rc1-30677" />
9+
<Folder Include="wwwroot\" />
1310
</ItemGroup>
1411

1512
<ItemGroup>
16-
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-rc1-final" />
1714
</ItemGroup>
1815
</Project>

Diff for: samples/ChatRoomLocal/NuGet.config

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="azure-signalr-dev" value="https://www.myget.org/F/azure-signalr-dev/api/v3/index.json" />
5-
<add key="aspnetcore-dev" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
6-
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
74
</packageSources>
85
</configuration>

Diff for: samples/ChatRoomLocal/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Let's do it step by step.
2424
dotnet new web
2525
```
2626
27-
> Before you start, make sure you installed [.NET Core SDK](https://www.microsoft.com/net/learn/get-started).
27+
> Before you start, make sure you installed the latest [.NET Core 2.1 RC1 SDK](https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-rc1).
2828
2929
2. Create a `Chat.cs` that defines a `Chat` hub class.
3030
@@ -48,7 +48,7 @@ Let's do it step by step.
4848
> You need to reference the SignalR SDK before using the APIs:
4949
>
5050
> ```xml
51-
> <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-rc1-30677" />
51+
> <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-rc1-final" />
5252
> ```
5353
5454
Hub is the core concept in SignalR which exposes a set of methods that can be called from client. Here we define two methods: `Broadcast()` which broadcasts the message to all clients and `Echo()` which sends the message back to the caller.

Diff for: samples/ChatRoomLocal/package-lock.json

+3-83
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: samples/ChatRoomLocal/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "chatsample",
33
"private": true,
44
"dependencies": {
5-
"@aspnet/signalr": "1.0.0-rc1-30656",
6-
"@aspnet/signalr-protocol-msgpack": "1.0.0-rc1-30656"
5+
"@aspnet/signalr": "^1.0.0-rc1-final"
76
}
87
}

0 commit comments

Comments
 (0)