在 .Net Core 中以编程方式在 Azure 上创建子域 [英] Creating sub domains on Azure Programmatically in .Net Core
问题描述
我正在尝试在 .Net Core 应用程序中的 Azure 中创建子域,基本上只是想在这个阶段获得连接,然后从那里开始.
I'm trying to create sub-domains within Azure in a .Net Core app, basically just want to get the connection at this stage and then go from there.
我创建了一个简单的 .net 核心控制台应用程序,只是为了 POC.
I've created a simple .net core console app just to POC this.
我查了这个问题添加自定义域名到使用 REST API 的网络应用然而,所引用的包似乎是针对 .net 框架的.
I have checked this question Add custom domain names to web apps using REST API However the package referenced seems to be targeting the .net framework.
有 .net 核心特定的库吗?尝试使用谷歌搜索,一切都让我回到了 WebSiteManagementClient
类.
Is there a .net core specific library?
Tried googling around and everything points me back to the WebSiteManagementClient
class.
我是白痴吗?
推荐答案
查看 Microsoft.Azure.Management.* 包.它们通常支持 .NET Standard,因此您可以在 .NET Core 中使用它们.
Look into the Microsoft.Azure.Management.* packages. They usually support .NET Standard, so you can use them in .NET Core.
我不太确定您想在哪里创建子域,但既然您提到了 WebApps,我想您是指那些.
I am not quite sure where you want to create the sub-domain, but since you mention WebApps, I assume you mean those.
您可以查看 Microsoft.Azure.Management.AppService.流畅
namespace Microsoft.Azure.Management.AppService.Fluent.HostNameBinding.Definition
{
using Microsoft.Azure.Management.AppService.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent.Core.ChildResource.Definition;
using Microsoft.Azure.Management.AppService.Fluent.Models;
/// <summary>
/// The stage of a hostname binding definition allowing domain to be specified.
/// </summary>
/// <typeparam name="ParentT">The stage of the parent definition to return to after attaching this definition.</typeparam>
public interface IWithDomain<ParentT>
{
/// <summary>
/// Binds to a 3rd party domain.
/// </summary>
/// <param name="domain">The 3rd party domain name.</param>
/// <return>The next stage of the definition.</return>
Microsoft.Azure.Management.AppService.Fluent.HostNameBinding.Definition.IWithSubDomain<ParentT> WithThirdPartyDomain(string domain);
/// <summary>
/// Binds to a domain purchased from Azure.
/// </summary>
/// <param name="domain">The domain purchased from Azure.</param>
/// <return>The next stage of the definition.</return>
Microsoft.Azure.Management.AppService.Fluent.HostNameBinding.Definition.IWithSubDomain<ParentT> WithAzureManagedDomain(IAppServiceDomain domain);
}
/// <summary>
/// The stage of a hostname binding definition allowing sub-domain to be specified.
/// </summary>
/// <typeparam name="ParentT">The stage of the parent definition to return to after attaching this definition.</typeparam>
public interface IWithSubDomain<ParentT>
{
/// <summary>
/// Specifies the sub-domain to bind to.
/// </summary>
/// <param name="subDomain">The sub-domain name excluding the top level domain, e.g., "www".</param>
/// <return>The next stage of the definition.</return>
Microsoft.Azure.Management.AppService.Fluent.HostNameBinding.Definition.IWithHostNameDnsRecordType<ParentT> WithSubDomain(string subDomain);
}
这篇关于在 .Net Core 中以编程方式在 Azure 上创建子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!