Added Creatondate consoleapp and tagging policy

This commit is contained in:
Jurjen Ladenius
2022-04-20 11:03:12 +02:00
parent 28b4a0807c
commit 20331593e7
24 changed files with 1887 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
using AzureRestApi.Models.Resources;
namespace AzureRestApi.Models.Api
{
public class ResourcesResponse
{
public List<Resource>? value { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
using AzureRestApi.Models.Resources;
namespace AzureRestApi.Models.Api
{
public class SubscriptionResponse
{
public List<Subscription>? value { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
using AzureRestApi.Models.Resources;
namespace AzureRestApi.Models.Api
{
public class TagProperties
{
public TagTags properties { get; set; } = new TagTags();
}
}

View File

@@ -0,0 +1,28 @@
namespace AzureRestApi.Models.Resources
{
public class Resource
{
public string? id { get; set; }
public string? name { get; set; }
public string? type { get; set; }
public string? location { get; set; }
public string? createdTime { get; set; }
public string? changedTime { get; set; }
public Dictionary<string, string> tags { get; set; } = new Dictionary<string, string>();
public string? CreatedOn
{
get
{
if (string.IsNullOrWhiteSpace(createdTime))
{
return changedTime;
}
else
{
return createdTime;
}
}
}
}
}

View File

@@ -0,0 +1,20 @@
namespace AzureRestApi.Models.Resources
{
public class Subscription
{
public string? id { get; set; }
public string? authorizationSource { get; set; }
public string? subscriptionId { get; set; }
public string? tenantId { get; set; }
public string? displayName { get; set; }
public string? state { get; set; }
public bool Enabled
{
get
{
return state == "Enabled";
}
}
}
}

View File

@@ -0,0 +1,7 @@
namespace AzureRestApi.Models.Resources
{
public class TagTags
{
public Dictionary<string, string> tags { get; set; } = new Dictionary<string, string>();
}
}

View File

@@ -0,0 +1,8 @@
namespace AzureRestApi.Models
{
public class Settings
{
public string KeyVaultName { get; set; }
public string AzureTenantId { get; set; }
}
}