Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Azure libraries for .Net

License

NotificationsYou must be signed in to change notification settings

jblackburn21/azure-libraries-for-net

 
 

Repository files navigation

This README is based on the released stable version (1.3). If you are looking for other releases, seeMore Information

The Azure Management Libraries for .NET is a higher-level, object-oriented API for managing Azure resources. Libraries are built on the lower-level, request-response styleauto generated clients and can run side-by-side withauto generated clients.

Feature Availability and Road Map as of Version 1.3

Service | featureAvailable as GAAvailable as PreviewComing soon
ComputeVirtual machines and VM extensions
Virtual machine scale sets
Managed disks
Azure container service + registry + instances
Availability Zones
More Azure container registry features
StorageStorage accountsEncryption
SQL DatabaseDatabases
Firewalls
Elastic pools
More features
NetworkingVirtual networks
Network interfaces
IP addresses
Routing table
Network security groups
Application gateways
DNS
Traffic managers
Load balancers
Network peering
Virtual Network Gateway
Network watchers
VPN
More application gateway features
More servicesResource Manager
Key Vault
Redis
CDN
Batch
Web apps
Function Apps
Service bus
Graph RBAC
Cosmos DB
Search
Monitor
Data Lake
FundamentalsAuthentication - core
Async methods
Managed Service Identity

Preview features are flagged in documentation comments in libraries. These features are subject to change. They can be modified in any way, or even removed, in the future.

Azure Authentication

TheAzure class is the simplest entry point for creating and interacting with Azure resources.

IAzureazure=Azure.Authenticate(credFile).WithDefaultSubscription();

Create a Cosmos DB with DocumentDB Programming Model

You can create a Cosmos DB account by using adefine() … create() method chain.

vardocumentDBAccount=azure.DocumentDBAccounts.Define(docDBName).WithRegion(Region.USEast).WithNewResourceGroup(rgName).WithKind(DatabaseAccountKind.GlobalDocumentDB).WithSessionConsistency().WithWriteReplication(Region.USWest).WithReadReplication(Region.USCentral).Create();

Create a Virtual Machine

You can create a virtual machine instance by using aDefine() … Create() method chain.

Console.WriteLine("Creating a Windows VM");varwindowsVM=azure.VirtualMachines.Define("myWindowsVM").WithRegion(Region.USEast).WithNewResourceGroup(rgName).WithNewPrimaryNetwork("10.0.0.0/28").WithPrimaryPrivateIPAddressDynamic().WithNewPrimaryPublicIPAddress("mywindowsvmdns").WithPopularWindowsImage(KnownWindowsVirtualMachineImage.WindowsServer2012R2Datacenter).WithAdminUsername("tirekicker").WithAdminPassword(password).WithSize(VirtualMachineSizeTypes.StandardD3V2).Create();Console.WriteLine("Created a Windows VM: "+windowsVM.Id);

Update a Virtual Machine

You can update a virtual machine instance by using anUpdate() … Apply() method chain.

windowsVM.Update().WithNewDataDisk(20,lun,CachingTypes.ReadWrite).Apply();

Create a Virtual Machine Scale Set

You can create a virtual machine scale set instance by using anotherDefine() … Create() method chain.

varvirtualMachineScaleSet=azure.VirtualMachineScaleSets.Define(vmssName).WithRegion(Region.USEast).WithExistingResourceGroup(rgName).WithSku(VirtualMachineScaleSetSkuTypes.StandardD3v2).WithExistingPrimaryNetworkSubnet(network,"Front-end").WithExistingPrimaryInternetFacingLoadBalancer(loadBalancer1).WithPrimaryInternetFacingLoadBalancerBackends(backendPoolName1,backendPoolName2).WithPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22,natPool60XXto23).WithoutPrimaryInternalLoadBalancer().WithPopularLinuxImage(KnownLinuxVirtualMachineImage.UbuntuServer16_04_Lts).WithRootUsername(userName).WithSsh(sshKey).WithNewDataDisk(100).WithNewDataDisk(100,1,CachingTypes.ReadWrite).WithNewDataDisk(100,2,CachingTypes.ReadWrite,StorageAccountTypes.StandardLRS).WithCapacity(3).Create();

Create a Network Security Group

You can create a network security group instance by using anotherDefine() … Create() method chain.

varfrontEndNSG=azure.NetworkSecurityGroups.Define(frontEndNSGName).WithRegion(Region.USEast).WithNewResourceGroup(rgName).DefineRule("ALLOW-SSH").AllowInbound().FromAnyAddress().FromAnyPort().ToAnyAddress().ToPort(22).WithProtocol(SecurityRuleProtocol.Tcp).WithPriority(100).WithDescription("Allow SSH").Attach().DefineRule("ALLOW-HTTP").AllowInbound().FromAnyAddress().FromAnyPort().ToAnyAddress().ToPort(80).WithProtocol(SecurityRuleProtocol.Tcp).WithPriority(101).WithDescription("Allow HTTP").Attach().Create();

Create an Application Gateway

You can create a application gateway instance by using anotherdefine() … create() method chain.

varapplicationGateway=azure.ApplicationGateways.Define("myFirstAppGateway").WithRegion(Region.USEast).WithExistingResourceGroup(resourceGroup)// Request routing rule for HTTP from public 80 to public 8080.DefineRequestRoutingRule("HTTP-80-to-8080").FromPublicFrontend().FromFrontendHttpPort(80).ToBackendHttpPort(8080).ToBackendIPAddress("11.1.1.1").ToBackendIPAddress("11.1.1.2").ToBackendIPAddress("11.1.1.3").ToBackendIPAddress("11.1.1.4").Attach().WithExistingPublicIPAddress(publicIpAddress).Create();

Create a Web App

You can create a Web App instance by using anotherdefine() … create() method chain.

varwebApp=azure.WebApps.Define(appName).WithRegion(Region.USWest).WithNewResourceGroup(rgName).WithNewFreeAppServicePlan().Create();

Create a SQL Database

You can create a SQL server instance by using anotherdefine() … create() method chain.

varsqlServer=azure.SqlServers.Define(sqlServerName).WithRegion(Region.USEast).WithNewResourceGroup(rgName).WithAdministratorLogin(administratorLogin).WithAdministratorPassword(administratorPassword).WithNewFirewallRule(firewallRuleIpAddress).WithNewFirewallRule(firewallRuleStartIpAddress,firewallRuleEndIpAddress).Create();

Then, you can create a SQL database instance by using anotherdefine() … create() method chain.

vardatabase=sqlServer.Databases.Define(databaseName).Create();

Sample Code

You can find plenty of sample code that illustrates management scenarios (95+ end-to-end scenarios) for Azure Virtual Machines, Virtual Machine Scale Sets, Managed Disks, Active Directory Azure Container Service and Registry, Storage, Networking, Resource Manager, SQL Database, Cosmos DB, App Service (Web Apps on Windows and Linux), Functions, Service Bus, Key Vault, Redis, CDN and Batch …

ServiceManagement Scenario
Virtual Machines
Virtual Machines - parallel execution
Virtual Machine Scale Sets
Active Directory
Container Service
Container Registry and
Container Instances
Storage
Networking
Networking - DNS
Traffic Manager
Application Gateway
SQL Database
Redis Cache
App Service - Web Apps onWindows
App Service - Web Apps onLinux
Functions
Cosmos DB
Service Bus
Resource Groups
Key Vault
CDN
Batch
Search

Download

1.3 release builds are available on NuGet:

Azure Management LibraryPackage nameStable (1.3 release)
Azure Management Client (wrapper package)Microsoft.Azure.Management.FluentNuGet
App Service (Web Apps and Functions)Microsoft.Azure.Management.AppService.FluentNuGet
BatchMicrosoft.Azure.Management.Batch.FluentNuGet
CDNMicrosoft.Azure.Management.Cdn.FluentNuGet
Virtual Machines, Virtual Machine Scale Sets, Azure Container ServicesMicrosoft.Azure.Management.Compute.FluentNuGet
Container InstanceMicrosoft.Azure.Management.ContainerInstance.FluentNuGet
Container RegistryMicrosoft.Azure.Management.ContainerRegistry.FluentNuGet
Cosmos DBMicrosoft.Azure.Management.CosmosDB.FluentNuGet
DNSMicrosoft.Azure.Management.Dns.FluentNuGet
Graph RBACMicrosoft.Azure.Management.Graph.RBAC.FluentNuGet
Key VaultMicrosoft.Azure.Management.KeyVault.FluentNuGet
NetworkingMicrosoft.Azure.Management.Network.FluentNuGet
Redis CacheMicrosoft.Azure.Management.Redis.FluentNuGet
Resource ManagerMicrosoft.Azure.Management.ResourceManager.FluentNuGet
SearchMicrosoft.Azure.Management.Search.FluentNuGet
Service BusMicrosoft.Azure.Management.ServiceBus.FluentNuGet
SQL DatabaseMicrosoft.Azure.Management.Sql.FluentNuGet
StorageMicrosoft.Azure.Management.Storage.FluentNuGet
Traffic ManagerMicrosoft.Azure.Management.TrafficManager.FluentNuGet

Pre-requisites

Help

If you are migrating your code to 1.3, you can use these notes forpreparing your code for 1.3 from 1.2.

If you encounter any bugs with these libraries, please file issues viaIssues or checkoutStackOverflow for Azure Management Libraries for .NET.

To enable Http message tracing in your code please checkthis article.

Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided inMicrosoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Information

Previous Releases and Corresponding Repo Branches

VersionSHA1Remarks
1.31.3Tagged release for 1.3 version of Azure management libraries
1.21.2Tagged release for 1.2 version of Azure management libraries
1.11.1Tagged release for 1.1 version of Azure management libraries
1.01.0Tagged release for 1.0 version of Azure management libraries
1.0.0-beta51.0.0-beta5Tagged release for 1.0.0-beta5 version of Azure management libraries
1.0.0-beta41.0.0-beta4Tagged release for 1.0.0-beta4 version of Azure management libraries
1.0.0-beta31.0.0-beta3Tagged release for 1.0.0-beta3 version of Azure management libraries
AutoRestAutoRestMain branch for AutoRest generated raw clients

This project has adopted theMicrosoft Open Source Code of Conduct. For more information see theCode of Conduct FAQ or contactopencode@microsoft.com with any additional questions or comments.

About

Azure libraries for .Net

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C#100.0%

[8]ページ先頭

©2009-2025 Movatter.jp