小编Vik*_*lle的帖子

重写 Azure 存储中托管的静态网站的 URL

我已将 Angular 7 应用程序部署到 Azure 存储静态网站。

Angular 应用调用部署到 Azure 应用服务的 .NET Core API。

是否可以配置 URL 重写(反向代理)以将 Angular 应用程序请求路由到 .NET Core API,而无需启用 CORS?类似使用 Angular 代理配置进行本地开发的方式?

我已经读到可以在 Azure CDN 中使用 URL 重写规则,但我不太确定如何去做。 https://docs.microsoft.com/en-us/azure/cdn/cdn-rules-engine-reference-features#url-rewrite

据我了解,可以在 URL 重写规则中仅指定相对路径。

任何帮助表示赞赏。

reverse-proxy static-site azure-storage azure-cdn angular

9
推荐指数
1
解决办法
3960
查看次数

如何检查RavenDB中是否存在表(实体)

我使用Raven.Client.Lightweight 2.5库查询RavenDB中的内置TimeoutData实体以获取特定的超时文档.数据库中可能不存在TimeoutData,因为还没有文档存储在那里.在这种情况下,当您尝试查询时抛出NotSupportedException.

目前我已经为这种情况创建了解决方法:

try
{
    timeoutData = _session.Query<TimeoutData>().FirstOrDefault(t => t.Headers.ContainsValue(someValue));
}
catch (NotSupportedException)
{
    return null;
}
Run Code Online (Sandbox Code Playgroud)

是否可以在不使用try-catch的情况下验证TimeoutData是否存在?我也尝试了以下代码,但是当TimeoutData实体中存在文档时它返回false:

if (!_session.Query<TimeoutData>().Any())
{

}
Run Code Online (Sandbox Code Playgroud)

.net c# nservicebus ravendb

6
推荐指数
1
解决办法
365
查看次数

TFS GIT REST API获取提交的相关工作项

我想查询GIT提交以获取与特定提交相关联的相关工作项ID.(https://www.visualstudio.com/en-us/docs/integrate/api/git/commits)

请求:

http://{server}/tfs/{collection}/{git repository}/_apis/git/repositories/{repository name}/commits?api-version=1.0
Run Code Online (Sandbox Code Playgroud)

不幸的是,它返回截断的注释,因此并不总是能够看到工作项ID(#{Work Item ID}).

{
    "count": 100,
    "value": [{
            "commitId": "commit hash",
            "author": {
                "name": "some name",
                "email": "some email",
                "date": "2016-12-12T14:29:28Z"
            },
            "committer": {
                "name": "some name",
                "email": "some email",
                "date": "2016-12-12T14:29:28Z"
            },
            "comment": "Merge branch 'someBranch' of something.",
            "commentTruncated": true,
            "changeCounts": {
                "Add": 5,
                "Edit": 34
            },
            "url": "url",
            "remoteUrl": "remoteUrl"
        }]
}
Run Code Online (Sandbox Code Playgroud)

在上面的响应中,属性"commentTruncated"设置为true.我已经阅读了文档,但没有找到解决方案来分别获得完整评论或相关工作项.

git tfs

5
推荐指数
1
解决办法
895
查看次数

如何从 PowerShell 在 Octopus Deploy 中设置系统变量值

我试图在“运行脚本”步骤中为内置发行说明变量赋值。

$OctopusParameters["Octopus.Release.Notes"] = "Some release notes"
Run Code Online (Sandbox Code Playgroud)

在下一步“发送电子邮件”中,我在电子邮件正文中使用此变量,但不幸的是它是空的。

<p>#{Octopus.Release.Notes}</p>
Run Code Online (Sandbox Code Playgroud)

是否可以从 PowerShell 设置 Octopus Deploy 系统变量值并在下一步中使用它?

我使用的是 Octopus Deploy 3.7.11。

编辑:

我也尝试过 cmdlet Set-OctopusVariable,但没有成功。

Set-OctopusVariable -name "Octopus.Release.Notes" -value "Something"
Run Code Online (Sandbox Code Playgroud)

octopus-deploy

4
推荐指数
1
解决办法
6896
查看次数