OPS.GoCloud.AzureClient 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package OPS.GoCloud.AzureClient --version 1.0.2
                    
NuGet\Install-Package OPS.GoCloud.AzureClient -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OPS.GoCloud.AzureClient" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OPS.GoCloud.AzureClient" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="OPS.GoCloud.AzureClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OPS.GoCloud.AzureClient --version 1.0.2
                    
#r "nuget: OPS.GoCloud.AzureClient, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OPS.GoCloud.AzureClient@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OPS.GoCloud.AzureClient&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=OPS.GoCloud.AzureClient&version=1.0.2
                    
Install as a Cake Tool

Installation

dotnet add package OPS.GoCloud.AzureClient --version 1.0.1

nuget package: (OPS.GoCloud.AzureClient)[https://www.nuget.org/packages/OPS.GoCloud.AzureClient/]

Use

Initialize AzureClient

Client credentials

var tenantId = "YOUR_TENANT_ID";
var clientId = "YOUR_CLIENT_ID";
var clientsecret = "YOUR_CLIENT_SECRET";

AzureClient azureClient = new AzureClient(tenantId,clientId,clientsecret);

User-managed identity credentials

var tenantId = "YOUR_TENANT_ID";
var umiClientId = "User-Managed Identity_CLIENT_ID";

AzureClient azureClient = new AzureClient(tenantId,umiClientId);

Initialize Microsoft Graph Clien

var graphClientId = "YOUR_CLIENT_ID";
var graphClientsecret = "YOUR_CLIENT_SECRET";

azureClient.InitiateGraphClient(graphClientId,graphClientsecret);

Query from Azure Resource Graph

  1. Create your custom class and inherit from ArmBase.
public class subscription : ArmBase<subscription>
{
    public string subscriptionId { get; set; }
    public string name { get; set; }
}
  1. Write query and get results. The results will be deserialized to data of your custom class type.
string query = "resourcecontainers | where type == 'microsoft.resources/subscriptions | project subscriptionId,name";

List<subscription> azureSubs = subscription.Query(azureClient, query);

Send request to Azure REST API

  1. Create your custom class
public class PolicyAssignment
{
    public string id { get; set; }
    public string name { get; set; }
    public string location { get; set; }
    public object properties { get; set; }
}
string policyAssignmentId = "";
string uri = $"https://management.azure.com/{policyAssignmentId}?api-version=2021-06-01";

// The returned respose content is data in JSON string
var resContent = await azureClient.SendToAzRestAPI(uri,HttpMethod.Get);

PolicyAssignment policyAssignment = JsonConvert.DeserializeObject<PolicyAssignment>(resContent);
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.7 156 10/20/2025
1.1.6 599 8/22/2024
1.1.5 161 8/21/2024
1.1.4 168 8/21/2024
1.1.3 161 8/21/2024
1.1.2 169 8/21/2024
1.1.1 168 6/17/2024
1.1.0 175 5/7/2024
1.0.9 210 3/20/2024
1.0.8 174 2/16/2024
1.0.7 187 2/6/2024
1.0.6 171 1/25/2024
1.0.5 159 1/24/2024
1.0.4 152 1/22/2024
1.0.3 153 1/22/2024
1.0.2 159 1/22/2024
1.0.1 152 1/22/2024 1.0.1 is deprecated because it is no longer maintained.
1.0.0 164 1/22/2024 1.0.0 is deprecated because it is no longer maintained.