Используя локальный метод развертывания git в Azure WebApp (linux) для dotnet core 2.2, у меня возникают проблемы с правами доступа к определенному пути по умолчанию.
Это мой конвейер развертывания на bitbucket
- step:
image: microsoft/dotnet
name: Deploy DataCore
script:
- git subtree split -P data-core -b split
- git push https://$BACKEND_LOGIN:$BACKEND_PASSWORD@$BACKEND_GITURL split:master --force
Это то, что возвращается из удаленного, а также часть журналов развертывания:
+ git push https://$BACKEND_LOGIN:$BACKEND_PASSWORD@$BACKEND_GITURL split:master --force
remote: Deploy Async
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id '449e740796'.
remote: Generating deployment script.
remote: Running deployment command...
remote: Handling ASP.NET Core Web Application deployment.
remote: .........................
remote: Restoring packages for /home/site/repository/data-core.csproj...
remote: .
remote: Installing NuGet.Frameworks 4.7.0.
remote: /opt/dotnet/2.2.104/sdk/2.2.104/NuGet.targets(114,5): error : Access to the path '/var/nuget/nuget.frameworks/4.7.0' is denied. [/home/site/repository/data-core.csproj]
remote: /opt/dotnet/2.2.104/sdk/2.2.104/NuGet.targets(114,5): error : Permission denied [/home/site/repository/data-core.csproj]
remote: An error has occurred during web site deployment.
remote: dotnet restore failed
remote: App container will begin restart within 10 seconds.
remote: Deployment Logs : 'https://_NAME_.scm.azurewebsites.net/newui/jsonviewer?view_url=/api/deployments/449e74079667b8ff046c75a45d4e2e251f99e4d0/log'
To https://_NAME_.scm.azurewebsites.net:443/_NAME_.git
9bfde94..449e740 split -> master
Обратите внимание на две ошибки
remote: Installing NuGet.Frameworks 4.7.0.
remote: /opt/dotnet/2.2.104/sdk/2.2.104/NuGet.targets(114,5): error : Access to the path '/var/nuget/nuget.frameworks/4.7.0' is denied. [/home/site/repository/data-core.csproj]
remote: /opt/dotnet/2.2.104/sdk/2.2.104/NuGet.targets(114,5): error : Permission denied [/home/site/repository/data-core.csproj]
Это веб-приложение не было настроено за пределами по умолчанию, и я использовал эту настройку в другое время. Поэтому мне интересно, было ли обновление, требующее, чтобы я что-то изменил.
Это мой файл .csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>data_core</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="8.1.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.1.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
</ItemGroup>
</Project>
Полный журнал развертывания здесь также
[{"log_time":"2019-05-07T08:41:18.5348434Z","id":"","message":"Command: \"/home/site/deployments/tools/deploy.sh\"","type":0,"details_url":null},{"log_time":"2019-05-07T08:41:18.6366309Z","id":"","message":"Handling ASP.NET Core Web Application deployment.","type":0,"details_url":null},{"log_time":"2019-05-07T08:41:47.6970957Z","id":"","message":" Restoring packages for /home/site/repository/data-core.csproj...","type":0,"details_url":null},{"log_time":"2019-05-07T08:41:53.3146873Z","id":"","message":" Installing NuGet.Frameworks 4.7.0.","type":0,"details_url":null},{"log_time":"2019-05-07T08:41:53.3801758Z","id":"","message":"/opt/dotnet/2.2.104/sdk/2.2.104/NuGet.targets(114,5): error : Access to the path '/var/nuget/nuget.frameworks/4.7.0' is denied. [/home/site/repository/data-core.csproj]","type":0,"details_url":null},{"log_time":"2019-05-07T08:41:53.4164253Z","id":"","message":"/opt/dotnet/2.2.104/sdk/2.2.104/NuGet.targets(114,5): error : Permission denied [/home/site/repository/data-core.csproj]","type":0,"details_url":null},{"log_time":"2019-05-07T08:41:53.5778675Z","id":"","message":"An error has occurred during web site deployment.","type":0,"details_url":null},{"log_time":"2019-05-07T08:41:53.6091768Z","id":"","message":"dotnet restore failed","type":0,"details_url":null},{"log_time":"2019-05-07T08:41:53.6748839Z","id":"","message":"\\n/opt/Kudu/KuduConsole/Scripts/starter.sh \"/home/site/deployments/tools/deploy.sh\"","type":2,"details_url":null}]