Skip to content

Commit

Permalink
Azure DNS as a Service
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibor Kiss committed Jul 25, 2018
1 parent 026d715 commit 08e0635
Show file tree
Hide file tree
Showing 14 changed files with 637 additions and 75 deletions.
12 changes: 6 additions & 6 deletions azuredns_srv/azuredns_srv/AzureDNS.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

325 changes: 307 additions & 18 deletions azuredns_srv/azuredns_srv/AzureDNS.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion azuredns_srv/azuredns_srv/AzureDNS.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="eventLog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="azureLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
Expand Down
20 changes: 8 additions & 12 deletions azuredns_srv/azuredns_srv/Config/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@
</runtime>
<appSettings>
<add key="updateIntervalInMin" value="1" />
<add key="zoneName" value="cloudsteak.com" />
<add key="aRecordName" value="mami" />
<add key="dnsResourceGroup" value="the1bithu-rg-dns" />
<add key="azure.cloudName" value="AzureCloud" />
<add key="azure.clientID" value="f9a5bb5a-ecb9-4596-8942-58815ca75b47" />
<add key="azure.clientSecret" value="f71302ca-a818-472b-a348-2c9215ba9ee7" />
<add key="azure.tenant" value="fcfac54b-22a2-4487-bef4-a762401fd6a0" />
<add key="azure.subscriptionID" value="ab84ffe1-d2fc-4b31-9f3e-d4c162304649" />
<add key="zoneName" value="domain name"/>
<add key="aRecordName" value="subdomain"/>
<add key="dnsResourceGroup" value="DNS Zone resource group"/>
<add key="azure.cloudName" value="AzureCloud"/>
<add key="azure.clientID" value="Service Principal ID"/>
<add key="azure.clientSecret" value="Service Principal Secret"/>
<add key="azure.tenant" value="Tenant ID"/>
<add key="azure.subscriptionID" value="Subscription ID"/>
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" />
Expand Down
9 changes: 0 additions & 9 deletions azuredns_srv/azuredns_srv/Enum/Operations.cs

This file was deleted.

14 changes: 0 additions & 14 deletions azuredns_srv/azuredns_srv/Enum/Records.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@

namespace Enum
{
enum Operations
{
Create,
update,
Delete
}

enum Status
{
success,
error,
exists,
notexist,
unknown,
}

enum Records
{
A,
AAA,
CNAME,
MX,
NS,
PTR,
SRV,
TXT
}

public enum ServiceState
{
SERVICE_STOPPED = 0x00000001,
Expand Down
8 changes: 2 additions & 6 deletions azuredns_srv/azuredns_srv/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ static class Program
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
static void Main(string[] args)
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new AzureDNS()
};
ServiceBase[] ServicesToRun = new ServiceBase[] { new AzureDNS(args) };
ServiceBase.Run(ServicesToRun);
}
}
Expand Down
61 changes: 61 additions & 0 deletions azuredns_srv/azuredns_srv/ProjectInstaller.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions azuredns_srv/azuredns_srv/ProjectInstaller.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Threading.Tasks;

namespace azuredns_srv
{
[RunInstaller(true)]
public partial class ProjectInstaller : System.Configuration.Install.Installer
{
public ProjectInstaller()
{
InitializeComponent();
}

private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
{

}

protected override void OnBeforeInstall(IDictionary savedState)
{
string parameter = "azuredns\" \"application";
Context.Parameters["assemblypath"] = "\"" + Context.Parameters["assemblypath"] + "\" \"" + parameter + "\"";
base.OnBeforeInstall(savedState);
}
}
}
129 changes: 129 additions & 0 deletions azuredns_srv/azuredns_srv/ProjectInstaller.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="serviceProcessInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="serviceInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>196, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
5 changes: 4 additions & 1 deletion azuredns_srv/azuredns_srv/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand Down Expand Up @@ -34,3 +35,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("en-AS")]

0 comments on commit 08e0635

Please sign in to comment.