Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions sdk/cloudmachine/Azure.CloudMachine.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Azure.CloudMachine", "Azure.CloudMachine", "{780138CF-68C6-4323-982F-F18989E2FA86}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine", "Azure.CloudMachine\src\Azure.CloudMachine.csproj", "{0EA29D2F-41E0-4826-9CD4-111109A2CFF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.Tests", "Azure.CloudMachine\tests\Azure.CloudMachine.Tests.csproj", "{8C1A29AE-E357-4C40-ACCC-7215FBFB368C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0EA29D2F-41E0-4826-9CD4-111109A2CFF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EA29D2F-41E0-4826-9CD4-111109A2CFF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EA29D2F-41E0-4826-9CD4-111109A2CFF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EA29D2F-41E0-4826-9CD4-111109A2CFF7}.Release|Any CPU.Build.0 = Release|Any CPU
{8C1A29AE-E357-4C40-ACCC-7215FBFB368C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C1A29AE-E357-4C40-ACCC-7215FBFB368C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C1A29AE-E357-4C40-ACCC-7215FBFB368C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C1A29AE-E357-4C40-ACCC-7215FBFB368C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0EA29D2F-41E0-4826-9CD4-111109A2CFF7} = {780138CF-68C6-4323-982F-F18989E2FA86}
{8C1A29AE-E357-4C40-ACCC-7215FBFB368C} = {780138CF-68C6-4323-982F-F18989E2FA86}
EndGlobalSection
EndGlobal
11 changes: 11 additions & 0 deletions sdk/cloudmachine/Azure.CloudMachine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Release History

## 1.0.0-beta.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
6 changes: 6 additions & 0 deletions sdk/cloudmachine/Azure.CloudMachine/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
</Project>
6 changes: 6 additions & 0 deletions sdk/cloudmachine/Azure.CloudMachine/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Import the common SDK build targets. -->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.targets))\Directory.Build.targets"
Condition="'$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.targets))' != ''" />

</Project>
57 changes: 57 additions & 0 deletions sdk/cloudmachine/Azure.CloudMachine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Azure CloudMachine client library for .NET

TODO

## Getting started

### Install the package

Install the client library for .NET with [NuGet](https://www.nuget.org/ ):

```dotnetcli
dotnet add package Azure.CloudMachine --prerelease
```

### Prerequisites

> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/).

### Authenticate the Client

## Key concepts

TODO

## Examples

## Troubleshooting

- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues).
- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags.

## Next steps

## Contributing

For details on contributing to this repository, see the [contributing
guide][cg].

This project welcomes contributions and suggestions. Most contributions
require you to agree to a Contributor License Agreement (CLA) declaring
that you have the right to, and actually do, grant us the rights to use
your contribution. For details, visit <https://cla.microsoft.com>.

When you submit a pull request, a CLA-bot will automatically determine
whether you need to provide a CLA and decorate the PR appropriately
(for example, label, comment). Follow the instructions provided by the
bot. You'll only need to do this action once across all repositories
using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For
more information, see the [Code of Conduct FAQ][coc_faq] or contact
<[email protected]> with any other questions or comments.

<!-- LINKS -->
[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
namespace Azure.Template
{
public partial class TemplateClient
{
protected TemplateClient() { }
public TemplateClient(string vaultBaseUrl, Azure.Core.TokenCredential credential) { }
public TemplateClient(string vaultBaseUrl, Azure.Core.TokenCredential credential, Azure.Template.TemplateClientOptions options) { }
public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } }
public virtual Azure.Response GetSecret(string secretName, Azure.RequestContext context) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> GetSecretAsync(string secretName, Azure.RequestContext context) { throw null; }
public virtual Azure.Response<Azure.Template.Models.SecretBundle> GetSecretValue(string secretName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Template.Models.SecretBundle>> GetSecretValueAsync(string secretName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class TemplateClientOptions : Azure.Core.ClientOptions
{
public TemplateClientOptions(Azure.Template.TemplateClientOptions.ServiceVersion version = Azure.Template.TemplateClientOptions.ServiceVersion.V7_0) { }
public enum ServiceVersion
{
V7_0 = 1,
}
}
}
namespace Azure.Template.Models
{
public partial class SecretBundle
{
internal SecretBundle() { }
public string ContentType { get { throw null; } }
public string Id { get { throw null; } }
public string Kid { get { throw null; } }
public bool? Managed { get { throw null; } }
public System.Collections.Generic.IReadOnlyDictionary<string, string> Tags { get { throw null; } }
public string Value { get { throw null; } }
}
}
namespace Microsoft.Extensions.Azure
{
public static partial class TemplateClientBuilderExtensions
{
public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Template.TemplateClient, Azure.Template.TemplateClientOptions> AddTemplateClient<TBuilder>(this TBuilder builder, string vaultBaseUrl) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; }
public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Template.TemplateClient, Azure.Template.TemplateClientOptions> AddTemplateClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration<TConfiguration> { throw null; }
}
}
12 changes: 12 additions & 0 deletions sdk/cloudmachine/Azure.CloudMachine/samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
page_type: sample
languages:
- csharp
products:
# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product
- azure
name: Azure.CloudMachine samples for .NET
description: Samples for the Azure.CloudMachine client library.
---

# Azure.CloudMachine Samples
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Azure.CloudMachine simplifies getting started with Azure in .NET.</Description>
<Version>1.0.0-beta.1</Version>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<LangVersion>12</LangVersion>

<!-- Disable warning CS1591: Missing XML comment for publicly visible type or member -->
<NoWarn>CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Core" />
<PackageReference Include="Azure.AI.OpenAI" />
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Azure.Messaging.ServiceBus" />
<PackageReference Include="Azure.Messaging.EventGrid" />
<PackageReference Include="Azure.Storage.Blobs" />
<PackageReference Include="Azure.Security.KeyVault.Secrets" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" VersionOverride="8.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace Azure.Core;
// TODO: this is a very demo implementation. We need to do better
public class ClientCache
{
private readonly Dictionary<(Type, string?), object> _clients = new Dictionary<(Type, string?), object>();
private readonly Dictionary<(Type, string), object> _clients = new Dictionary<(Type, string), object>();

public T Get<T>(Func<T> value, string? id = default) where T: class
public T Get<T>(Func<T> value, string id = default) where T: class
{
var client = (typeof(T), id);
lock (_clients)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Azure.Core;

public abstract class ClientWorkspace
{
public abstract ClientConnectionOptions GetConnectionOptions(Type clientType, string? instanceId = default);
public abstract ClientConnectionOptions GetConnectionOptions(Type clientType, string instanceId = default);

[EditorBrowsable(EditorBrowsableState.Never)]
public ClientCache Subclients { get; } = new ClientCache();
Expand Down Expand Up @@ -36,10 +36,10 @@ public ClientConnectionOptions(string subclientId)

public ClientConnectionKind ConnectionKind { get; }

public Uri? Endpoint { get; }
public string? Id { get; }
public string? ApiKeyCredential { get; }
public TokenCredential? TokenCredential { get; }
public Uri Endpoint { get; }
public string Id { get; }
public string ApiKeyCredential { get; }
public TokenCredential TokenCredential { get; }
}

public enum ClientConnectionKind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ namespace Azure.CloudMachine;

public partial class CloudMachineClient : CloudMachineWorkspace
{
public CloudMachineClient(TokenCredential? credential = default, IConfiguration? configuration = default)
protected CloudMachineClient()
{ }
#pragma warning disable AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service.
public CloudMachineClient(TokenCredential credential = default, IConfiguration configuration = default)
#pragma warning restore AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service.
: base(credential, configuration)
{
Messaging = new MessagingServices(this);
Expand Down
Loading
Loading