Skip to content

Commit

Permalink
Set allow all origins in azure functions (both deployed in Azure and …
Browse files Browse the repository at this point in the history
…locally). Also, fixed Dockerfile.
  • Loading branch information
[email protected] committed Jun 17, 2019
1 parent dbd0945 commit 03d97e4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Deploy/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"type": "Microsoft.Web/sites",
"kind": "functionapp",
"name": "[variables('function_name')]",
"apiVersion": "2016-03-01",
"apiVersion": "2016-08-01",
"location": "[parameters('location')]",
"properties": {
"name": "[variables('function_name')]",
Expand Down Expand Up @@ -92,7 +92,10 @@
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "8.11.1"
}
]
],
"cors": {
"allowedOrigins": ["*"]
}
},
"clientAffinityEnabled": false,
"reserved": false
Expand Down
20 changes: 20 additions & 0 deletions Source/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.vs
**/.vscode
**/*.*proj.user
**/azds.yaml
**/charts
**/bin
**/obj
**/Dockerfile
**/Dockerfile.develop
**/docker-compose.yml
**/docker-compose.*.yml
**/*.dbmdl
**/*.jfm
**/secrets.dev.yaml
**/values.dev.yaml
**/.toolstarget
5 changes: 3 additions & 2 deletions Source/SmartHotel360.Website/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.2.100-preview1-sdk-alpine AS build
ENV BuildingDocker true
WORKDIR /src
COPY SmartHotel360.PublicWeb.csproj .
COPY SmartHotel360.Website.csproj .
RUN dotnet restore
COPY . .
RUN dotnet build -c Release -o /webapp
Expand All @@ -28,4 +29,4 @@ FROM base AS final
WORKDIR /app
COPY --from=publish /webapp .
COPY --from=node /src/wwwroot ./wwwroot
ENTRYPOINT ["dotnet", "SmartHotel360.PublicWeb.dll"]
ENTRYPOINT ["dotnet", "SmartHotel360.Website.dll"]
2 changes: 1 addition & 1 deletion Source/SmartHotel360.Website/SmartHotel360.Website.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</Target>


<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish" Condition="'$(BuildingDocker)' == '' ">

<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm rebuild node-sass" />
Expand Down
3 changes: 3 additions & 0 deletions Source/SmartHotel360.WebsiteFunction/local.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"MicrosoftVisionNumTags": "10",
"AzureSignalRConnectionString": "<Connection String to the SignalR Service instance>",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
},
"Host": {
"CORS": "*"
}
}

0 comments on commit 03d97e4

Please sign in to comment.